Skip to content

Commit 2b05980

Browse files
committed
Update the tests after the change to copy_prop
1 parent 352dcd0 commit 2b05980

5 files changed

+30
-20
lines changed

tests/mir-opt/copy-prop/borrowed_local.borrow_in_loop.CopyProp.panic-abort.diff

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
}
4444

4545
bb1: {
46-
- StorageLive(_6);
46+
StorageLive(_6);
4747
StorageLive(_7);
4848
_7 = copy (*_2);
4949
_6 = Not(move _7);
5050
StorageDead(_7);
51-
- StorageLive(_8);
51+
StorageLive(_8);
5252
StorageLive(_9);
5353
_9 = copy (*_2);
5454
_8 = Not(move _9);
@@ -80,8 +80,8 @@
8080
- StorageDead(_14);
8181
_0 = const ();
8282
StorageDead(_13);
83-
- StorageDead(_8);
84-
- StorageDead(_6);
83+
StorageDead(_8);
84+
StorageDead(_6);
8585
- StorageDead(_4);
8686
StorageDead(_2);
8787
StorageDead(_1);
@@ -93,8 +93,8 @@
9393
- StorageDead(_14);
9494
- _5 = const ();
9595
StorageDead(_13);
96-
- StorageDead(_8);
97-
- StorageDead(_6);
96+
StorageDead(_8);
97+
StorageDead(_6);
9898
goto -> bb1;
9999
}
100100
}

tests/mir-opt/copy-prop/borrowed_local.borrow_in_loop.CopyProp.panic-unwind.diff

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
}
4444

4545
bb1: {
46-
- StorageLive(_6);
46+
StorageLive(_6);
4747
StorageLive(_7);
4848
_7 = copy (*_2);
4949
_6 = Not(move _7);
5050
StorageDead(_7);
51-
- StorageLive(_8);
51+
StorageLive(_8);
5252
StorageLive(_9);
5353
_9 = copy (*_2);
5454
_8 = Not(move _9);
@@ -80,8 +80,8 @@
8080
- StorageDead(_14);
8181
_0 = const ();
8282
StorageDead(_13);
83-
- StorageDead(_8);
84-
- StorageDead(_6);
83+
StorageDead(_8);
84+
StorageDead(_6);
8585
- StorageDead(_4);
8686
StorageDead(_2);
8787
StorageDead(_1);
@@ -93,8 +93,8 @@
9393
- StorageDead(_14);
9494
- _5 = const ();
9595
StorageDead(_13);
96-
- StorageDead(_8);
97-
- StorageDead(_6);
96+
StorageDead(_8);
97+
StorageDead(_6);
9898
goto -> bb1;
9999
}
100100
}

tests/mir-opt/copy-prop/copy_prop_storage_removed_when_local_borrowed.f.CopyProp.diff

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
let mut _4: &T;
99

1010
bb0: {
11-
- StorageLive(_2);
11+
StorageLive(_2);
1212
_2 = copy (_1.0: T);
13-
- _3 = copy _2;
14-
- _4 = &_3;
15-
- StorageDead(_2);
16-
+ _4 = &_2;
13+
_3 = copy _2;
14+
_4 = &_3;
15+
StorageDead(_2);
1716
_0 = copy (*_4);
1817
return;
1918
}

tests/mir-opt/copy-prop/copy_prop_storage_removed_when_local_borrowed.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ pub fn f<T: Copy + Freeze>(_1: (T, T)) -> T {
1818
let _4: &T;
1919
// CHECK: bb0: {
2020
{
21-
// CHECK-NOT: StorageLive(_2);
22-
// CHECK: _4 = &_2;
23-
// CHECK-NOT: StorageDead(_2);
21+
// FIXME: Currently, copy propagation will not unify borrowed locals.
22+
// If it does, the storage statements for `_2` should be remove
23+
// so these checks will need to be updated.
24+
// CHECK: StorageLive(_2);
25+
// CHECK: _4 = &_3;
26+
// CHECK: StorageDead(_2);
2427
StorageLive(_2);
2528
_2 = _1.0;
2629
_3 = _2;

tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
6868
}
6969

7070
bb0: {
71+
StorageLive(_4);
7172
_3 = copy (*_2);
7273
_4 = &((*_3).0: usize);
74+
StorageLive(_5);
7375
_5 = &((*_3).1: usize);
76+
StorageLive(_6);
7477
_6 = &((*_3).2: usize);
78+
StorageLive(_7);
7579
_7 = &((*_3).3: usize);
7680
StorageLive(_13);
7781
StorageLive(_8);
@@ -180,6 +184,10 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
180184
bb9: {
181185
StorageDead(_19);
182186
StorageDead(_13);
187+
StorageDead(_7);
188+
StorageDead(_6);
189+
StorageDead(_5);
190+
StorageDead(_4);
183191
return;
184192
}
185193
}

0 commit comments

Comments
 (0)