Skip to content

Commit fdb31c3

Browse files
committed
Bless and update checks for mir-opt tests after rebasing from main
1 parent b1f5e07 commit fdb31c3

17 files changed

+345
-313
lines changed

tests/mir-opt/const_prop/union.main.GVN.diff

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@
1717

1818
bb0: {
1919
StorageLive(_1);
20-
- StorageLive(_2);
21-
+ nop;
20+
StorageLive(_2);
2221
_2 = const 1_u32;
2322
- _1 = Un { us: move _2 };
24-
- StorageDead(_2);
2523
+ _1 = const Un {{ us: 1_u32 }};
26-
+ nop;
24+
StorageDead(_2);
2725
StorageLive(_3);
2826
StorageLive(_4);
2927
- _4 = copy (_1.0: u32);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ fn main() {
1111
// CHECK: debug x => [[x:_.*]];
1212
// CHECK: debug y => [[y:_.*]];
1313
// CHECK: debug z => [[y]];
14-
// CHECK-NOT: StorageLive([[y]]);
14+
// CHECK: StorageLive([[y]]);
1515
// CHECK: [[y]] = copy [[x]];
1616
// CHECK-NOT: StorageLive(_3);
1717
// CHECK-NOT: _3 = copy [[y]];
1818
// CHECK-NOT: StorageLive(_4);
1919
// CHECK-NOT: _4 = copy _3;
2020
// CHECK-NOT: _1 = move _4;
2121
// CHECK: [[x]] = copy [[y]];
22+
// CHECK: StorageDead([[y]]);
2223
let mut x = val();
2324
let y = x;
2425
let z = y;

tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-abort.mir

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.panic-unwind.mir

Lines changed: 0 additions & 28 deletions
This file was deleted.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
fn main() {
66
// CHECK-LABEL: fn main(
77
// CHECK: debug i => [[i:_.*]];
8-
// CHECK-NOT: StorageLive([[i]]);
9-
// CHECK-NOT: StorageDead([[i]]);
8+
// CHECK: StorageLive([[i]]);
9+
// CHECK: StorageDead([[i]]);
1010
let mut sum = 0;
1111
let a = [0, 10, 20, 30];
1212

tests/mir-opt/dont_reset_cast_kind_without_updating_operand.test.GVN.32bit.panic-abort.diff

Lines changed: 110 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,28 @@
66
let _1: &std::boxed::Box<()>;
77
let _2: &std::boxed::Box<()>;
88
let _3: std::boxed::Box<()>;
9-
let mut _6: *const ();
10-
let mut _8: *const [()];
11-
let mut _9: std::boxed::Box<()>;
12-
let mut _10: *const ();
13-
let mut _23: usize;
9+
let mut _4: ();
10+
let mut _7: *const ();
11+
let mut _9: *const [()];
12+
let mut _10: std::boxed::Box<()>;
13+
let mut _11: *const ();
14+
let mut _16: usize;
15+
let mut _17: usize;
16+
let mut _27: usize;
1417
scope 1 {
1518
debug vp_ctx => _1;
16-
let _4: *const ();
19+
let _5: *const ();
1720
scope 2 {
18-
debug slf => _10;
19-
let _5: *const [()];
21+
debug slf => _5;
22+
let _6: *const [()];
2023
scope 3 {
21-
debug bytes => _5;
22-
let _7: *mut ();
24+
debug bytes => _6;
25+
let _8: *mut ();
2326
scope 4 {
24-
debug _x => _7;
27+
debug _x => _8;
2528
}
2629
scope 18 (inlined foo) {
30+
let mut _28: *const [()];
2731
}
2832
}
2933
scope 16 (inlined slice_from_raw_parts::<()>) {
@@ -33,21 +37,22 @@
3337
}
3438
}
3539
scope 5 (inlined Box::<()>::new) {
36-
let mut _11: usize;
37-
let mut _12: usize;
38-
let mut _13: *mut u8;
40+
let mut _12: *mut u8;
41+
let mut _13: *const ();
42+
let mut _14: std::ptr::NonNull<()>;
43+
let mut _15: std::ptr::Unique<()>;
3944
scope 6 (inlined alloc::alloc::exchange_malloc) {
40-
let _14: std::alloc::Layout;
41-
let mut _15: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>;
42-
let mut _16: isize;
43-
let mut _18: !;
45+
let _18: std::alloc::Layout;
46+
let mut _19: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>;
47+
let mut _20: isize;
48+
let mut _22: !;
4449
scope 7 {
45-
let _17: std::ptr::NonNull<[u8]>;
50+
let _21: std::ptr::NonNull<[u8]>;
4651
scope 8 {
4752
scope 11 (inlined NonNull::<[u8]>::as_mut_ptr) {
4853
scope 12 (inlined NonNull::<[u8]>::as_non_null_ptr) {
4954
scope 13 (inlined NonNull::<[u8]>::cast::<u8>) {
50-
let mut _22: *mut [u8];
55+
let mut _26: *mut [u8];
5156
scope 14 (inlined NonNull::<[u8]>::as_ptr) {
5257
}
5358
}
@@ -60,30 +65,38 @@
6065
}
6166
}
6267
scope 9 (inlined #[track_caller] Layout::from_size_align_unchecked) {
63-
let mut _19: bool;
64-
let _20: ();
65-
let mut _21: std::ptr::Alignment;
68+
let mut _23: bool;
69+
let _24: ();
70+
let mut _25: std::ptr::Alignment;
6671
}
6772
}
6873
}
6974

7075
bb0: {
7176
StorageLive(_1);
72-
StorageLive(_2);
77+
- StorageLive(_2);
78+
+ nop;
7379
StorageLive(_3);
74-
StorageLive(_11);
80+
StorageLive(_4);
81+
- _4 = ();
82+
+ _4 = const ();
7583
StorageLive(_12);
7684
StorageLive(_13);
77-
- _11 = SizeOf(());
78-
- _12 = AlignOf(());
79-
+ _11 = const 0_usize;
80-
+ _12 = const 1_usize;
81-
StorageLive(_16);
8285
StorageLive(_14);
83-
StorageLive(_19);
84-
_19 = const false;
85-
- switchInt(move _19) -> [0: bb6, otherwise: bb5];
86-
+ switchInt(const false) -> [0: bb6, otherwise: bb5];
86+
StorageLive(_15);
87+
StorageLive(_16);
88+
- _16 = const <() as std::mem::SizedTypeProperties>::SIZE;
89+
+ _16 = const 0_usize;
90+
StorageLive(_17);
91+
- _17 = const <() as std::mem::SizedTypeProperties>::ALIGN;
92+
+ _17 = const 1_usize;
93+
StorageLive(_20);
94+
StorageLive(_22);
95+
StorageLive(_24);
96+
StorageLive(_18);
97+
StorageLive(_23);
98+
_23 = UbChecks();
99+
switchInt(move _23) -> [0: bb6, otherwise: bb5];
87100
}
88101

89102
bb1: {
@@ -97,76 +110,95 @@
97110
}
98111

99112
bb3: {
100-
- _18 = handle_alloc_error(move _14) -> unwind unreachable;
101-
+ _18 = handle_alloc_error(const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }}) -> unwind unreachable;
113+
- _22 = handle_alloc_error(move _18) -> unwind unreachable;
114+
+ _22 = handle_alloc_error(const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }}) -> unwind unreachable;
102115
}
103116

104117
bb4: {
105-
StorageLive(_17);
106-
_17 = copy ((_15 as Ok).0: std::ptr::NonNull<[u8]>);
107-
StorageLive(_22);
108-
_22 = copy _17 as *mut [u8] (Transmute);
109-
_13 = copy _22 as *mut u8 (PtrToPtr);
118+
StorageLive(_21);
119+
_21 = copy ((_19 as Ok).0: std::ptr::NonNull<[u8]>);
120+
- StorageLive(_26);
121+
+ nop;
122+
_26 = copy _21 as *mut [u8] (Transmute);
123+
_12 = copy _26 as *mut u8 (PtrToPtr);
124+
- StorageDead(_26);
125+
+ nop;
126+
StorageDead(_21);
127+
StorageDead(_19);
128+
StorageDead(_18);
129+
StorageDead(_24);
110130
StorageDead(_22);
131+
StorageDead(_20);
111132
StorageDead(_17);
133+
StorageDead(_16);
134+
- _13 = copy _12 as *const () (PtrToPtr);
135+
+ _13 = copy _26 as *const () (PtrToPtr);
136+
_14 = NonNull::<()> { pointer: copy _13 };
137+
_15 = Unique::<()> { pointer: copy _14, _marker: const PhantomData::<()> };
138+
_3 = Box::<()>(move _15, const std::alloc::Global);
139+
- (*_13) = move _4;
140+
+ (*_13) = const ();
112141
StorageDead(_15);
113142
StorageDead(_14);
114-
StorageDead(_16);
115-
_3 = ShallowInitBox(copy _13, ());
116143
StorageDead(_13);
117144
StorageDead(_12);
118-
StorageDead(_11);
145+
StorageDead(_4);
119146
_2 = &_3;
120-
_1 = copy _2;
121-
StorageDead(_2);
122-
StorageLive(_4);
123-
- _9 = deref_copy _3;
124-
+ _9 = copy _3;
125-
_10 = copy ((_9.0: std::ptr::Unique<()>).0: std::ptr::NonNull<()>) as *const () (Transmute);
126-
_4 = copy _10;
147+
_1 = &(*_2);
148+
- StorageDead(_2);
149+
+ nop;
127150
StorageLive(_5);
151+
- _10 = copy (*_1);
152+
+ _10 = copy (*_2);
153+
_11 = copy ((_10.0: std::ptr::Unique<()>).0: std::ptr::NonNull<()>) as *const () (Transmute);
154+
_5 = &raw const (*_11);
128155
StorageLive(_6);
129-
- _6 = copy _4;
130-
+ _6 = copy _10;
131-
StorageLive(_23);
132-
_23 = const 1_usize;
133-
- _5 = *const [()] from (copy _6, copy _23);
134-
+ _5 = *const [()] from (copy _10, const 1_usize);
135-
StorageDead(_23);
136-
StorageDead(_6);
137156
StorageLive(_7);
157+
_7 = copy _5;
158+
StorageLive(_27);
159+
_27 = const 1_usize;
160+
- _6 = *const [()] from (copy _7, copy _27);
161+
+ _6 = *const [()] from (copy _5, const 1_usize);
162+
StorageDead(_27);
163+
StorageDead(_7);
138164
StorageLive(_8);
139-
_8 = copy _5;
140-
- _7 = copy _8 as *mut () (PtrToPtr);
141-
+ _7 = copy ((_9.0: std::ptr::Unique<()>).0: std::ptr::NonNull<()>) as *mut () (Transmute);
165+
StorageLive(_9);
166+
_9 = copy _6;
167+
StorageLive(_28);
168+
- _28 = copy _9;
169+
- _8 = copy _9 as *mut () (PtrToPtr);
170+
+ _28 = copy _6;
171+
+ _8 = copy _5 as *mut () (PtrToPtr);
172+
StorageDead(_28);
173+
StorageDead(_9);
174+
_0 = const ();
142175
StorageDead(_8);
143-
StorageDead(_7);
176+
StorageDead(_6);
144177
StorageDead(_5);
145-
StorageDead(_4);
146178
drop(_3) -> [return: bb1, unwind unreachable];
147179
}
148180

149181
bb5: {
150-
- _20 = Layout::from_size_align_unchecked::precondition_check(copy _11, copy _12) -> [return: bb6, unwind unreachable];
151-
+ _20 = Layout::from_size_align_unchecked::precondition_check(const 0_usize, const 1_usize) -> [return: bb6, unwind unreachable];
182+
- _24 = Layout::from_size_align_unchecked::precondition_check(copy _16, copy _17) -> [return: bb6, unwind unreachable];
183+
+ _24 = Layout::from_size_align_unchecked::precondition_check(const 0_usize, const 1_usize) -> [return: bb6, unwind unreachable];
152184
}
153185

154186
bb6: {
155-
StorageDead(_19);
156-
StorageLive(_21);
157-
- _21 = copy _12 as std::ptr::Alignment (Transmute);
158-
- _14 = Layout { size: copy _11, align: move _21 };
159-
+ _21 = const std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0);
160-
+ _14 = const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }};
161-
StorageDead(_21);
162-
StorageLive(_15);
163-
- _15 = std::alloc::Global::alloc_impl(const alloc::alloc::exchange_malloc::promoted[0], copy _14, const false) -> [return: bb7, unwind unreachable];
164-
+ _15 = std::alloc::Global::alloc_impl(const alloc::alloc::exchange_malloc::promoted[0], const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }}, const false) -> [return: bb7, unwind unreachable];
187+
StorageDead(_23);
188+
StorageLive(_25);
189+
- _25 = copy _17 as std::ptr::Alignment (Transmute);
190+
- _18 = Layout { size: copy _16, align: move _25 };
191+
+ _25 = const std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0);
192+
+ _18 = const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }};
193+
StorageDead(_25);
194+
StorageLive(_19);
195+
- _19 = std::alloc::Global::alloc_impl(const alloc::alloc::exchange_malloc::promoted[0], copy _18, const false) -> [return: bb7, unwind unreachable];
196+
+ _19 = std::alloc::Global::alloc_impl(const alloc::alloc::exchange_malloc::promoted[0], const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }}, const false) -> [return: bb7, unwind unreachable];
165197
}
166198

167199
bb7: {
168-
_16 = discriminant(_15);
169-
switchInt(move _16) -> [0: bb4, 1: bb3, otherwise: bb2];
200+
_20 = discriminant(_19);
201+
switchInt(move _20) -> [0: bb4, 1: bb3, otherwise: bb2];
170202
}
171203
+ }
172204
+

0 commit comments

Comments
 (0)