about summary refs log tree commit diff
path: root/src/librustc_mir/transform/inline.rs
AgeCommit message (Collapse)AuthorLines
2019-03-21review fixesSaleem Jaffer-8/+3
2019-03-18fixed all compilation errorsSaleem Jaffer-0/+1
2019-03-18promoted is still left in 2 placesSaleem Jaffer-4/+8
2019-03-07HirIdification: replace NodeId method callsljedrz-2/+4
2019-03-05Handle new ConstValue variants in mirvarkor-1/+1
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-01Put Local, Static and Promoted as one Base variant of PlaceSantiago Pastorino-8/+8
2019-02-26replace &'tcx Substs with SubstsRefcsmoe-2/+2
2019-02-15Always emit an error for a query cycleJohn Kåre Alsaker-14/+26
2019-02-09pass full InstanceDef to run_passesRalf Jung-5/+5
2019-02-08librustc_mir => 2018Taiki Endo-3/+3
2019-01-21Differentiate between closure and function bodiesOliver Scherer-8/+4
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-18treat ref-to-raw cast like a reborrow: do a special kind of retagRalf Jung-4/+5
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-2/+2
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn Kåre Alsaker-2/+2
2018-12-03Retag needs to know whether this is a 2-phase-reborrowRalf Jung-2/+8
2018-11-09Don't inline virtual calls (take 2)Wesley Wiser-45/+49
When I fixed the previous mis-optimizations, I didn't realize there were actually two different places where we mutate `callsites` and both of them should have the same behavior. As a result, if a function was inlined and that function contained virtual function calls, they were incorrectly being inlined. I also added a test case which covers this.
2018-11-07Consume optimization fuel from the MIR inlinerWesley Wiser-1/+13
This makes it easier to debug mis-optimizations that occur during inlining. Thanks to @nikomatsakis for the suggestion!
2018-10-29make inliner remove the fn_entry flag on Retag statementsRalf Jung-0/+8
2018-10-14[mir-inlining] Don't inline virtual callsWesley Wiser-7/+16
Prior to this change, the test case would output `1` instead of `2` like it should.
2018-09-26Auto merge of #54526 - nnethercote:shrink-StatementKind, r=nagisabors-2/+2
Shrink `StatementKind` `StatementKind` occurs in significant amounts in Massif profiles.
2018-09-24Shrink StatementKind::Assign.Nicholas Nethercote-2/+2
This shrinks StatementKind from 80 bytes to 64 bytes on 64-bit.
2018-09-20Extend MIR inlining to all operand variantsChristian Poveda-2/+2
2018-09-18Merge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.Nicholas Nethercote-2/+2
Currently we have two files implementing bitsets (and 2D bit matrices). This commit combines them into one, taking the best features from each. This involves renaming a lot of things. The high level changes are as follows. - bitvec.rs --> bit_set.rs - indexed_set.rs --> (removed) - BitArray + IdxSet --> BitSet (merged, see below) - BitVector --> GrowableBitSet - {,Sparse,Hybrid}IdxSet --> {,Sparse,Hybrid}BitSet - BitMatrix --> BitMatrix - SparseBitMatrix --> SparseBitMatrix The changes within the bitset types themselves are as follows. ``` OLD OLD NEW BitArray<C> IdxSet<T> BitSet<T> -------- ------ ------ grow - grow new - (remove) new_empty new_empty new_empty new_filled new_filled new_filled - to_hybrid to_hybrid clear clear clear set_up_to set_up_to set_up_to clear_above - clear_above count - count contains(T) contains(&T) contains(T) contains_all - superset is_empty - is_empty insert(T) add(&T) insert(T) insert_all - insert_all() remove(T) remove(&T) remove(T) words words words words_mut words_mut words_mut - overwrite overwrite merge union union - subtract subtract - intersect intersect iter iter iter ``` In general, when choosing names I went with: - names that are more obvious (e.g. `BitSet` over `IdxSet`). - names that are more like the Rust libraries (e.g. `T` over `C`, `insert` over `add`); - names that are more set-like (e.g. `union` over `merge`, `superset` over `contains_all`, `domain_size` over `num_bits`). Also, using `T` for index arguments seems more sensible than `&T` -- even though the latter is standard in Rust collection types -- because indices are always copyable. It also results in fewer `&` and `*` sigils in practice.
2018-08-22Remove Ty prefix from ↵varkor-4/+4
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-19Fix typos found by codespell.Matthias Krüger-3/+3
2018-08-01Split out growth functionality into BitVector typeMark Rousskov-2/+2
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-4/+3
2018-07-23Promoteds are statics and statics have a place, not just a valueOliver Schneider-15/+12
2018-06-14rustc: rename ty::maps to ty::query.Eduard-Mihai Burtescu-3/+2
2018-05-30rustc: rename mir::LocalDecl's syntactic_source_info to source_info.Eduard-Mihai Burtescu-3/+3
2018-05-30rustc: turn mir::LocalDecl's visibility_source_info into a SourceScope.Eduard-Mihai Burtescu-3/+1
2018-05-30rustc: rename mir::LocalDecl's source_info to visibility_source_info.Eduard-Mihai Burtescu-2/+3
2018-05-30rustc: turn mir::LocalDecl's syntactic_scope into a SourceInfo.Eduard-Mihai Burtescu-0/+3
2018-05-30rustc: rename mir::VisibilityScope to mir::SourceScope.Eduard-Mihai Burtescu-5/+5
2018-05-17Rename trans to codegen everywhere.Irina Popa-8/+8
2018-05-01rustc: return impl Iterator from Terminator(Kind)::successors(_mut).Eduard-Mihai Burtescu-1/+1
2018-04-27Auto merge of #50102 - Zoxc:query-nomacro, r=michaelwoeristerbors-1/+1
Move query code outside macros and store query jobs separately from query results Based on https://github.com/rust-lang/rust/pull/50067 r? @michaelwoerister
2018-04-27Auto merge of #50097 - glandium:box_free, r=nikomatsakisbors-63/+2
Partial future-proofing for Box<T, A> In some ways, this is similar to @eddyb's PR #47043 that went stale, but doesn't cover everything. Notably, this still leaves Box internalized as a pointer in places, so practically speaking, only ZSTs can be practically added to the Box type with the changes here (the compiler ICEs otherwise). The Box type is not changed here, that's left for the future because I want to test that further first, but this puts things in place in a way that hopefully will make things easier.
2018-04-27Move query functions out from the define_maps! macroJohn Kåre Alsaker-1/+1
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-1/+1
2018-04-20Pass the right type to box_free() in MIRMike Hommey-63/+2
Currently, MIR just passes the raw Box to box_free(), which happens to work because practically, it's the same thing. But that might not be true in the future, with Box<T, A: Alloc>. The MIR inline pass actually fixes up the argument while inlining box_free, but this is not enabled by default and doesn't necessarily happen (the inline threshold needs to be passed). This change effectively moves what the MIR inline pass does to the elaborate_drops pass, so that box_free() is passed the raw pointer instead of the Box.
2018-03-14remove defaulting to unitAndrew Cann-1/+1
Types will no longer default to `()`, instead always defaulting to `!`. This disables the associated warning and removes the flag from TyTuple
2018-03-13`trans_apply_param_substs` => `subst_and_normalize_erasing_regions`Niko Matsakis-27/+7
Consolidate `trans_apply_param_substs` and `trans_apply_param_substs_env`. Also remove `trans_impl_self_ty`
2018-03-08Produce instead of pointersOliver Schneider-0/+7
2018-03-06Replace attr::contains_name(..., "cold")Wesley Wiser-5/+5
Part of #47320
2018-03-06Add `inline` to `TransFnAttrs`Wesley Wiser-1/+1
Part of #47320
2018-02-09Auto merge of #47802 - bobtwinkles:loop_false_edge, r=nikomatsakisbors-0/+3
[NLL] Add false edges out of infinite loops Resolves #46036 by adding a `cleanup` member to the `FalseEdges` terminator kind. There's also a small doc fix to one of the other comments in `into.rs` which I can pull out in to another PR if desired =) This PR should pass CI but the test suite has been relatively unstable on my system so I'm not 100% sure. r? @nikomatsakis
2018-02-08Encode (in MIR) whether borrows are explicit in source or arise due to autoref.Felix S. Klock II-2/+2
This is foundation for issue 46747 (limit two-phase borrows to method-call autorefs).
2018-02-05mir: Add TerminatorKind::FalseUnwindbobtwinkles-0/+3
Sometimes a simple goto misses the cleanup/unwind edges. Specifically, in the case of infinite loops such as those introduced by a loop statement without any other out edges. Analogous to TerminatorKind::FalseEdges; this new terminator kind is used when we want borrowck to consider an unwind path, but real control flow should never actually take it.