Do not run simplify_locals inside DSE.

The full pass is run short after.
This commit is contained in:
Camille GILLOT 2024-01-07 12:22:33 +00:00
parent 974b727874
commit bc35ee41fa
4 changed files with 9 additions and 7 deletions

View file

@ -123,8 +123,6 @@ pub fn eliminate<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
let Operand::Copy(place) = *arg else { bug!() };
*arg = Operand::Move(place);
}
crate::simplify::simplify_locals(body, tcx)
}
pub enum DeadStoreElimination {

View file

@ -5,8 +5,8 @@
debug x => _1;
let mut _0: ();
let _2: ();
- let mut _3: i32;
- let mut _4: i32;
let mut _3: i32;
let mut _4: i32;
bb0: {
StorageLive(_2);

View file

@ -5,8 +5,8 @@
debug x => _1;
let mut _0: ();
let _2: ();
- let mut _3: i32;
- let mut _4: i32;
let mut _3: i32;
let mut _4: i32;
bb0: {
StorageLive(_2);

View file

@ -4,7 +4,7 @@
fn cycle(_1: i32, _2: i32, _3: i32) -> () {
let mut _0: ();
let mut _4: bool;
- let mut _5: i32;
let mut _5: i32;
bb0: {
_4 = cond() -> [return: bb1, unwind continue];
@ -19,6 +19,10 @@
- _3 = _2;
- _2 = _1;
- _1 = _5;
+ nop;
+ nop;
+ nop;
+ nop;
_4 = cond() -> [return: bb1, unwind continue];
}