about summary refs log tree commit diff
path: root/src/librustc_mir/transform/simplify.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-547/+0
2020-08-03Remove redundant assignment from CfgSimplifierTomasz Miąsko-2/+0
2020-08-03Fix change detection in CfgSimplifier::collapse_goto_chainTomasz Miąsko-1/+1
Check that the old target is different from the new collapsed one, before concluding that anything changed.
2020-08-01Replace a recursive algorithm with an iterative one and a stack.Oliver Scherer-26/+43
2020-04-23Clean up fragile checks of optimized away constantsSantiago Pastorino-25/+10
2020-04-22Use `Body` everywhereDylan MacKenzie-7/+6
2020-04-16Respond to code review feedbackWesley Wiser-1/+9
- Remove reads of indirect `Place`s - Add comments explaining what the algorithm does
2020-04-15Directly modify the `used_locals` vecWesley Wiser-14/+12
Fixes perf regression in `optimized_mir` query
2020-04-15Run `SimplifyLocals` iteratively until we get to a fixedpointWesley Wiser-27/+131
2020-04-15Remove other RvaluesWesley Wiser-12/+30
2020-04-11Pass the `PlaceElem::Index` local to `visit_local`Jonas Schievink-7/+0
2020-04-02Remove unused discriminant reads from MIR bodiesWesley Wiser-11/+15
Allow the `SimplifyLocals` pass to remove reads of discriminants if the read is never used.
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-2/+2
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-3/+3
2020-03-29Use `&` to do deref coercion for `ReadOnlyBodyAndCache`Dylan MacKenzie-1/+1
2020-03-29Make `Visitor::visit_body` take a simple `Body`Dylan MacKenzie-1/+1
2020-03-12Auto merge of #68551 - Marwes:allocations_mir, r=ecstatic-morsebors-7/+23
perf: Reuse a Vec in mir simplification Just moves the vec out of the outer loop so it is reused every iteration
2020-03-03Use .next() instead of .nth(0) on iterators.Matthias Krüger-1/+1
2020-03-02s/merged_block_count/statements_to_merge/gMarkus Westerlind-3/+3
2020-02-16Clarify mir block mergingMarkus Westerlind-1/+5
2020-02-13perf(mir): Reserve enough space for the merged blocks before appendingMarkus Westerlind-4/+17
2020-02-13Avoid an intermediate Vec in mir simplifyMarkus Westerlind-7/+6
2020-02-13Use Vec::appendMarkus Westerlind-1/+1
2020-02-13Reuse a Vec in mir simplificationMarkus Westerlind-2/+2
2020-01-10Remove PlaceBase enum and make Place base field be local: LocalSantiago Pastorino-3/+1
2020-01-10Remove Static from PlaceBaseSantiago Pastorino-7/+3
2019-12-22Format the worldMark Rousskov-81/+62
2019-12-11Rollup merge of #67134 - oli-obk:const_prop_zst, r=wesleywiserYuki Okushi-4/+9
Ensure that we get a hard error on generic ZST constants if their bod… …y causes an error during evaluation cc #67083 (does not fix because we still need the beta backport) r? @wesleywiser cc @RalfJung
2019-12-08Ensure that we get a hard error on generic ZST constants if their body ↵Oliver Scherer-4/+9
causes an error during evaluation
2019-12-05rustc: Apply clearer naming to BodyAndCache, fix Deref impl, remove unneeded ↵Paul Daniel Faria-5/+5
Index impl, remove body fn rustc_codegen_ssa: Fix BodyAndCache reborrow to Body and change instances of body() call to derefence rustc_mir: Fix BodyAndCache reborrow to Body and change intances of body() call to derefence
2019-12-02Remove HasLocalDecls impl from BodyCache's, properly reborrow to Body, ↵Paul Daniel Faria-23/+23
rename all body_cache back to body
2019-12-02Remove BodyCache.body and rely on Deref as much as possible for ↵Paul Daniel Faria-2/+2
ReadOnlyBodyCache
2019-12-02Fix tidy errorsPaul Daniel Faria-2/+6
2019-12-02Fix remaining compilation issuesPaul Daniel Faria-1/+2
2019-12-02Simplify BodyCache impl and fix all remaining type errors in librustc_mir ↵Paul Daniel Faria-23/+23
(lifetime errors still exist)
2019-12-02Address nits and remove unneeded passPaul Daniel Faria-5/+3
2019-12-02Move predecessors cache invalidation back to basic_blocks_mut, add a couple ↵Paul Daniel Faria-37/+36
more ensure_predecessors to prevent panics
2019-12-02Address linting errors caught by CIPaul Daniel Faria-2/+2
2019-12-02Stop invalidating predecessors cache when accessing unique basic block, ↵Paul Daniel Faria-33/+37
invalidate cache when accessing unique terminator
2019-11-27rustc: move debug info from LocalDecl and UpvarDecl into a dedicated ↵Eduard-Mihai Burtescu-8/+0
VarDebugInfo.
2019-11-08[mir-opt] Handle aggregates in SimplifyLocals passWesley Wiser-8/+15
2019-10-22Intern place projectionSantiago Pastorino-3/+8
2019-10-20Improve SimplifyLocals pass so it can remove unused constsWesley Wiser-22/+54
The `ConstProp` can cause many locals to be initialized to a constant value and then never read from. `ConstProp` can also evaluate ZSTs into constant values. Previously, many of these would be removed by other parts of the MIR optimization pipeline. However, evaluating ZSTs (especially `()`) into constant values defeated those parts of the optimizer and so in a2e3ed5c054b544df6ceeb9e612d39af819f4aae, I added a hack to `ConstProp` that skips evaluating ZSTs to avoid that regression. This commit changes `SimplifyLocals` so that it doesn't consider writes of const values to a local to be a use of that local. In doing so, `SimplifyLocals` is able to remove otherwise unused locals left behind by other optimization passes (`ConstProp` in particular).
2019-10-18Use Cow to handle modifications of projection in preparation for interningSantiago Pastorino-5/+6
2019-10-17Add process_* place hooks to improve code reutilizationSantiago Pastorino-16/+8
2019-10-17Prepare simplify MutVisitor to have projections internedSantiago Pastorino-0/+20
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-1/+1
2019-09-29remove bit_set re-export from rustc_data_structurescsmoe-1/+1
2019-08-22Move 'tcx lifetime on MirPassWesley Wiser-4/+4
2019-07-03Remove needless lifetimesJeremy Stucki-1/+1