summary refs log tree commit diff
path: root/src/librustc_mir/transform/simplify.rs
AgeCommit message (Collapse)AuthorLines
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-2/+2
2019-06-14Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-6/+1
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-2/+2
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-8/+7
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-2/+2
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-2/+2
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-2/+2
2019-06-11rustc_mir: deny(unused_lifetimes).Eduard-Mihai Burtescu-1/+1
2019-06-09Changed usages of `mir` in librustc::mir and librustc_mir to `body`Jad Ghalayini-23/+23
2019-05-28Changes the type `mir::Mir` into `mir::Body`Claude-Alban RANÉLY-VERGÉ-DÉPRÉ-7/+7
The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool. Revisions asked by eddyb : - Renamed of all the occurences of {visit/super}_mir - Renamed test structures `CachedMir` to `Cached` Fixing the missing import on `AggregateKind`
2019-04-26Remove region from borrow place contextsMatthew Jasper-2/+2
2019-02-09fix rebase falloutRalf Jung-2/+2
2019-02-08librustc_mir => 2018Taiki Endo-3/+3
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-13Make SimplifyCfg collapse goto chains from bb0Shotaro Yamada-1/+26
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-1/+1
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-06refactor: use shorthand fieldsteresy-1/+1
2018-10-27Refactor and add `PlaceContext::AscribeUserTy`.David Wood-2/+4
This commit refactors `PlaceContext` to split it into four different smaller enums based on if the context represents a mutating use, non-mutating use, maybe-mutating use or a non-use (this is based on the recommendation from @oli-obk on Zulip[1]). This commit then introduces a `PlaceContext::AscribeUserTy` variant. `StatementKind::AscribeUserTy` is now correctly mapped to `PlaceContext::AscribeUserTy` instead of `PlaceContext::Validate`. `PlaceContext::AscribeUserTy` can also now be correctly categorized as a non-use which fixes an issue with constant promotion in statics after a cast introduces a `AscribeUserTy` statement. [1]: https://rust-lang.zulipchat.com/#narrow/stream/122657-wg-nll/subject/.2355288.20cast.20fails.20to.20promote.20to.20'static/near/136536949
2018-09-18Merge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.Nicholas Nethercote-5/+5
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-04Normalize DebugInfoLevel to standard styleMark Rousskov-2/+2
2018-08-01Split out growth functionality into BitVector typeMark Rousskov-5/+5
2018-07-25parameterize `BitVector` and `BitMatrix` by their index typesNiko Matsakis-14/+17
2018-05-17Rename trans to codegen everywhere.Irina Popa-1/+1
2018-05-01rustc: return impl Iterator from Terminator(Kind)::successors(_mut).Eduard-Mihai Burtescu-5/+5
2018-02-20rustc_mir: do not remove dead user variables if debuginfo needs them.Eduard-Mihai Burtescu-4/+13
2017-12-03funnel all unwind paths through a single Resume blockAriel Ben-Yehuda-34/+0
This simplifies analysis and borrow-checking because liveness at the resume point can always be simply propagated. Later on, the "dead" Resumes are removed.
2017-12-01MIR: s/Lvalue/Place in type names.Eduard-Mihai Burtescu-4/+4
2017-11-14rustc: split off BodyOwnerKind from MirSource.Eduard-Mihai Burtescu-2/+1
2017-11-14rustc: move the MIR pass infrastructure and list to rustc_mir.Eduard-Mihai Burtescu-1/+2
2017-09-04rustc_mir: use Local instead of Lvalue in Storage{Live,Dead}.Eduard-Mihai Burtescu-5/+2
2017-09-03rustc_mir: implement visit_local instead/along visit_lvalue where possible.Eduard-Mihai Burtescu-14/+6
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-2/+2
Like #43008 (f668999), but _much more aggressive_.
2017-08-01rustc_mir::transform::simplify - remove nops firstAriel Ben-Yehuda-2/+2
Removing nops can allow more basic blocks to be merged, but merging basic blocks can't allow for more nops to be removed, so we should remove nops first. This doesn't matter *that* much, because normally we run SimplifyCfg several times, but there's no reason not to do it.
2017-05-02simplify the MirPass traits and passes dramaticallyNiko Matsakis-23/+20
Overall goal: reduce the amount of context a mir pass needs so that it resembles a query. - The hooks are no longer "threaded down" to the pass, but rather run automatically from the top-level (we also thread down the current pass number, so that the files are sorted better). - The hook now receives a *single* callback, rather than a callback per-MIR. - The traits are no longer lifetime parameters, which moved to the methods -- given that we required `for<'tcx>` objecs, there wasn't much point to that. - Several passes now store a `String` instead of a `&'l str` (again, no point).
2017-05-02rework `MirPass` API to be stateless and extract helper fnsNiko Matsakis-2/+2
2017-04-22remove cleanup branches to the resume blockAriel Ben-Yehuda-0/+34
This improves LLVM performance by 10% lost during the shimmir transition.
2017-03-18apply pre-trans passes to Shim MIRAriel Ben-Yehuda-5/+9
2017-03-10Initial implementation of inlining for MIRJames Miller-3/+15
Fairly basic implementation of inlining for MIR. Uses conservative heuristics for inlining.
2017-02-10SwitchInt over SwitchSimonas Kazlauskas-1/+0
This removes another special case of Switch by replacing it with the more general SwitchInt. While this is more clunky currently, there’s no reason we can’t make it nice (and efficient) to use.
2017-02-10If is now always a SwitchInt in MIRSimonas Kazlauskas-1/+0
2016-11-03A way to remove otherwise unused locals from MIRSimonas Kazlauskas-0/+349
Replaces the hack where a similar thing is done within trans.