Skip to content

Commit bc35ee4

Browse files
committed
Do not run simplify_locals inside DSE.
The full pass is run short after.
1 parent 974b727 commit bc35ee4

4 files changed

+9
-7
lines changed

compiler/rustc_mir_transform/src/dead_store_elimination.rs

-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ pub fn eliminate<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
123123
let Operand::Copy(place) = *arg else { bug!() };
124124
*arg = Operand::Move(place);
125125
}
126-
127-
crate::simplify::simplify_locals(body, tcx)
128126
}
129127

130128
pub enum DeadStoreElimination {

tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-abort.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
debug x => _1;
66
let mut _0: ();
77
let _2: ();
8-
- let mut _3: i32;
9-
- let mut _4: i32;
8+
let mut _3: i32;
9+
let mut _4: i32;
1010

1111
bb0: {
1212
StorageLive(_2);

tests/mir-opt/dead-store-elimination/call_arg_copy.move_simple.DeadStoreElimination-final.panic-unwind.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
debug x => _1;
66
let mut _0: ();
77
let _2: ();
8-
- let mut _3: i32;
9-
- let mut _4: i32;
8+
let mut _3: i32;
9+
let mut _4: i32;
1010

1111
bb0: {
1212
StorageLive(_2);

tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
fn cycle(_1: i32, _2: i32, _3: i32) -> () {
55
let mut _0: ();
66
let mut _4: bool;
7-
- let mut _5: i32;
7+
let mut _5: i32;
88

99
bb0: {
1010
_4 = cond() -> [return: bb1, unwind continue];
@@ -19,6 +19,10 @@
1919
- _3 = _2;
2020
- _2 = _1;
2121
- _1 = _5;
22+
+ nop;
23+
+ nop;
24+
+ nop;
25+
+ nop;
2226
_4 = cond() -> [return: bb1, unwind continue];
2327
}
2428

0 commit comments

Comments
 (0)