Skip to content

Commit

Permalink
Do not run simplify_locals inside DSE.
Browse files Browse the repository at this point in the history
The full pass is run short after.
  • Loading branch information
cjgillot committed Jan 11, 2024
1 parent 974b727 commit bc35ee4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 0 additions & 2 deletions compiler/rustc_mir_transform/src/dead_store_elimination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -19,6 +19,10 @@
- _3 = _2;
- _2 = _1;
- _1 = _5;
+ nop;
+ nop;
+ nop;
+ nop;
_4 = cond() -> [return: bb1, unwind continue];
}

Expand Down

0 comments on commit bc35ee4

Please sign in to comment.