2023-10-31 12:34:06 -05:00
|
|
|
- // MIR for `main` before GVN
|
|
|
|
+ // MIR for `main` after GVN
|
|
|
|
|
|
|
|
fn main() -> () {
|
|
|
|
let mut _0: ();
|
|
|
|
let _1: std::alloc::Layout;
|
|
|
|
let mut _2: std::option::Option<std::alloc::Layout>;
|
|
|
|
let mut _3: *mut u8;
|
|
|
|
let mut _4: *mut [u8];
|
|
|
|
let mut _5: std::ptr::NonNull<[u8]>;
|
|
|
|
let mut _6: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>;
|
|
|
|
let mut _7: &std::alloc::Global;
|
|
|
|
let mut _8: std::alloc::Layout;
|
|
|
|
scope 1 {
|
|
|
|
debug layout => _1;
|
|
|
|
let mut _9: &std::alloc::Global;
|
|
|
|
scope 2 {
|
|
|
|
debug ptr => _3;
|
|
|
|
}
|
|
|
|
scope 5 (inlined <std::alloc::Global as Allocator>::allocate) {
|
|
|
|
}
|
|
|
|
scope 6 (inlined #[track_caller] Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap) {
|
|
|
|
let mut _12: isize;
|
|
|
|
let _13: std::alloc::AllocError;
|
|
|
|
let mut _14: !;
|
2024-06-02 21:41:00 -05:00
|
|
|
let mut _15: &dyn std::fmt::Debug;
|
2024-07-27 01:36:17 -05:00
|
|
|
let _16: &std::alloc::AllocError;
|
2023-10-31 12:34:06 -05:00
|
|
|
scope 7 {
|
|
|
|
}
|
|
|
|
scope 8 {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scope 9 (inlined NonNull::<[u8]>::as_ptr) {
|
2024-06-02 21:41:00 -05:00
|
|
|
let mut _17: *const [u8];
|
2023-10-31 12:34:06 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
scope 3 (inlined #[track_caller] Option::<Layout>::unwrap) {
|
|
|
|
let mut _10: isize;
|
|
|
|
let mut _11: !;
|
|
|
|
scope 4 {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2024-01-06 12:34:25 -06:00
|
|
|
- StorageLive(_1);
|
|
|
|
+ nop;
|
2023-10-31 12:34:06 -05:00
|
|
|
StorageLive(_2);
|
|
|
|
- _2 = Option::<Layout>::None;
|
|
|
|
+ _2 = const Option::<Layout>::None;
|
|
|
|
StorageLive(_10);
|
2023-05-21 05:33:03 -05:00
|
|
|
- _10 = discriminant(_2);
|
2024-02-28 08:35:41 -06:00
|
|
|
- switchInt(move _10) -> [0: bb2, 1: bb3, otherwise: bb1];
|
2023-05-21 05:33:03 -05:00
|
|
|
+ _10 = const 0_isize;
|
2024-02-28 08:35:41 -06:00
|
|
|
+ switchInt(const 0_isize) -> [0: bb2, 1: bb3, otherwise: bb1];
|
2023-10-31 12:34:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2024-02-28 08:35:41 -06:00
|
|
|
unreachable;
|
2023-10-31 12:34:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2024-02-28 08:35:41 -06:00
|
|
|
_11 = option::unwrap_failed() -> unwind unreachable;
|
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2023-10-31 12:34:06 -05:00
|
|
|
- _1 = move ((_2 as Some).0: std::alloc::Layout);
|
2024-02-28 20:55:05 -06:00
|
|
|
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
|
2023-10-31 12:34:06 -05:00
|
|
|
StorageDead(_10);
|
|
|
|
StorageDead(_2);
|
|
|
|
StorageLive(_3);
|
|
|
|
StorageLive(_4);
|
|
|
|
StorageLive(_5);
|
|
|
|
StorageLive(_6);
|
2024-01-06 12:34:25 -06:00
|
|
|
StorageLive(_7);
|
2024-03-10 08:05:11 -05:00
|
|
|
_9 = const main::promoted[0];
|
2024-06-26 04:44:55 -05:00
|
|
|
_7 = copy _9;
|
2024-01-06 12:34:25 -06:00
|
|
|
StorageLive(_8);
|
|
|
|
- _8 = copy _1;
|
2024-02-28 08:35:41 -06:00
|
|
|
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind unreachable];
|
2024-02-28 20:55:05 -06:00
|
|
|
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
|
2024-06-26 04:44:55 -05:00
|
|
|
+ _6 = std::alloc::Global::alloc_impl(copy _9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable];
|
2023-10-31 12:34:06 -05:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb4: {
|
2024-01-06 12:34:25 -06:00
|
|
|
StorageDead(_8);
|
|
|
|
StorageDead(_7);
|
2023-10-31 12:34:06 -05:00
|
|
|
StorageLive(_12);
|
2024-07-27 01:36:17 -05:00
|
|
|
StorageLive(_16);
|
2023-10-31 12:34:06 -05:00
|
|
|
_12 = discriminant(_6);
|
2024-02-28 08:35:41 -06:00
|
|
|
switchInt(move _12) -> [0: bb6, 1: bb5, otherwise: bb1];
|
2023-10-31 12:34:06 -05:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb5: {
|
2024-06-02 21:41:00 -05:00
|
|
|
StorageLive(_15);
|
|
|
|
_16 = &_13;
|
2024-07-27 01:36:17 -05:00
|
|
|
_15 = copy _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize));
|
2024-06-02 21:41:00 -05:00
|
|
|
_14 = result::unwrap_failed(const "called `Result::unwrap()` on an `Err` value", move _15) -> unwind unreachable;
|
2023-10-31 12:34:06 -05:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb6: {
|
2023-10-31 12:34:06 -05:00
|
|
|
_5 = move ((_6 as Ok).0: std::ptr::NonNull<[u8]>);
|
2024-07-27 01:36:17 -05:00
|
|
|
StorageDead(_16);
|
2023-10-31 12:34:06 -05:00
|
|
|
StorageDead(_12);
|
|
|
|
StorageDead(_6);
|
2024-06-02 21:41:00 -05:00
|
|
|
- StorageLive(_17);
|
2023-10-11 14:39:18 -05:00
|
|
|
+ nop;
|
2024-06-02 21:41:00 -05:00
|
|
|
_17 = copy (_5.0: *const [u8]);
|
|
|
|
- _4 = move _17 as *mut [u8] (PtrToPtr);
|
|
|
|
- StorageDead(_17);
|
|
|
|
+ _4 = copy _17 as *mut [u8] (PtrToPtr);
|
2023-10-11 14:39:18 -05:00
|
|
|
+ nop;
|
2023-10-31 12:34:06 -05:00
|
|
|
StorageDead(_5);
|
2023-10-11 14:39:18 -05:00
|
|
|
- _3 = move _4 as *mut u8 (PtrToPtr);
|
2024-06-02 21:41:00 -05:00
|
|
|
+ _3 = copy _17 as *mut u8 (PtrToPtr);
|
2023-10-31 12:34:06 -05:00
|
|
|
StorageDead(_4);
|
|
|
|
StorageDead(_3);
|
2024-01-06 12:34:25 -06:00
|
|
|
- StorageDead(_1);
|
|
|
|
+ nop;
|
2023-10-31 12:34:06 -05:00
|
|
|
return;
|
|
|
|
}
|
2024-06-26 04:44:55 -05:00
|
|
|
+ }
|
2023-10-31 12:34:06 -05:00
|
|
|
+
|
|
|
|
+ ALLOC0 (size: 16, align: 8) {
|
|
|
|
+ 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
|
2024-06-26 04:44:55 -05:00
|
|
|
}
|
2023-10-31 12:34:06 -05:00
|
|
|
|