rust/src/librustc_mir/transform
Wesley Wiser 2ec73395b9 Improve SimplifyLocals pass so it can remove unused consts
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 a2e3ed5c05, 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-20 23:49:42 -04:00
..
check_consts Rollup merge of #65056 - spastorino:place-mut-visitor-adjusts, r=oli-obk 2019-10-03 16:25:49 -07:00
add_call_guards.rs remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00
add_moves_for_packed_drops.rs Move 'tcx lifetime on MirPass 2019-08-22 06:36:30 -04:00
add_retag.rs Rename sty to kind 2019-09-25 15:50:04 +01:00
check_unsafety.rs remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00
cleanup_post_borrowck.rs Make Place Boxed on Statement to reduce size from 64 bytes to 32 bytes 2019-09-11 16:28:06 -03:00
const_prop.rs Improve SimplifyLocals pass so it can remove unused consts 2019-10-20 23:49:42 -04:00
copy_prop.rs Make Place Boxed on Statement to reduce size from 64 bytes to 32 bytes 2019-09-11 16:28:06 -03:00
deaggregator.rs Make Place Boxed on Statement to reduce size from 64 bytes to 32 bytes 2019-09-11 16:28:06 -03:00
dump_mir.rs Move 'tcx lifetime on MirPass 2019-08-22 06:36:30 -04:00
elaborate_drops.rs remove bit_set re-export from rustc_data_structures 2019-09-29 16:11:30 +00:00
erase_regions.rs Use Cow to handle modifications of projection in preparation for interning 2019-10-18 10:06:13 -04:00
generator.rs Use Cow to handle modifications of projection in preparation for interning 2019-10-18 10:06:13 -04:00
inline.rs Use Cow to handle modifications of projection in preparation for interning 2019-10-18 10:06:13 -04:00
instcombine.rs remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00
mod.rs remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00
no_landing_pads.rs Move 'tcx lifetime on MirPass 2019-08-22 06:36:30 -04:00
promote_consts.rs Use Cow to handle modifications of projection in preparation for interning 2019-10-18 10:06:13 -04:00
qualify_consts.rs Suppress validation mismatch ICE in the presence of mut borrows 2019-10-16 18:01:26 -07:00
qualify_min_const_fn.rs rustc: arena-allocate the slice in ty::GenericsPredicate, not the whole struct. 2019-10-18 03:14:57 +03:00
remove_noop_landing_pads.rs remove bit_set re-export from rustc_data_structures 2019-09-29 16:11:30 +00:00
rustc_peek.rs Add rustc_peek support for IndirectlyMutableLocals 2019-10-01 20:29:57 -07:00
simplify.rs Improve SimplifyLocals pass so it can remove unused consts 2019-10-20 23:49:42 -04:00
simplify_branches.rs Move 'tcx lifetime on MirPass 2019-08-22 06:36:30 -04:00
uniform_array_move_out.rs remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00