Skip to content

Commit

Permalink
Update tests mention the enum name
Browse files Browse the repository at this point in the history
  • Loading branch information
mu001999 authored Feb 29, 2024
1 parent 61fcdf6 commit 0d3954a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- // MIR for `main` before GVN
+ // MIR for `main` after GVN

fn main() -> () {
let mut _0: ();
let _1: std::alloc::Layout;
Expand Down Expand Up @@ -49,7 +49,7 @@
debug val => _1;
}
}

bb0: {
- StorageLive(_1);
+ nop;
Expand All @@ -62,14 +62,14 @@
+ _10 = const 0_isize;
+ switchInt(const 0_isize) -> [0: bb1, 1: bb2, otherwise: bb6];
}

bb1: {
_11 = option::unwrap_failed() -> unwind unreachable;
}

bb2: {
- _1 = move ((_2 as Some).0: std::alloc::Layout);
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }};
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }};
StorageDead(_10);
StorageDead(_2);
StorageLive(_3);
Expand All @@ -83,10 +83,10 @@
StorageLive(_8);
- _8 = _1;
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb3, unwind unreachable];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb3, unwind unreachable];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb3, unwind unreachable];
}

bb3: {
StorageDead(_8);
StorageDead(_7);
Expand All @@ -95,7 +95,7 @@
_12 = discriminant(_6);
switchInt(move _12) -> [0: bb5, 1: bb4, otherwise: bb6];
}

bb4: {
_15 = const "called `Result::unwrap()` on an `Err` value";
StorageLive(_16);
Expand All @@ -105,7 +105,7 @@
StorageDead(_17);
_14 = result::unwrap_failed(move _15, move _16) -> unwind unreachable;
}

bb5: {
_5 = move ((_6 as Ok).0: std::ptr::NonNull<[u8]>);
StorageDead(_15);
Expand All @@ -127,15 +127,14 @@
+ nop;
return;
}

bb6: {
unreachable;
}
}
+
+
+ ALLOC0 (size: 8, align: 4) {
+ 00 00 00 00 __ __ __ __ │ ....░░░░
+ }
+
+
+ ALLOC1 (size: 0, align: 1) {}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- // MIR for `main` before GVN
+ // MIR for `main` after GVN

fn main() -> () {
let mut _0: ();
let _1: std::alloc::Layout;
Expand Down Expand Up @@ -34,7 +34,7 @@
debug val => _1;
}
}

bb0: {
- StorageLive(_1);
+ nop;
Expand All @@ -47,7 +47,7 @@
+ _10 = const 0_isize;
+ switchInt(const 0_isize) -> [0: bb2, 1: bb3, otherwise: bb5];
}

bb1: {
StorageDead(_6);
- StorageLive(_12);
Expand All @@ -66,14 +66,14 @@
+ nop;
return;
}

bb2: {
_11 = option::unwrap_failed() -> unwind continue;
}

bb3: {
- _1 = move ((_2 as Some).0: std::alloc::Layout);
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }};
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }};
StorageDead(_10);
StorageDead(_2);
StorageLive(_3);
Expand All @@ -87,24 +87,23 @@
StorageLive(_8);
- _8 = _1;
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind continue];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb4, unwind continue];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind continue];
}

bb4: {
StorageDead(_8);
StorageDead(_7);
_5 = Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue];
}

bb5: {
unreachable;
}
}
+
+
+ ALLOC0 (size: 8, align: 4) {
+ 00 00 00 00 __ __ __ __ │ ....░░░░
+ }
+
+
+ ALLOC1 (size: 0, align: 1) {}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- // MIR for `main` before GVN
+ // MIR for `main` after GVN

fn main() -> () {
let mut _0: ();
let _1: std::alloc::Layout;
Expand Down Expand Up @@ -49,7 +49,7 @@
debug val => _1;
}
}

bb0: {
- StorageLive(_1);
+ nop;
Expand All @@ -62,14 +62,14 @@
+ _10 = const 0_isize;
+ switchInt(const 0_isize) -> [0: bb1, 1: bb2, otherwise: bb6];
}

bb1: {
_11 = option::unwrap_failed() -> unwind unreachable;
}

bb2: {
- _1 = move ((_2 as Some).0: std::alloc::Layout);
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }};
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
StorageDead(_10);
StorageDead(_2);
StorageLive(_3);
Expand All @@ -83,10 +83,10 @@
StorageLive(_8);
- _8 = _1;
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb3, unwind unreachable];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }}, const false) -> [return: bb3, unwind unreachable];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, 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: bb3, unwind unreachable];
}

bb3: {
StorageDead(_8);
StorageDead(_7);
Expand All @@ -95,7 +95,7 @@
_12 = discriminant(_6);
switchInt(move _12) -> [0: bb5, 1: bb4, otherwise: bb6];
}

bb4: {
_15 = const "called `Result::unwrap()` on an `Err` value";
StorageLive(_16);
Expand All @@ -105,7 +105,7 @@
StorageDead(_17);
_14 = result::unwrap_failed(move _15, move _16) -> unwind unreachable;
}

bb5: {
_5 = move ((_6 as Ok).0: std::ptr::NonNull<[u8]>);
StorageDead(_15);
Expand All @@ -127,15 +127,14 @@
+ nop;
return;
}

bb6: {
unreachable;
}
}
+
+
+ ALLOC0 (size: 16, align: 8) {
+ 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
+ }
+
+
+ ALLOC1 (size: 0, align: 1) {}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- // MIR for `main` before GVN
+ // MIR for `main` after GVN

fn main() -> () {
let mut _0: ();
let _1: std::alloc::Layout;
Expand Down Expand Up @@ -34,7 +34,7 @@
debug val => _1;
}
}

bb0: {
- StorageLive(_1);
+ nop;
Expand All @@ -47,7 +47,7 @@
+ _10 = const 0_isize;
+ switchInt(const 0_isize) -> [0: bb2, 1: bb3, otherwise: bb5];
}

bb1: {
StorageDead(_6);
- StorageLive(_12);
Expand All @@ -66,14 +66,14 @@
+ nop;
return;
}

bb2: {
_11 = option::unwrap_failed() -> unwind continue;
}

bb3: {
- _1 = move ((_2 as Some).0: std::alloc::Layout);
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }};
+ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
StorageDead(_10);
StorageDead(_2);
StorageLive(_3);
Expand All @@ -87,24 +87,23 @@
StorageLive(_8);
- _8 = _1;
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind continue];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }}, const false) -> [return: bb4, unwind continue];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, 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 continue];
}

bb4: {
StorageDead(_8);
StorageDead(_7);
_5 = Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue];
}

bb5: {
unreachable;
}
}
+
+
+ ALLOC0 (size: 16, align: 8) {
+ 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
+ }
+
+
+ ALLOC1 (size: 0, align: 1) {}

0 comments on commit 0d3954a

Please sign in to comment.