rust/tests/mir-opt/const_prop/boxes.main.GVN.panic-abort.diff

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.5 KiB
Diff
Raw Normal View History

2023-09-20 21:43:33 +00:00
- // MIR for `main` before GVN
+ // MIR for `main` after GVN
2020-04-04 17:15:01 +00:00
fn main() -> () {
2023-06-06 13:47:00 +00:00
let mut _0: ();
let _1: i32;
let mut _2: i32;
let mut _3: std::boxed::Box<i32>;
let mut _4: usize;
let mut _5: usize;
let mut _6: *mut u8;
let mut _7: std::boxed::Box<i32>;
let mut _8: *const i32;
let mut _9: *const i32;
2020-04-04 17:15:01 +00:00
scope 1 {
2023-06-06 13:47:00 +00:00
debug x => _1;
2020-04-04 17:15:01 +00:00
}
bb0: {
2023-06-06 13:47:00 +00:00
StorageLive(_1);
2023-03-20 21:37:36 +00:00
- StorageLive(_2);
+ nop;
2023-06-06 13:47:00 +00:00
StorageLive(_3);
- _4 = SizeOf(i32);
- _5 = AlignOf(i32);
2023-02-07 19:24:21 +00:00
- _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> [return: bb1, unwind unreachable];
2023-06-06 13:47:00 +00:00
+ _4 = const 4_usize;
+ _5 = const 4_usize;
2023-02-07 19:24:21 +00:00
+ _6 = alloc::alloc::exchange_malloc(const 4_usize, const 4_usize) -> [return: bb1, unwind unreachable];
2021-09-16 22:04:02 +00:00
}
bb1: {
2023-06-06 13:47:00 +00:00
StorageLive(_7);
_7 = ShallowInitBox(move _6, i32);
_8 = (((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32);
(*_8) = const 42_i32;
_3 = move _7;
StorageDead(_7);
_9 = (((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32);
_2 = (*_9);
2023-03-20 21:37:36 +00:00
- _1 = Add(move _2, const 0_i32);
- StorageDead(_2);
+ _1 = _2;
+ nop;
2023-06-06 13:47:00 +00:00
drop(_3) -> [return: bb2, unwind unreachable];
2020-04-04 17:15:01 +00:00
}
2021-09-16 22:04:02 +00:00
bb2: {
2023-06-06 13:47:00 +00:00
StorageDead(_3);
_0 = const ();
StorageDead(_1);
return;
2020-04-04 17:15:01 +00:00
}
}