Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mir-opt] Fix mis-optimization and other issues with the SimplifyArmIdentity pass #73949

Merged
merged 4 commits into from
Jul 4, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/test/mir-opt/issue-73223.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fn main() {
let split = match Some(1) {
Some(v) => v,
None => return,
};

let _prev = Some(split);
assert_eq!(split, 1);
}

// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR rustc.main.SimplifyArmIdentity.diff
// EMIT_MIR rustc.main.PreCodegen.diff
249 changes: 249 additions & 0 deletions src/test/mir-opt/issue-73223/32bit/rustc.main.PreCodegen.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
- // MIR for `main` before PreCodegen
+ // MIR for `main` after PreCodegen

fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/issue-73223.rs:1:11: 1:11
let _1: i32; // in scope 0 at $DIR/issue-73223.rs:2:9: 2:14
let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue-73223.rs:2:23: 2:30
let _3: i32; // in scope 0 at $DIR/issue-73223.rs:3:14: 3:15
let mut _5: (&i32, &i32); // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _6: &i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _9: bool; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _10: bool; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _11: i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _12: i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _13: &std::fmt::Arguments; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let _14: std::fmt::Arguments; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _15: &[&str]; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _16: &[std::fmt::ArgumentV1]; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let _17: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let _18: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _19: (&&i32, &&i32); // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _20: &&i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _21: &i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _22: &&i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _23: &i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _26: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _27: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _28: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _29: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
scope 1 {
debug split => _1; // in scope 1 at $DIR/issue-73223.rs:2:9: 2:14
let _4: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:7:9: 7:14
scope 3 {
debug _prev => _4; // in scope 3 at $DIR/issue-73223.rs:7:9: 7:14
let _7: &i32; // in scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _8: &i32; // in scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
scope 4 {
debug left_val => _7; // in scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
debug right_val => _8; // in scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _24: &&i32; // in scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _25: &&i32; // in scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
scope 5 {
debug arg0 => _24; // in scope 5 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
debug arg1 => _25; // in scope 5 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
scope 6 {
debug x => _24; // in scope 6 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
debug f => _27; // in scope 6 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
let mut _30: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _31: &core::fmt::Opaque; // in scope 6 at $SRC_DIR/libstd/macros.rs:LL:COL
}
scope 8 {
debug x => _25; // in scope 8 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
debug f => _29; // in scope 8 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
let mut _32: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _33: &core::fmt::Opaque; // in scope 8 at $SRC_DIR/libstd/macros.rs:LL:COL
}
}
scope 10 {
debug pieces => _15; // in scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
debug args => _16; // in scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
let mut _34: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/libstd/macros.rs:LL:COL
}
}
}
}
scope 2 {
debug v => _3; // in scope 2 at $DIR/issue-73223.rs:3:14: 3:15
}
scope 7 {
}
scope 9 {
}

bb0: {
StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:2:9: 2:14
StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/issue-73223.rs:2:28: 2:29
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
_4 = move _2; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28
StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7
StorageLive(_4); // scope 1 at $DIR/issue-73223.rs:7:9: 7:14
StorageLive(_5); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_6); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_6 = &_1; // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
(_5.0: &i32) = move _6; // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
(_5.1: &i32) = const main::promoted[1]; // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
// ty::Const
// + ty: &i32
// + val: Unevaluated(DefId(0:3 ~ issue_73223[317d]::main[0]), [], Some(promoted[1]))
// mir::Constant
// + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
// + literal: Const { ty: &i32, val: Unevaluated(DefId(0:3 ~ issue_73223[317d]::main[0]), [], Some(promoted[1])) }
StorageDead(_6); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_7); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_7 = (_5.0: &i32); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_8); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_8 = (_5.1: &i32); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_9); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_10); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_11); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_11 = (*_7); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_12); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_12 = (*_8); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_10 = Eq(move _11, move _12); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_12); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_11); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_9 = Not(move _10); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_10); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
switchInt(_9) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
}

bb1: {
StorageDead(_9); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_8); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_7); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_5); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-73223.rs:1:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_4); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2
StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2
return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2
}

bb2: {
StorageLive(_14); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
_15 = const main::promoted[0] as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
// ty::Const
// + ty: &[&str; 3]
// + val: Unevaluated(DefId(0:3 ~ issue_73223[317d]::main[0]), [], Some(promoted[0]))
// mir::Constant
// + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
// + literal: Const { ty: &[&str; 3], val: Unevaluated(DefId(0:3 ~ issue_73223[317d]::main[0]), [], Some(promoted[0])) }
StorageLive(_18); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageLive(_19); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageLive(_20); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_21); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_21 = _7; // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_20 = &_21; // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_22); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_23); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_23 = _8; // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_22 = &_23; // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
(_19.0: &&i32) = move _20; // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
(_19.1: &&i32) = move _22; // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageDead(_22); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageDead(_20); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
_24 = (_19.0: &&i32); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_25 = (_19.1: &&i32); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_26); // scope 5 at $SRC_DIR/libstd/macros.rs:LL:COL
_27 = const <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
// ty::Const
// + ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_30); // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_30 = const std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _27) -> bb3; // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// ty::Const
// + ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
}

bb3: {
StorageLive(_31); // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_31 = const std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb4; // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// ty::Const
// + ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
}

bb4: {
(_26.0: &core::fmt::Opaque) = move _31; // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
(_26.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _30; // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageDead(_31); // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageDead(_30); // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageLive(_28); // scope 5 at $SRC_DIR/libstd/macros.rs:LL:COL
_29 = const <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
// ty::Const
// + ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_32); // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_32 = const std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _29) -> bb5; // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// ty::Const
// + ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
}

bb5: {
StorageLive(_33); // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_33 = const std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _25) -> bb6; // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// ty::Const
// + ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
}

bb6: {
(_28.0: &core::fmt::Opaque) = move _33; // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
(_28.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _32; // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageDead(_33); // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageDead(_32); // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_18 = [move _26, move _28]; // scope 5 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageDead(_28); // scope 5 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageDead(_26); // scope 5 at $SRC_DIR/libstd/macros.rs:LL:COL
_17 = &_18; // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
_16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageLive(_34); // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
discriminant(_34) = 0; // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
(_14.0: &[&str]) = move _15; // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
(_14.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _34; // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
(_14.2: &[std::fmt::ArgumentV1]) = move _16; // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageDead(_34); // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_13 = &_14; // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
const std::rt::begin_panic_fmt(move _13); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
// ty::Const
// + ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libstd/macros.rs:LL:COL
// + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) }
}
}

377 changes: 377 additions & 0 deletions src/test/mir-opt/issue-73223/32bit/rustc.main.SimplifyArmIdentity.diff

Large diffs are not rendered by default.

249 changes: 249 additions & 0 deletions src/test/mir-opt/issue-73223/64bit/rustc.main.PreCodegen.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
- // MIR for `main` before PreCodegen
+ // MIR for `main` after PreCodegen

fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/issue-73223.rs:1:11: 1:11
let _1: i32; // in scope 0 at $DIR/issue-73223.rs:2:9: 2:14
let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue-73223.rs:2:23: 2:30
let _3: i32; // in scope 0 at $DIR/issue-73223.rs:3:14: 3:15
let mut _5: (&i32, &i32); // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _6: &i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _9: bool; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _10: bool; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _11: i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _12: i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _13: &std::fmt::Arguments; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let _14: std::fmt::Arguments; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _15: &[&str]; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _16: &[std::fmt::ArgumentV1]; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let _17: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let _18: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _19: (&&i32, &&i32); // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _20: &&i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _21: &i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _22: &&i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _23: &i32; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _26: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _27: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let mut _28: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _29: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 0 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
scope 1 {
debug split => _1; // in scope 1 at $DIR/issue-73223.rs:2:9: 2:14
let _4: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:7:9: 7:14
scope 3 {
debug _prev => _4; // in scope 3 at $DIR/issue-73223.rs:7:9: 7:14
let _7: &i32; // in scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _8: &i32; // in scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
scope 4 {
debug left_val => _7; // in scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
debug right_val => _8; // in scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _24: &&i32; // in scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
let _25: &&i32; // in scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
scope 5 {
debug arg0 => _24; // in scope 5 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
debug arg1 => _25; // in scope 5 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
scope 6 {
debug x => _24; // in scope 6 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
debug f => _27; // in scope 6 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
let mut _30: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _31: &core::fmt::Opaque; // in scope 6 at $SRC_DIR/libstd/macros.rs:LL:COL
}
scope 8 {
debug x => _25; // in scope 8 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
debug f => _29; // in scope 8 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
let mut _32: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/libstd/macros.rs:LL:COL
let mut _33: &core::fmt::Opaque; // in scope 8 at $SRC_DIR/libstd/macros.rs:LL:COL
}
}
scope 10 {
debug pieces => _15; // in scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
debug args => _16; // in scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
let mut _34: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/libstd/macros.rs:LL:COL
}
}
}
}
scope 2 {
debug v => _3; // in scope 2 at $DIR/issue-73223.rs:3:14: 3:15
}
scope 7 {
}
scope 9 {
}

bb0: {
StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:2:9: 2:14
StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
// ty::Const
// + ty: i32
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/issue-73223.rs:2:28: 2:29
// + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
_4 = move _2; // scope 1 at $DIR/issue-73223.rs:7:17: 7:28
StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7
StorageLive(_4); // scope 1 at $DIR/issue-73223.rs:7:9: 7:14
StorageLive(_5); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_6); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_6 = &_1; // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
(_5.0: &i32) = move _6; // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
(_5.1: &i32) = const main::promoted[1]; // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
// ty::Const
// + ty: &i32
// + val: Unevaluated(DefId(0:3 ~ issue_73223[317d]::main[0]), [], Some(promoted[1]))
// mir::Constant
// + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
// + literal: Const { ty: &i32, val: Unevaluated(DefId(0:3 ~ issue_73223[317d]::main[0]), [], Some(promoted[1])) }
StorageDead(_6); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_7); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_7 = (_5.0: &i32); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_8); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_8 = (_5.1: &i32); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_9); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_10); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_11); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_11 = (*_7); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_12); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_12 = (*_8); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_10 = Eq(move _11, move _12); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_12); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_11); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_9 = Not(move _10); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_10); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
switchInt(_9) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
}

bb1: {
StorageDead(_9); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_8); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_7); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageDead(_5); // scope 3 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/issue-73223.rs:1:11: 9:2
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_4); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2
StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2
return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2
}

bb2: {
StorageLive(_14); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
_15 = const main::promoted[0] as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
// ty::Const
// + ty: &[&str; 3]
// + val: Unevaluated(DefId(0:3 ~ issue_73223[317d]::main[0]), [], Some(promoted[0]))
// mir::Constant
// + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
// + literal: Const { ty: &[&str; 3], val: Unevaluated(DefId(0:3 ~ issue_73223[317d]::main[0]), [], Some(promoted[0])) }
StorageLive(_18); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageLive(_19); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageLive(_20); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_21); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_21 = _7; // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_20 = &_21; // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_22); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_23); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_23 = _8; // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_22 = &_23; // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
(_19.0: &&i32) = move _20; // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
(_19.1: &&i32) = move _22; // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageDead(_22); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageDead(_20); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
_24 = (_19.0: &&i32); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
_25 = (_19.1: &&i32); // scope 4 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
StorageLive(_26); // scope 5 at $SRC_DIR/libstd/macros.rs:LL:COL
_27 = const <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
// ty::Const
// + ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_30); // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_30 = const std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _27) -> bb3; // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// ty::Const
// + ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
}

bb3: {
StorageLive(_31); // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_31 = const std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb4; // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// ty::Const
// + ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
}

bb4: {
(_26.0: &core::fmt::Opaque) = move _31; // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
(_26.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _30; // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageDead(_31); // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageDead(_30); // scope 7 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageLive(_28); // scope 5 at $SRC_DIR/libstd/macros.rs:LL:COL
_29 = const <&i32 as std::fmt::Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/libcore/macros/mod.rs:LL:COL
// ty::Const
// + ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar(<ZST>)) }
StorageLive(_32); // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_32 = const std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _29) -> bb5; // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// ty::Const
// + ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) }
}

bb5: {
StorageLive(_33); // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_33 = const std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>(move _25) -> bb6; // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// ty::Const
// + ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libcore/fmt/mod.rs:LL:COL
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar(<ZST>)) }
}

bb6: {
(_28.0: &core::fmt::Opaque) = move _33; // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
(_28.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _32; // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageDead(_33); // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageDead(_32); // scope 9 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_18 = [move _26, move _28]; // scope 5 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageDead(_28); // scope 5 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageDead(_26); // scope 5 at $SRC_DIR/libstd/macros.rs:LL:COL
_17 = &_18; // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
_16 = move _17 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
StorageLive(_34); // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
discriminant(_34) = 0; // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
(_14.0: &[&str]) = move _15; // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
(_14.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _34; // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
(_14.2: &[std::fmt::ArgumentV1]) = move _16; // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
StorageDead(_34); // scope 10 at $SRC_DIR/libcore/fmt/mod.rs:LL:COL
_13 = &_14; // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
const std::rt::begin_panic_fmt(move _13); // scope 4 at $SRC_DIR/libstd/macros.rs:LL:COL
// ty::Const
// + ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $SRC_DIR/libstd/macros.rs:LL:COL
// + literal: Const { ty: for<'r, 's> fn(&'r std::fmt::Arguments<'s>) -> ! {std::rt::begin_panic_fmt}, val: Value(Scalar(<ZST>)) }
}
}

377 changes: 377 additions & 0 deletions src/test/mir-opt/issue-73223/64bit/rustc.main.SimplifyArmIdentity.diff

Large diffs are not rendered by default.