diff options
| author | Ben Kimock <kimockb@gmail.com> | 2023-06-06 09:47:00 -0400 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2023-06-15 15:19:11 -0400 |
| commit | 0a1fa411edbf6f9ad1205655d77cfda5a43aac06 (patch) | |
| tree | 35f05b194635642648301bb16e271ce4ae6860a2 /tests/mir-opt/issues | |
| parent | 331249a94930adb3d2a7243d946733b63324b2d6 (diff) | |
| download | rust-0a1fa411edbf6f9ad1205655d77cfda5a43aac06.tar.gz rust-0a1fa411edbf6f9ad1205655d77cfda5a43aac06.zip | |
Remove comments from mir-opt MIR dumps
Diffstat (limited to 'tests/mir-opt/issues')
3 files changed, 108 insertions, 132 deletions
diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir index a25d8e27330..787f9ee095f 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir @@ -1,84 +1,72 @@ // MIR for `num_to_digit` after PreCodegen fn num_to_digit(_1: char) -> u32 { - debug num => _1; // in scope 0 at $DIR/issue_59352.rs:+0:21: +0:24 - let mut _0: u32; // return place in scope 0 at $DIR/issue_59352.rs:+0:35: +0:38 - let mut _5: std::option::Option<u32>; // in scope 0 at $DIR/issue_59352.rs:+2:26: +2:41 - scope 1 (inlined char::methods::<impl char>::is_digit) { // at $DIR/issue_59352.rs:15:12: 15:23 - debug self => _1; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - debug radix => const 8_u32; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - let _2: std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - let mut _3: &std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - scope 2 (inlined Option::<u32>::is_some) { // at $SRC_DIR/core/src/char/methods.rs:LL:COL - debug self => _3; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _4: isize; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL + debug num => _1; + let mut _0: u32; + let mut _5: std::option::Option<u32>; + scope 1 (inlined char::methods::<impl char>::is_digit) { + debug self => _1; + debug radix => const 8_u32; + let _2: std::option::Option<u32>; + let mut _3: &std::option::Option<u32>; + scope 2 (inlined Option::<u32>::is_some) { + debug self => _3; + let mut _4: isize; } } - scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { // at $DIR/issue_59352.rs:15:42: 15:50 - debug self => _5; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _6: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _7: !; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { + debug self => _5; + let mut _6: isize; + let mut _7: !; scope 4 { - debug val => _0; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + debug val => _0; } } bb0: { - StorageLive(_3); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageLive(_2); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - _2 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> [return: bb1, unwind unreachable]; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - // mir::Constant - // + span: $SRC_DIR/core/src/char/methods.rs:LL:COL - // + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(<ZST>) } + StorageLive(_3); + StorageLive(_2); + _2 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> [return: bb1, unwind unreachable]; } bb1: { - _3 = &_2; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - _4 = discriminant((*_3)); // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL - StorageDead(_3); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_2); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - switchInt(move _4) -> [1: bb2, otherwise: bb7]; // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23 + _3 = &_2; + _4 = discriminant((*_3)); + StorageDead(_3); + StorageDead(_2); + switchInt(move _4) -> [1: bb2, otherwise: bb7]; } bb2: { - StorageLive(_5); // scope 0 at $DIR/issue_59352.rs:+2:26: +2:41 - _5 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/issue_59352.rs:+2:26: +2:41 - // mir::Constant - // + span: $DIR/issue_59352.rs:15:30: 15:38 - // + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(<ZST>) } + StorageLive(_5); + _5 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> [return: bb3, unwind unreachable]; } bb3: { - _6 = discriminant(_5); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb6]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + _6 = discriminant(_5); + switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb6]; } bb4: { - _7 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value") -> unwind unreachable; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - // mir::Constant - // + span: $SRC_DIR/core/src/option.rs:LL:COL - // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(<ZST>) } - // mir::Constant - // + span: $SRC_DIR/core/src/option.rs:LL:COL - // + literal: Const { ty: &str, val: Value(Slice(..)) } + _7 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value") -> unwind unreachable; } bb5: { - _0 = move ((_5 as Some).0: u32); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - StorageDead(_5); // scope 0 at $DIR/issue_59352.rs:+2:49: +2:50 - goto -> bb8; // scope 0 at $DIR/issue_59352.rs:+2:5: +2:63 + _0 = move ((_5 as Some).0: u32); + StorageDead(_5); + goto -> bb8; } bb6: { - unreachable; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + unreachable; } bb7: { - _0 = const 0_u32; // scope 0 at $DIR/issue_59352.rs:+2:60: +2:61 - goto -> bb8; // scope 0 at $DIR/issue_59352.rs:+2:5: +2:63 + _0 = const 0_u32; + goto -> bb8; } bb8: { - return; // scope 0 at $DIR/issue_59352.rs:+3:2: +3:2 + return; } } diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir index fac4b8a2d25..e7c1be7e6e6 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir @@ -1,84 +1,72 @@ // MIR for `num_to_digit` after PreCodegen fn num_to_digit(_1: char) -> u32 { - debug num => _1; // in scope 0 at $DIR/issue_59352.rs:+0:21: +0:24 - let mut _0: u32; // return place in scope 0 at $DIR/issue_59352.rs:+0:35: +0:38 - let mut _5: std::option::Option<u32>; // in scope 0 at $DIR/issue_59352.rs:+2:26: +2:41 - scope 1 (inlined char::methods::<impl char>::is_digit) { // at $DIR/issue_59352.rs:15:12: 15:23 - debug self => _1; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - debug radix => const 8_u32; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - let _2: std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - let mut _3: &std::option::Option<u32>; // in scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - scope 2 (inlined Option::<u32>::is_some) { // at $SRC_DIR/core/src/char/methods.rs:LL:COL - debug self => _3; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _4: isize; // in scope 2 at $SRC_DIR/core/src/option.rs:LL:COL + debug num => _1; + let mut _0: u32; + let mut _5: std::option::Option<u32>; + scope 1 (inlined char::methods::<impl char>::is_digit) { + debug self => _1; + debug radix => const 8_u32; + let _2: std::option::Option<u32>; + let mut _3: &std::option::Option<u32>; + scope 2 (inlined Option::<u32>::is_some) { + debug self => _3; + let mut _4: isize; } } - scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { // at $DIR/issue_59352.rs:15:42: 15:50 - debug self => _5; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _6: isize; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - let mut _7: !; // in scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + scope 3 (inlined #[track_caller] Option::<u32>::unwrap) { + debug self => _5; + let mut _6: isize; + let mut _7: !; scope 4 { - debug val => _0; // in scope 4 at $SRC_DIR/core/src/option.rs:LL:COL + debug val => _0; } } bb0: { - StorageLive(_3); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageLive(_2); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - _2 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> bb1; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - // mir::Constant - // + span: $SRC_DIR/core/src/char/methods.rs:LL:COL - // + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(<ZST>) } + StorageLive(_3); + StorageLive(_2); + _2 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> bb1; } bb1: { - _3 = &_2; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - _4 = discriminant((*_3)); // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL - StorageDead(_3); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - StorageDead(_2); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL - switchInt(move _4) -> [1: bb2, otherwise: bb7]; // scope 0 at $DIR/issue_59352.rs:+2:8: +2:23 + _3 = &_2; + _4 = discriminant((*_3)); + StorageDead(_3); + StorageDead(_2); + switchInt(move _4) -> [1: bb2, otherwise: bb7]; } bb2: { - StorageLive(_5); // scope 0 at $DIR/issue_59352.rs:+2:26: +2:41 - _5 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> bb3; // scope 0 at $DIR/issue_59352.rs:+2:26: +2:41 - // mir::Constant - // + span: $DIR/issue_59352.rs:15:30: 15:38 - // + literal: Const { ty: fn(char, u32) -> Option<u32> {char::methods::<impl char>::to_digit}, val: Value(<ZST>) } + StorageLive(_5); + _5 = char::methods::<impl char>::to_digit(_1, const 8_u32) -> bb3; } bb3: { - _6 = discriminant(_5); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb6]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + _6 = discriminant(_5); + switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb6]; } bb4: { - _7 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value"); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - // mir::Constant - // + span: $SRC_DIR/core/src/option.rs:LL:COL - // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(<ZST>) } - // mir::Constant - // + span: $SRC_DIR/core/src/option.rs:LL:COL - // + literal: Const { ty: &str, val: Value(Slice(..)) } + _7 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value"); } bb5: { - _0 = move ((_5 as Some).0: u32); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL - StorageDead(_5); // scope 0 at $DIR/issue_59352.rs:+2:49: +2:50 - goto -> bb8; // scope 0 at $DIR/issue_59352.rs:+2:5: +2:63 + _0 = move ((_5 as Some).0: u32); + StorageDead(_5); + goto -> bb8; } bb6: { - unreachable; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL + unreachable; } bb7: { - _0 = const 0_u32; // scope 0 at $DIR/issue_59352.rs:+2:60: +2:61 - goto -> bb8; // scope 0 at $DIR/issue_59352.rs:+2:5: +2:63 + _0 = const 0_u32; + goto -> bb8; } bb8: { - return; // scope 0 at $DIR/issue_59352.rs:+3:2: +3:2 + return; } } diff --git a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff index 8e6e6fc0ec2..f1d18b0f7ff 100644 --- a/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff +++ b/tests/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff @@ -2,17 +2,17 @@ + // MIR for `foo` after MatchBranchSimplification fn foo(_1: [u8; 16]) -> Option<[u8; 4]> { - debug bytes => _1; // in scope 0 at $DIR/issue_75439.rs:+0:12: +0:17 - let mut _0: std::option::Option<[u8; 4]>; // return place in scope 0 at $DIR/issue_75439.rs:+0:32: +0:47 - let _2: [u32; 4]; // in scope 0 at $DIR/issue_75439.rs:+2:9: +2:15 - let mut _3: [u8; 16]; // in scope 0 at $DIR/issue_75439.rs:+2:47: +2:52 - let mut _5: [u8; 4]; // in scope 0 at $DIR/issue_75439.rs:+5:14: +5:38 - let mut _6: u32; // in scope 0 at $DIR/issue_75439.rs:+5:33: +5:35 + debug bytes => _1; + let mut _0: std::option::Option<[u8; 4]>; + let _2: [u32; 4]; + let mut _3: [u8; 16]; + let mut _5: [u8; 4]; + let mut _6: u32; scope 1 { - debug dwords => _2; // in scope 1 at $DIR/issue_75439.rs:+2:9: +2:15 + debug dwords => _2; scope 3 { - debug ip => _4; // in scope 3 at $DIR/issue_75439.rs:+4:27: +4:29 - let _4: u32; // in scope 3 at $DIR/issue_75439.rs:+4:27: +4:29 + debug ip => _4; + let _4: u32; scope 4 { } } @@ -21,54 +21,54 @@ } bb0: { - StorageLive(_2); // scope 0 at $DIR/issue_75439.rs:+2:9: +2:15 - StorageLive(_3); // scope 2 at $DIR/issue_75439.rs:+2:47: +2:52 - _3 = _1; // scope 2 at $DIR/issue_75439.rs:+2:47: +2:52 - _2 = move _3 as [u32; 4] (Transmute); // scope 2 at $DIR/issue_75439.rs:+2:37: +2:53 - StorageDead(_3); // scope 2 at $DIR/issue_75439.rs:+2:52: +2:53 - switchInt(_2[0 of 4]) -> [0: bb1, otherwise: bb6]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 + StorageLive(_2); + StorageLive(_3); + _3 = _1; + _2 = move _3 as [u32; 4] (Transmute); + StorageDead(_3); + switchInt(_2[0 of 4]) -> [0: bb1, otherwise: bb6]; } bb1: { - switchInt(_2[1 of 4]) -> [0: bb2, otherwise: bb6]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 + switchInt(_2[1 of 4]) -> [0: bb2, otherwise: bb6]; } bb2: { - switchInt(_2[2 of 4]) -> [0: bb4, 4294901760: bb5, otherwise: bb6]; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 + switchInt(_2[2 of 4]) -> [0: bb4, 4294901760: bb5, otherwise: bb6]; } bb3: { - StorageLive(_5); // scope 3 at $DIR/issue_75439.rs:+5:14: +5:38 - StorageLive(_6); // scope 4 at $DIR/issue_75439.rs:+5:33: +5:35 - _6 = _4; // scope 4 at $DIR/issue_75439.rs:+5:33: +5:35 - _5 = move _6 as [u8; 4] (Transmute); // scope 4 at $DIR/issue_75439.rs:+5:23: +5:36 - StorageDead(_6); // scope 4 at $DIR/issue_75439.rs:+5:35: +5:36 - _0 = Option::<[u8; 4]>::Some(move _5); // scope 3 at $DIR/issue_75439.rs:+5:9: +5:39 - StorageDead(_5); // scope 3 at $DIR/issue_75439.rs:+5:38: +5:39 - StorageDead(_4); // scope 1 at $DIR/issue_75439.rs:+6:5: +6:6 - goto -> bb7; // scope 1 at $DIR/issue_75439.rs:+4:5: +8:6 + StorageLive(_5); + StorageLive(_6); + _6 = _4; + _5 = move _6 as [u8; 4] (Transmute); + StorageDead(_6); + _0 = Option::<[u8; 4]>::Some(move _5); + StorageDead(_5); + StorageDead(_4); + goto -> bb7; } bb4: { - StorageLive(_4); // scope 3 at $DIR/issue_75439.rs:+4:27: +4:29 - _4 = _2[3 of 4]; // scope 3 at $DIR/issue_75439.rs:+4:27: +4:29 - goto -> bb3; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 + StorageLive(_4); + _4 = _2[3 of 4]; + goto -> bb3; } bb5: { - StorageLive(_4); // scope 3 at $DIR/issue_75439.rs:+4:27: +4:29 - _4 = _2[3 of 4]; // scope 3 at $DIR/issue_75439.rs:+4:27: +4:29 - goto -> bb3; // scope 3 at $DIR/issue_75439.rs:+4:12: +4:30 + StorageLive(_4); + _4 = _2[3 of 4]; + goto -> bb3; } bb6: { - _0 = Option::<[u8; 4]>::None; // scope 1 at $DIR/issue_75439.rs:+7:9: +7:13 - goto -> bb7; // scope 1 at $DIR/issue_75439.rs:+4:5: +8:6 + _0 = Option::<[u8; 4]>::None; + goto -> bb7; } bb7: { - StorageDead(_2); // scope 0 at $DIR/issue_75439.rs:+9:1: +9:2 - return; // scope 0 at $DIR/issue_75439.rs:+9:2: +9:2 + StorageDead(_2); + return; } } |
