Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH

This commit is contained in:
Jakob Degen 2022-09-04 22:35:47 -07:00
parent 289279de11
commit 46130a1d18
61 changed files with 12 additions and 1598 deletions

View File

@ -7,7 +7,7 @@ unsafe fn foo(z: *mut usize) -> u32 {
99
}
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir
fn main() {
let mut x = [42, 43, 44];

View File

@ -1,64 +0,0 @@
// MIR for `main` after SimplifyCfg-elaborate-drops
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/array-index-is-temporary.rs:+0:11: +0:11
let mut _1: [u32; 3]; // in scope 0 at $DIR/array-index-is-temporary.rs:+1:9: +1:14
let mut _4: &mut usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
let mut _5: u32; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:12: +4:29
let mut _6: *mut usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:25: +4:26
let _7: usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
let mut _8: usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
let mut _9: bool; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
scope 1 {
debug x => _1; // in scope 1 at $DIR/array-index-is-temporary.rs:+1:9: +1:14
let mut _2: usize; // in scope 1 at $DIR/array-index-is-temporary.rs:+2:9: +2:14
scope 2 {
debug y => _2; // in scope 2 at $DIR/array-index-is-temporary.rs:+2:9: +2:14
let _3: *mut usize; // in scope 2 at $DIR/array-index-is-temporary.rs:+3:9: +3:10
scope 3 {
debug z => _3; // in scope 3 at $DIR/array-index-is-temporary.rs:+3:9: +3:10
scope 4 {
}
}
}
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/array-index-is-temporary.rs:+1:9: +1:14
_1 = [const 42_u32, const 43_u32, const 44_u32]; // scope 0 at $DIR/array-index-is-temporary.rs:+1:17: +1:29
StorageLive(_2); // scope 1 at $DIR/array-index-is-temporary.rs:+2:9: +2:14
_2 = const 1_usize; // scope 1 at $DIR/array-index-is-temporary.rs:+2:17: +2:18
StorageLive(_3); // scope 2 at $DIR/array-index-is-temporary.rs:+3:9: +3:10
StorageLive(_4); // scope 2 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
_4 = &mut _2; // scope 2 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
_3 = &raw mut (*_4); // scope 2 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
StorageDead(_4); // scope 2 at $DIR/array-index-is-temporary.rs:+3:31: +3:32
StorageLive(_5); // scope 3 at $DIR/array-index-is-temporary.rs:+4:12: +4:29
StorageLive(_6); // scope 4 at $DIR/array-index-is-temporary.rs:+4:25: +4:26
_6 = _3; // scope 4 at $DIR/array-index-is-temporary.rs:+4:25: +4:26
_5 = foo(move _6) -> bb1; // scope 4 at $DIR/array-index-is-temporary.rs:+4:21: +4:27
// mir::Constant
// + span: $DIR/array-index-is-temporary.rs:16:21: 16:24
// + literal: Const { ty: unsafe fn(*mut usize) -> u32 {foo}, val: Value(<ZST>) }
}
bb1: {
StorageDead(_6); // scope 4 at $DIR/array-index-is-temporary.rs:+4:26: +4:27
StorageLive(_7); // scope 3 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
_7 = _2; // scope 3 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
_8 = Len(_1); // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
_9 = Lt(_7, _8); // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
}
bb2: {
_1[_7] = move _5; // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:29
StorageDead(_5); // scope 3 at $DIR/array-index-is-temporary.rs:+4:28: +4:29
StorageDead(_7); // scope 3 at $DIR/array-index-is-temporary.rs:+4:29: +4:30
_0 = const (); // scope 0 at $DIR/array-index-is-temporary.rs:+0:11: +5:2
StorageDead(_3); // scope 2 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
StorageDead(_2); // scope 1 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
StorageDead(_1); // scope 0 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
return; // scope 0 at $DIR/array-index-is-temporary.rs:+5:2: +5:2
}
}

View File

@ -1,7 +1,7 @@
// ignore-endian-big
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -Z mir-opt-level=4
// EMIT_MIR_FOR_EACH_BIT_WIDTH
#![feature(box_syntax)]
// EMIT_MIR inline_into_box_place.main.Inline.diff
fn main() {

View File

@ -1,82 +0,0 @@
- // MIR for `main` before Inline
+ // MIR for `main` after Inline
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:+0:11: +0:11
let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:9: +1:11
let mut _2: usize; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
let mut _3: usize; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
let mut _4: *mut u8; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
let mut _5: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
let mut _6: (); // in scope 0 at $DIR/inline-into-box-place.rs:+1:42: +1:43
let mut _7: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
+ let mut _8: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
scope 1 {
debug _x => _1; // in scope 1 at $DIR/inline-into-box-place.rs:+1:9: +1:11
}
scope 2 {
}
+ scope 3 (inlined Vec::<u32>::new) { // at $DIR/inline-into-box-place.rs:8:33: 8:43
+ let mut _9: alloc::raw_vec::RawVec<u32>; // in scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ }
bb0: {
StorageLive(_1); // scope 0 at $DIR/inline-into-box-place.rs:+1:9: +1:11
_2 = SizeOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:+1:29: +1:43
_3 = AlignOf(std::vec::Vec<u32>); // scope 2 at $DIR/inline-into-box-place.rs:+1:29: +1:43
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/inline-into-box-place.rs:+1:29: +1:43
// mir::Constant
// + span: $DIR/inline-into-box-place.rs:8:29: 8:43
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
}
bb1: {
StorageLive(_5); // scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
_5 = ShallowInitBox(move _4, std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
_7 = (((_5.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
- (*_7) = Vec::<u32>::new() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
+ StorageLive(_8); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
+ _8 = &mut (*_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
+ StorageLive(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ _9 = const alloc::raw_vec::RawVec::<u32>::NEW; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
// mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:33: 8:41
- // + user_ty: UserType(1)
- // + literal: Const { ty: fn() -> Vec<u32> {Vec::<u32>::new}, val: Value(<ZST>) }
- }
-
- bb2: {
+ // + span: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ // + user_ty: UserType(0)
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Unevaluated(alloc::raw_vec::RawVec::<T>::NEW, [u32], None) }
+ Deinit((*_8)); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ ((*_8).0: alloc::raw_vec::RawVec<u32>) = move _9; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ ((*_8).1: usize) = const 0_usize; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ StorageDead(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ StorageDead(_8); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
_1 = move _5; // scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
StorageDead(_5); // scope 0 at $DIR/inline-into-box-place.rs:+1:42: +1:43
_0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:+0:11: +2:2
- drop(_1) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:+2:1: +2:2
+ drop(_1) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/inline-into-box-place.rs:+2:1: +2:2
}
- bb3: {
+ bb2: {
StorageDead(_1); // scope 0 at $DIR/inline-into-box-place.rs:+2:1: +2:2
return; // scope 0 at $DIR/inline-into-box-place.rs:+2:2: +2:2
}
- bb4 (cleanup): {
+ bb3 (cleanup): {
resume; // scope 0 at $DIR/inline-into-box-place.rs:+0:1: +2:2
- }
-
- bb5 (cleanup): {
- _6 = alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>(move (_5.0: std::ptr::Unique<std::vec::Vec<u32>>), move (_5.1: std::alloc::Global)) -> bb4; // scope 0 at $DIR/inline-into-box-place.rs:+1:42: +1:43
- // mir::Constant
- // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
- // + literal: Const { ty: unsafe fn(Unique<Vec<u32>>, std::alloc::Global) {alloc::alloc::box_free::<Vec<u32>, std::alloc::Global>}, val: Value(<ZST>) }
}
}

View File

@ -13,7 +13,7 @@ trait Foo {
fn get(&self) -> [u8; 2];
}
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir
impl Foo for [u8; 1+1] {
fn get(&self) -> [u8; 2] {

View File

@ -11,14 +11,14 @@ union Foo {
b: Never
}
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR issue_72181.foo.mir_map.0.mir
fn foo(xs: [(Never, u32); 1]) -> u32 { xs[0].1 }
// EMIT_MIR issue_72181.bar.mir_map.0.mir
fn bar([(_, x)]: [(Never, u32); 1]) -> u32 { x }
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR issue_72181.main.mir_map.0.mir
fn main() {
let _ = mem::size_of::<Foo>();

View File

@ -8,5 +8,5 @@ fn main() {
assert_eq!(split, 1);
}
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR issue_73223.main.SimplifyArmIdentity.diff

View File

@ -1,20 +0,0 @@
// MIR for `<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}` after SimplifyCfg-promote-consts
<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}: usize = {
let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
bb0: {
_1 = CheckedAdd(const 1_usize, const 1_usize); // scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_usize, const 1_usize) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
}
bb1: {
_0 = move (_1.0: usize); // scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
return; // scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
}
bb2 (cleanup): {
resume; // scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
}
}

View File

@ -1,17 +0,0 @@
// MIR for `bar` 0 mir_map
fn bar(_1: [(Never, u32); 1]) -> u32 {
let mut _0: u32; // return place in scope 0 at $DIR/issue-72181.rs:+0:40: +0:43
let _2: u32; // in scope 0 at $DIR/issue-72181.rs:+0:13: +0:14
scope 1 {
debug x => _2; // in scope 1 at $DIR/issue-72181.rs:+0:13: +0:14
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/issue-72181.rs:+0:13: +0:14
_2 = (_1[0 of 1].1: u32); // scope 0 at $DIR/issue-72181.rs:+0:13: +0:14
_0 = _2; // scope 1 at $DIR/issue-72181.rs:+0:46: +0:47
StorageDead(_2); // scope 0 at $DIR/issue-72181.rs:+0:48: +0:49
return; // scope 0 at $DIR/issue-72181.rs:+0:49: +0:49
}
}

View File

@ -1,27 +0,0 @@
// MIR for `foo` 0 mir_map
fn foo(_1: [(Never, u32); 1]) -> u32 {
debug xs => _1; // in scope 0 at $DIR/issue-72181.rs:+0:8: +0:10
let mut _0: u32; // return place in scope 0 at $DIR/issue-72181.rs:+0:34: +0:37
let _2: usize; // in scope 0 at $DIR/issue-72181.rs:+0:43: +0:44
let mut _3: usize; // in scope 0 at $DIR/issue-72181.rs:+0:40: +0:45
let mut _4: bool; // in scope 0 at $DIR/issue-72181.rs:+0:40: +0:45
bb0: {
StorageLive(_2); // scope 0 at $DIR/issue-72181.rs:+0:43: +0:44
_2 = const 0_usize; // scope 0 at $DIR/issue-72181.rs:+0:43: +0:44
_3 = Len(_1); // scope 0 at $DIR/issue-72181.rs:+0:40: +0:45
_4 = Lt(_2, _3); // scope 0 at $DIR/issue-72181.rs:+0:40: +0:45
assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue-72181.rs:+0:40: +0:45
}
bb1: {
_0 = (_1[_2].1: u32); // scope 0 at $DIR/issue-72181.rs:+0:40: +0:47
StorageDead(_2); // scope 0 at $DIR/issue-72181.rs:+0:48: +0:49
return; // scope 0 at $DIR/issue-72181.rs:+0:49: +0:49
}
bb2 (cleanup): {
resume; // scope 0 at $DIR/issue-72181.rs:+0:1: +0:49
}
}

View File

@ -1,62 +0,0 @@
// MIR for `main` 0 mir_map
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/issue-72181.rs:+0:11: +0:11
let mut _1: usize; // in scope 0 at $DIR/issue-72181.rs:+1:13: +1:34
let mut _3: Foo; // in scope 0 at $DIR/issue-72181.rs:+3:14: +3:27
let mut _4: Foo; // in scope 0 at $DIR/issue-72181.rs:+3:29: +3:42
let mut _5: u64; // in scope 0 at $DIR/issue-72181.rs:+4:13: +4:30
let _6: usize; // in scope 0 at $DIR/issue-72181.rs:+4:24: +4:25
let mut _7: usize; // in scope 0 at $DIR/issue-72181.rs:+4:22: +4:26
let mut _8: bool; // in scope 0 at $DIR/issue-72181.rs:+4:22: +4:26
scope 1 {
let _2: [Foo; 2]; // in scope 1 at $DIR/issue-72181.rs:+3:9: +3:10
scope 2 {
debug f => _2; // in scope 2 at $DIR/issue-72181.rs:+3:9: +3:10
scope 3 {
}
scope 4 {
}
}
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/issue-72181.rs:+1:13: +1:34
_1 = std::mem::size_of::<Foo>() -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue-72181.rs:+1:13: +1:34
// mir::Constant
// + span: $DIR/issue-72181.rs:24:13: 24:32
// + literal: Const { ty: fn() -> usize {std::mem::size_of::<Foo>}, val: Value(<ZST>) }
}
bb1: {
StorageDead(_1); // scope 0 at $DIR/issue-72181.rs:+1:34: +1:35
StorageLive(_2); // scope 1 at $DIR/issue-72181.rs:+3:9: +3:10
StorageLive(_3); // scope 1 at $DIR/issue-72181.rs:+3:14: +3:27
_3 = Foo { a: const 42_u64 }; // scope 1 at $DIR/issue-72181.rs:+3:14: +3:27
StorageLive(_4); // scope 1 at $DIR/issue-72181.rs:+3:29: +3:42
_4 = Foo { a: const 10_u64 }; // scope 1 at $DIR/issue-72181.rs:+3:29: +3:42
_2 = [move _3, move _4]; // scope 1 at $DIR/issue-72181.rs:+3:13: +3:43
StorageDead(_4); // scope 1 at $DIR/issue-72181.rs:+3:42: +3:43
StorageDead(_3); // scope 1 at $DIR/issue-72181.rs:+3:42: +3:43
FakeRead(ForLet(None), _2); // scope 1 at $DIR/issue-72181.rs:+3:9: +3:10
StorageLive(_5); // scope 2 at $DIR/issue-72181.rs:+4:13: +4:30
StorageLive(_6); // scope 4 at $DIR/issue-72181.rs:+4:24: +4:25
_6 = const 0_usize; // scope 4 at $DIR/issue-72181.rs:+4:24: +4:25
_7 = Len(_2); // scope 4 at $DIR/issue-72181.rs:+4:22: +4:26
_8 = Lt(_6, _7); // scope 4 at $DIR/issue-72181.rs:+4:22: +4:26
assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb2, unwind: bb3]; // scope 4 at $DIR/issue-72181.rs:+4:22: +4:26
}
bb2: {
_5 = (_2[_6].0: u64); // scope 4 at $DIR/issue-72181.rs:+4:22: +4:28
StorageDead(_6); // scope 2 at $DIR/issue-72181.rs:+4:30: +4:31
StorageDead(_5); // scope 2 at $DIR/issue-72181.rs:+4:30: +4:31
_0 = const (); // scope 0 at $DIR/issue-72181.rs:+0:11: +5:2
StorageDead(_2); // scope 1 at $DIR/issue-72181.rs:+5:1: +5:2
return; // scope 0 at $DIR/issue-72181.rs:+5:2: +5:2
}
bb3 (cleanup): {
resume; // scope 0 at $DIR/issue-72181.rs:+0:1: +5:2
}
}

View File

@ -1,161 +0,0 @@
- // MIR for `main` before SimplifyArmIdentity
+ // MIR for `main` after SimplifyArmIdentity
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/issue-73223.rs:+0:11: +0:11
let _1: i32; // in scope 0 at $DIR/issue-73223.rs:+1:9: +1:14
let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
let mut _3: isize; // in scope 0 at $DIR/issue-73223.rs:+2:9: +2:16
let _4: i32; // in scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
let mut _5: !; // in scope 0 at $DIR/issue-73223.rs:+3:17: +3:23
let mut _7: i32; // in scope 0 at $DIR/issue-73223.rs:+6:22: +6:27
let _8: (); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _9: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _10: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _11: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _12: i32; // in scope 0 at $DIR/issue-73223.rs:+7:23: +7:24
let mut _15: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _16: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _17: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _18: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _19: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _21: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _22: core::panicking::AssertKind; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _23: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _24: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _25: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _26: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _27: std::option::Option<std::fmt::Arguments>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
scope 1 {
debug split => _1; // in scope 1 at $DIR/issue-73223.rs:+1:9: +1:14
let _6: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:+6:9: +6:14
scope 3 {
debug _prev => _6; // in scope 3 at $DIR/issue-73223.rs:+6:9: +6:14
let _13: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _14: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _28: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
scope 4 {
debug left_val => _13; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
debug right_val => _14; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _20: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
scope 5 {
debug kind => _20; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
}
}
}
scope 2 {
debug v => _4; // in scope 2 at $DIR/issue-73223.rs:+2:14: +2:15
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:+1:9: +1:14
StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
Deinit(_2); // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
_3 = const 1_isize; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
goto -> bb3; // scope 0 at $DIR/issue-73223.rs:+1:17: +1:30
}
bb1: {
nop; // scope 0 at $DIR/issue-73223.rs:+3:17: +3:23
StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:+4:6: +4:7
StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:+8:1: +8:2
return; // scope 0 at $DIR/issue-73223.rs:+8:2: +8:2
}
bb2: {
unreachable; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
}
bb3: {
StorageLive(_4); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
_4 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
_1 = _4; // scope 2 at $DIR/issue-73223.rs:+2:20: +2:21
StorageDead(_4); // scope 0 at $DIR/issue-73223.rs:+2:20: +2:21
StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:+4:6: +4:7
StorageLive(_6); // scope 1 at $DIR/issue-73223.rs:+6:9: +6:14
StorageLive(_7); // scope 1 at $DIR/issue-73223.rs:+6:22: +6:27
_7 = _1; // scope 1 at $DIR/issue-73223.rs:+6:22: +6:27
Deinit(_6); // scope 1 at $DIR/issue-73223.rs:+6:17: +6:28
((_6 as Some).0: i32) = move _7; // scope 1 at $DIR/issue-73223.rs:+6:17: +6:28
discriminant(_6) = 1; // scope 1 at $DIR/issue-73223.rs:+6:17: +6:28
StorageDead(_7); // scope 1 at $DIR/issue-73223.rs:+6:27: +6:28
StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_10 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_28 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
_11 = _28; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
Deinit(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_9.0: &i32) = move _10; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
(_9.1: &i32) = move _11; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_13 = (_9.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_14 = (_9.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_17 = (*_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_18 = const 1_i32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_16 = Eq(move _17, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
switchInt(move _15) -> [false: bb5, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb4: {
StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
Deinit(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
discriminant(_20) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_22 = const core::panicking::AssertKind::Eq; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
StorageLive(_23); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_24); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_24 = _13; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_23 = _24; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_25); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_26); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_26 = _14; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_25 = _26; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
Deinit(_27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
discriminant(_27) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_21 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(<ZST>) }
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
}
bb5: {
nop; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
nop; // scope 0 at $DIR/issue-73223.rs:+0:11: +8:2
StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:+8:1: +8:2
StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:+8:1: +8:2
return; // scope 0 at $DIR/issue-73223.rs:+8:2: +8:2
}
}

View File

@ -1,88 +0,0 @@
- // MIR for `bar` before MatchBranchSimplification
+ // MIR for `bar` after MatchBranchSimplification
fn bar(_1: i32) -> (bool, bool, bool, bool) {
debug i => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:+0:8: +0:9
let mut _0: (bool, bool, bool, bool); // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:19: +0:43
let _2: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:10
let _6: (); // in scope 0 at $DIR/matches_reduce_branches.rs:+6:5: +21:6
let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:6: +23:7
let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:9: +23:10
let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:12: +23:13
let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:15: +23:16
+ let mut _11: i32; // in scope 0 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
scope 1 {
debug a => _2; // in scope 1 at $DIR/matches_reduce_branches.rs:+1:9: +1:10
let _3: bool; // in scope 1 at $DIR/matches_reduce_branches.rs:+2:9: +2:10
scope 2 {
debug b => _3; // in scope 2 at $DIR/matches_reduce_branches.rs:+2:9: +2:10
let _4: bool; // in scope 2 at $DIR/matches_reduce_branches.rs:+3:9: +3:10
scope 3 {
debug c => _4; // in scope 3 at $DIR/matches_reduce_branches.rs:+3:9: +3:10
let _5: bool; // in scope 3 at $DIR/matches_reduce_branches.rs:+4:9: +4:10
scope 4 {
debug d => _5; // in scope 4 at $DIR/matches_reduce_branches.rs:+4:9: +4:10
}
}
}
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:10
StorageLive(_3); // scope 1 at $DIR/matches_reduce_branches.rs:+2:9: +2:10
StorageLive(_4); // scope 2 at $DIR/matches_reduce_branches.rs:+3:9: +3:10
StorageLive(_5); // scope 3 at $DIR/matches_reduce_branches.rs:+4:9: +4:10
StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +21:6
- switchInt(_1) -> [7_i32: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
- }
-
- bb1: {
- _2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+15:13: +15:21
- _3 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+16:13: +16:22
- _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+17:13: +17:22
- _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+18:13: +18:21
- Deinit(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+19:13: +19:15
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:+19:13: +19:15
- }
-
- bb2: {
- _2 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+8:13: +8:22
- _3 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+9:13: +9:21
+ StorageLive(_11); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
+ _11 = _1; // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
+ _2 = Ne(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:+8:13: +8:22
+ _3 = Eq(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:+9:13: +9:21
_4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+10:13: +10:22
_5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+11:13: +11:21
Deinit(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+12:13: +12:15
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:+12:13: +12:15
- }
-
- bb3: {
+ StorageDead(_11); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
StorageDead(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+21:6: +21:7
StorageLive(_7); // scope 4 at $DIR/matches_reduce_branches.rs:+23:6: +23:7
_7 = _2; // scope 4 at $DIR/matches_reduce_branches.rs:+23:6: +23:7
StorageLive(_8); // scope 4 at $DIR/matches_reduce_branches.rs:+23:9: +23:10
_8 = _3; // scope 4 at $DIR/matches_reduce_branches.rs:+23:9: +23:10
StorageLive(_9); // scope 4 at $DIR/matches_reduce_branches.rs:+23:12: +23:13
_9 = _4; // scope 4 at $DIR/matches_reduce_branches.rs:+23:12: +23:13
StorageLive(_10); // scope 4 at $DIR/matches_reduce_branches.rs:+23:15: +23:16
_10 = _5; // scope 4 at $DIR/matches_reduce_branches.rs:+23:15: +23:16
Deinit(_0); // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
(_0.0: bool) = move _7; // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
(_0.1: bool) = move _8; // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
(_0.2: bool) = move _9; // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
(_0.3: bool) = move _10; // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
StorageDead(_10); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
StorageDead(_9); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
StorageDead(_8); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
StorageDead(_7); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
StorageDead(_5); // scope 3 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
StorageDead(_4); // scope 2 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
StorageDead(_3); // scope 1 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
return; // scope 0 at $DIR/matches_reduce_branches.rs:+24:2: +24:2
}
}

View File

@ -1,55 +0,0 @@
- // MIR for `foo` before MatchBranchSimplification
+ // MIR for `foo` after MatchBranchSimplification
fn foo(_1: Option<()>) -> () {
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:+0:8: +0:11
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:25
let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _3: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:22: +1:26
+ let mut _4: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
bb0: {
StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_3 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:17: +1:20
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageLive(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _4 = move _3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _2 = Eq(_4, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ StorageDead(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb1: {
- _2 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
-
- bb2: {
- _2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
-
- bb3: {
- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
-
- bb4: {
Deinit(_0); // scope 0 at $DIR/matches_reduce_branches.rs:+2:9: +2:11
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
+ goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
}
- bb5: {
+ bb2: {
_0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:+3:6: +3:6
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
+ goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
}
- bb6: {
+ bb3: {
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+3:5: +3:6
return; // scope 0 at $DIR/matches_reduce_branches.rs:+4:2: +4:2
}
}

View File

@ -1,113 +0,0 @@
- // MIR for `match_nested_if` before MatchBranchSimplification
+ // MIR for `match_nested_if` after MatchBranchSimplification
fn match_nested_if() -> bool {
let mut _0: bool; // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:29
let _1: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
let mut _2: (); // in scope 0 at $DIR/matches_reduce_branches.rs:+1:21: +1:23
let mut _3: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
let mut _4: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
let mut _5: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
let mut _6: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
+ let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
+ let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+ let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+ let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
scope 1 {
debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+1:21: +1:23
Deinit(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+1:21: +1:23
StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
StorageLive(_4); // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
_6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- }
-
- bb1: {
- _5 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:31: +2:35
- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
- }
-
- bb2: {
- _5 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+2:45: +2:50
- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
- }
-
- bb3: {
+ StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
+ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
+ _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+2:45: +2:50
+ StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:+2:51: +2:52
- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
- }
-
- bb4: {
- _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:55: +2:59
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
- }
-
- bb5: {
- _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+2:69: +2:74
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
- }
-
- bb6: {
+ StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+ _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+2:69: +2:74
+ StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:+2:75: +2:76
- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
- }
-
- bb7: {
- _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+3:13: +3:17
- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
- }
-
- bb8: {
- _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+5:13: +5:18
- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
- }
-
- bb9: {
- switchInt(move _3) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
- }
-
- bb10: {
+ StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+ _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+5:13: +5:18
+ StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+ StorageLive(_10); // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+ _10 = move _3; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
- _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+8:13: +8:17
- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:+8:13: +8:17
- }
-
- bb11: {
- StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
- StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
- _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
- }
-
- bb12: {
+ _1 = Ne(_10, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
+ StorageDead(_10); // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+11:6: +11:7
_0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:+12:5: +12:8
StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+13:1: +13:2
return; // scope 0 at $DIR/matches_reduce_branches.rs:+13:2: +13:2
}
}

View File

@ -1,6 +1,6 @@
// unit-test: MatchBranchSimplification
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR matches_reduce_branches.foo.MatchBranchSimplification.diff
// EMIT_MIR matches_reduce_branches.bar.MatchBranchSimplification.diff
// EMIT_MIR matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff

View File

@ -1,32 +0,0 @@
- // MIR for `exhaustive_match` before MatchBranchSimplification
+ // MIR for `exhaustive_match` after MatchBranchSimplification
fn exhaustive_match(_1: E) -> u8 {
debug e => _1; // in scope 0 at $DIR/matches_u8.rs:+0:25: +0:26
let mut _0: u8; // return place in scope 0 at $DIR/matches_u8.rs:+0:34: +0:36
let mut _2: isize; // in scope 0 at $DIR/matches_u8.rs:+2:9: +2:13
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
}
bb1: {
_0 = const 1_u8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
}
bb2: {
unreachable; // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
}
bb3: {
_0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
}
bb4: {
return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
}
}

View File

@ -1,32 +0,0 @@
- // MIR for `exhaustive_match_i8` before MatchBranchSimplification
+ // MIR for `exhaustive_match_i8` after MatchBranchSimplification
fn exhaustive_match_i8(_1: E) -> i8 {
debug e => _1; // in scope 0 at $DIR/matches_u8.rs:+0:28: +0:29
let mut _0: i8; // return place in scope 0 at $DIR/matches_u8.rs:+0:37: +0:39
let mut _2: isize; // in scope 0 at $DIR/matches_u8.rs:+2:9: +2:13
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
}
bb1: {
_0 = const 1_i8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
}
bb2: {
unreachable; // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
}
bb3: {
_0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
}
bb4: {
return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
}
}

View File

@ -1,6 +1,6 @@
// unit-test: MatchBranchSimplification
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR matches_u8.exhaustive_match.MatchBranchSimplification.diff
// EMIT_MIR matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff

View File

@ -1,6 +1,6 @@
// ignore-wasm32-bare compiled with panic=abort by default
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir
fn main() {
let mut x = Packed(Aligned(Droppy(0)));

View File

@ -1,60 +0,0 @@
// MIR for `main` after SimplifyCfg-elaborate-drops
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/packed-struct-drop-aligned.rs:+0:11: +0:11
let mut _1: Packed; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:9: +1:14
let mut _2: Aligned; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
let mut _3: Droppy; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
let mut _4: Aligned; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
let mut _5: Droppy; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
let mut _6: Aligned; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
scope 1 {
debug x => _1; // in scope 1 at $DIR/packed-struct-drop-aligned.rs:+1:9: +1:14
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:9: +1:14
StorageLive(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
StorageLive(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
Deinit(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
(_3.0: usize) = const 0_usize; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
Deinit(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
(_2.0: Droppy) = move _3; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
StorageDead(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:41: +1:42
Deinit(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:17: +1:43
(_1.0: Aligned) = move _2; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:17: +1:43
StorageDead(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:42: +1:43
StorageLive(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
StorageLive(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
Deinit(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
(_5.0: usize) = const 0_usize; // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
Deinit(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
(_4.0: Droppy) = move _5; // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
StorageDead(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:28: +2:29
StorageLive(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
_6 = move (_1.0: Aligned); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
drop(_6) -> [return: bb4, unwind: bb3]; // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
}
bb1: {
StorageDead(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+3:1: +3:2
return; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+3:2: +3:2
}
bb2 (cleanup): {
resume; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+0:1: +3:2
}
bb3 (cleanup): {
(_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
drop(_1) -> bb2; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+3:1: +3:2
}
bb4: {
StorageDead(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
(_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
StorageDead(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:28: +2:29
_0 = const (); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+0:11: +3:2
drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+3:1: +3:2
}
}

View File

@ -1,146 +0,0 @@
- // MIR for `identity` before ConstProp
+ // MIR for `identity` after ConstProp
fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:13: +0:14
let mut _0: std::result::Result<i32, i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:37: +0:53
let mut _2: i32; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
let mut _4: std::result::Result<i32, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
let mut _5: isize; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
let _6: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
let mut _7: !; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
let mut _8: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
scope 1 {
debug residual => _6; // in scope 1 at $DIR/separate_const_switch.rs:+1:9: +1:10
scope 2 {
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10
debug residual => _8; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
let _16: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _17: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _18: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
scope 9 {
debug e => _16; // in scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
scope 10 (inlined <i32 as From<i32>>::from) { // at $SRC_DIR/core/src/result.rs:LL:COL
debug t => _18; // in scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
}
}
}
}
}
scope 3 {
debug val => _9; // in scope 3 at $DIR/separate_const_switch.rs:+1:8: +1:10
scope 4 {
}
}
scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:29:8: 29:10
debug self => _4; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _10: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let _11: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _12: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let _13: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _14: std::result::Result<std::convert::Infallible, i32>; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _15: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
scope 6 {
debug v => _11; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
}
scope 7 {
debug e => _13; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
}
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
_4 = _1; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
_10 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
}
bb1: {
StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
_9 = ((_3 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
_2 = _9; // scope 4 at $DIR/separate_const_switch.rs:+1:8: +1:10
StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
Deinit(_0); // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
((_0 as Ok).0: i32) = move _2; // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
discriminant(_0) = 0; // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11
StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2
return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
}
bb2: {
unreachable; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
}
bb3: {
StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
_6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageLive(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
_8 = _6; // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageLive(_16); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
_16 = move ((_8 as Err).0: i32); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_17); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_18); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
_18 = move _16; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
_17 = move _18; // scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
StorageDead(_18); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
Deinit(_0); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
((_0 as Err).0: i32) = move _17; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
discriminant(_0) = 1; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_17); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_16); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11
StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2
return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
}
bb4: {
StorageLive(_13); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
_13 = move ((_4 as Err).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_15); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
_15 = move _13; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
Deinit(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
((_14 as Err).0: i32) = move _15; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
discriminant(_14) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_15); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
Deinit(_3); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>) = move _14; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
discriminant(_3) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_13); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ _5 = const 1_isize; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ switchInt(const 1_isize) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
}
bb5: {
unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
}
bb6: {
StorageLive(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
_11 = move ((_4 as Ok).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
_12 = move _11; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
Deinit(_3); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
((_3 as Continue).0: i32) = move _12; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
discriminant(_3) = 0; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ _5 = const 0_isize; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ switchInt(const 0_isize) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
}
}

View File

@ -1,124 +0,0 @@
// MIR for `identity` after PreCodegen
fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:13: +0:14
let mut _0: std::result::Result<i32, i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:37: +0:53
let mut _2: i32; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
let mut _4: std::result::Result<i32, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
let _5: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
let mut _6: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
let _7: i32; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
scope 1 {
debug residual => _5; // in scope 1 at $DIR/separate_const_switch.rs:+1:9: +1:10
scope 2 {
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10
debug residual => _6; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
let _14: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _15: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _16: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
scope 9 {
debug e => _14; // in scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
scope 10 (inlined <i32 as From<i32>>::from) { // at $SRC_DIR/core/src/result.rs:LL:COL
debug t => _16; // in scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
}
}
}
}
}
scope 3 {
debug val => _7; // in scope 3 at $DIR/separate_const_switch.rs:+1:8: +1:10
scope 4 {
}
}
scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:29:8: 29:10
debug self => _4; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _8: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let _9: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _10: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let _11: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _12: std::result::Result<std::convert::Infallible, i32>; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _13: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
scope 6 {
debug v => _9; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
}
scope 7 {
debug e => _11; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
}
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
_4 = _1; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
_8 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
switchInt(move _8) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
}
bb1: {
StorageLive(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
_11 = move ((_4 as Err).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_12); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_13); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
_13 = move _11; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
Deinit(_12); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
((_12 as Err).0: i32) = move _13; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
discriminant(_12) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_13); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
Deinit(_3); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>) = move _12; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
discriminant(_3) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_12); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageLive(_5); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
_5 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageLive(_6); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
_6 = _5; // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageLive(_14); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
_14 = move ((_6 as Err).0: i32); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_15); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_16); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
_16 = move _14; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
_15 = move _16; // scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
StorageDead(_16); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
Deinit(_0); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
((_0 as Err).0: i32) = move _15; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
discriminant(_0) = 1; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_15); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_14); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_6); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageDead(_5); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11
StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2
return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
}
bb2: {
unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
}
bb3: {
StorageLive(_9); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
_9 = move ((_4 as Ok).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_10); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
_10 = move _9; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
Deinit(_3); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
((_3 as Continue).0: i32) = move _10; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
discriminant(_3) = 0; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_10); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_9); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageLive(_7); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
_7 = ((_3 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
_2 = _7; // scope 4 at $DIR/separate_const_switch.rs:+1:8: +1:10
StorageDead(_7); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
Deinit(_0); // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
((_0 as Ok).0: i32) = move _2; // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
discriminant(_0) = 0; // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11
StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2
return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
}
}

View File

@ -1,103 +0,0 @@
- // MIR for `too_complex` before ConstProp
+ // MIR for `too_complex` after ConstProp
fn too_complex(_1: Result<i32, usize>) -> Option<i32> {
debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:16: +0:17
let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:42: +0:53
let mut _2: std::ops::ControlFlow<usize, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
let mut _3: isize; // in scope 0 at $DIR/separate_const_switch.rs:+7:13: +7:18
let _4: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
let mut _5: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:44: +7:45
let _6: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
let mut _7: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:42: +8:43
let mut _8: isize; // in scope 0 at $DIR/separate_const_switch.rs:+11:9: +11:33
let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
let mut _10: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:42: +11:43
let _11: usize; // in scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
scope 1 {
debug v => _4; // in scope 1 at $DIR/separate_const_switch.rs:+7:16: +7:17
}
scope 2 {
debug r => _6; // in scope 2 at $DIR/separate_const_switch.rs:+8:17: +8:18
}
scope 3 {
debug v => _9; // in scope 3 at $DIR/separate_const_switch.rs:+11:31: +11:32
}
scope 4 {
debug r => _11; // in scope 4 at $DIR/separate_const_switch.rs:+12:28: +12:29
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
_3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
switchInt(move _3) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16
}
bb1: {
StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
_6 = ((_1 as Err).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
StorageLive(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:42: +8:43
_7 = _6; // scope 2 at $DIR/separate_const_switch.rs:+8:42: +8:43
Deinit(_2); // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44
((_2 as Break).0: usize) = move _7; // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44
discriminant(_2) = 1; // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44
StorageDead(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:43: +8:44
StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
- _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- switchInt(move _8) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
+ _8 = const 1_isize; // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
+ switchInt(const 1_isize) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
}
bb2: {
unreachable; // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
}
bb3: {
StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
_4 = ((_1 as Ok).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
StorageLive(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
_5 = _4; // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
Deinit(_2); // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
((_2 as Continue).0: i32) = move _5; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
discriminant(_2) = 0; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
StorageDead(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:45: +7:46
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
- _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- switchInt(move _8) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
+ _8 = const 0_isize; // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
+ switchInt(const 0_isize) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
}
bb4: {
StorageLive(_11); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
_11 = ((_2 as Break).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
Deinit(_0); // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38
discriminant(_0) = 0; // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38
StorageDead(_11); // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
goto -> bb7; // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
}
bb5: {
unreachable; // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
}
bb6: {
StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
_9 = ((_2 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
StorageLive(_10); // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
_10 = _9; // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
Deinit(_0); // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
((_0 as Some).0: i32) = move _10; // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
discriminant(_0) = 1; // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
StorageDead(_10); // scope 3 at $DIR/separate_const_switch.rs:+11:43: +11:44
StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
goto -> bb7; // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
}
bb7: {
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+14:1: +14:2
return; // scope 0 at $DIR/separate_const_switch.rs:+14:2: +14:2
}
}

View File

@ -1,73 +0,0 @@
// MIR for `too_complex` after PreCodegen
fn too_complex(_1: Result<i32, usize>) -> Option<i32> {
debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:16: +0:17
let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:42: +0:53
let mut _2: std::ops::ControlFlow<usize, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
let mut _3: isize; // in scope 0 at $DIR/separate_const_switch.rs:+7:13: +7:18
let _4: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
let mut _5: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:44: +7:45
let _6: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
let _7: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
let mut _8: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:42: +11:43
let _9: usize; // in scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
scope 1 {
debug v => _4; // in scope 1 at $DIR/separate_const_switch.rs:+7:16: +7:17
}
scope 2 {
debug r => _6; // in scope 2 at $DIR/separate_const_switch.rs:+8:17: +8:18
}
scope 3 {
debug v => _7; // in scope 3 at $DIR/separate_const_switch.rs:+11:31: +11:32
}
scope 4 {
debug r => _9; // in scope 4 at $DIR/separate_const_switch.rs:+12:28: +12:29
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
_3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
switchInt(move _3) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16
}
bb1: {
StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
Deinit(_0); // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38
discriminant(_0) = 0; // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38
StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
goto -> bb4; // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
}
bb2: {
unreachable; // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
}
bb3: {
StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
_4 = ((_1 as Ok).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
StorageLive(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
_5 = _4; // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
Deinit(_2); // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
((_2 as Continue).0: i32) = move _5; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
discriminant(_2) = 0; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
StorageDead(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:45: +7:46
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
StorageLive(_7); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
_7 = ((_2 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
StorageLive(_8); // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
_8 = _7; // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
Deinit(_0); // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
((_0 as Some).0: i32) = move _8; // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
discriminant(_0) = 1; // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
StorageDead(_8); // scope 3 at $DIR/separate_const_switch.rs:+11:43: +11:44
StorageDead(_7); // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
goto -> bb4; // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
}
bb4: {
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+14:1: +14:2
return; // scope 0 at $DIR/separate_const_switch.rs:+14:2: +14:2
}
}

View File

@ -1,6 +1,6 @@
// Test that we don't generate unnecessarily large MIR for very simple matches
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR simple_match.match_bool.mir_map.0.mir
fn match_bool(x: bool) -> usize {
match x {

View File

@ -1,29 +0,0 @@
// MIR for `match_bool` 0 mir_map
fn match_bool(_1: bool) -> usize {
debug x => _1; // in scope 0 at $DIR/simple-match.rs:+0:15: +0:16
let mut _0: usize; // return place in scope 0 at $DIR/simple-match.rs:+0:27: +0:32
bb0: {
FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/simple-match.rs:+1:11: +1:12
switchInt(_1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/simple-match.rs:+1:5: +1:12
}
bb1: {
falseEdge -> [real: bb3, imaginary: bb2]; // scope 0 at $DIR/simple-match.rs:+2:9: +2:13
}
bb2: {
_0 = const 20_usize; // scope 0 at $DIR/simple-match.rs:+3:14: +3:16
goto -> bb4; // scope 0 at $DIR/simple-match.rs:+3:14: +3:16
}
bb3: {
_0 = const 10_usize; // scope 0 at $DIR/simple-match.rs:+2:17: +2:19
goto -> bb4; // scope 0 at $DIR/simple-match.rs:+2:17: +2:19
}
bb4: {
return; // scope 0 at $DIR/simple-match.rs:+5:2: +5:2
}
}

View File

@ -11,5 +11,4 @@ fn main() {
map(None);
}
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.diff

View File

@ -1,52 +0,0 @@
- // MIR for `map` before SimplifyLocals
+ // MIR for `map` after SimplifyLocals
fn map(_1: Option<Box<()>>) -> Option<Box<()>> {
debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+0:8: +0:9
let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+0:31: +0:46
let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:9: +2:13
let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:25: +3:26
- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
- let mut _7: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
scope 1 {
debug x => _3; // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
}
bb0: {
- _5 = const false; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:11: +1:12
- _5 = const true; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:11: +1:12
_2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:11: +1:12
switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:5: +1:12
}
bb1: {
StorageLive(_3); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
_3 = move ((_1 as Some).0: std::boxed::Box<()>); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
StorageLive(_4); // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:25: +3:26
_4 = move _3; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:25: +3:26
Deinit(_0); // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:20: +3:27
((_0 as Some).0: std::boxed::Box<()>) = move _4; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:20: +3:27
discriminant(_0) = 1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:20: +3:27
StorageDead(_4); // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:26: +3:27
StorageDead(_3); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:26: +3:27
goto -> bb4; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:26: +3:27
}
bb2: {
unreachable; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:11: +1:12
}
bb3: {
Deinit(_0); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:17: +2:21
discriminant(_0) = 0; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:17: +2:21
goto -> bb4; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:17: +2:21
}
bb4: {
- _6 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:2: +5:2
}
}

View File

@ -1,6 +1,6 @@
// compile-flags: -Zmir-opt-level=0
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
fn main() {
let _fn = std::ptr::drop_in_place::<[String]> as unsafe fn(_);

View File

@ -1,101 +0,0 @@
// MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
fn std::ptr::drop_in_place(_1: *mut [String]) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _4: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _5: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _6: bool; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _7: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _8: bool; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _9: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _10: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _11: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _12: bool; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _13: *mut std::string::String; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _14: bool; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _15: *mut [std::string::String]; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
bb0: {
goto -> bb15; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb1: {
return; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb2 (cleanup): {
resume; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb3 (cleanup): {
_5 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
_4 = Add(move _4, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
drop((*_5)) -> bb4; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb4 (cleanup): {
_6 = Eq(_4, _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
switchInt(move _6) -> [false: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb5: {
_7 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
_4 = Add(move _4, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
drop((*_7)) -> [return: bb6, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb6: {
_8 = Eq(_4, _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
switchInt(move _8) -> [false: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb7: {
_4 = const 0_usize; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
goto -> bb6; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb8: {
goto -> bb7; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb9 (cleanup): {
_11 = _9; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
_9 = Offset(move _9, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
drop((*_11)) -> bb10; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb10 (cleanup): {
_12 = Eq(_9, _10); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
switchInt(move _12) -> [false: bb9, otherwise: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb11: {
_13 = _9; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
_9 = Offset(move _9, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
drop((*_13)) -> [return: bb12, unwind: bb10]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb12: {
_14 = Eq(_9, _10); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
switchInt(move _14) -> [false: bb11, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb13: {
_15 = &raw mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
_9 = move _15 as *mut std::string::String (Misc); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
_10 = Offset(_9, move _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
goto -> bb12; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb14: {
goto -> bb13; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb15: {
_2 = SizeOf(std::string::String); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
_3 = Len((*_1)); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
switchInt(move _2) -> [0_usize: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
}

View File

@ -1,7 +1,7 @@
// Test that we don't ICE when trying to dump MIR for unusual item types and
// that we don't create filenames containing `<` and `>`
// compile-flags: -Zmir-opt-level=0
// EMIT_MIR_FOR_EACH_BIT_WIDTH
struct A;

View File

@ -1,10 +0,0 @@
// MIR for `E::V::{constant#0}` 0 mir_map
E::V::{constant#0}: isize = {
let mut _0: isize; // return place in scope 0 at $DIR/unusual-item-types.rs:+0:9: +0:10
bb0: {
_0 = const 5_isize; // scope 0 at $DIR/unusual-item-types.rs:+0:9: +0:10
return; // scope 0 at $DIR/unusual-item-types.rs:+0:9: +0:10
}
}

View File

@ -1,12 +0,0 @@
// MIR for `Test::X` 0 mir_map
fn Test::X(_1: usize) -> Test {
let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:6
bb0: {
Deinit(_0); // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:6
((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:6
discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:6
return; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:6
}
}

View File

@ -1,39 +0,0 @@
// MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
bb0: {
goto -> bb6; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb1: {
return; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb2 (cleanup): {
resume; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb3: {
goto -> bb1; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb4 (cleanup): {
drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb2; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb5: {
drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
}
bb6: {
_2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
_3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
// mir::Constant
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
// + literal: Const { ty: for<'r> fn(&'r mut Vec<i32>) {<Vec<i32> as Drop>::drop}, val: Value(<ZST>) }
}
}

View File

@ -1,10 +0,0 @@
// MIR for `<impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT` 0 mir_map
const <impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT: i32 = {
let mut _0: i32; // return place in scope 0 at $DIR/unusual-item-types.rs:+0:32: +0:35
bb0: {
_0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:+0:38: +0:39
return; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:39
}
}

View File

@ -1,55 +0,0 @@
- // MIR for `change_loop_body` before ConstProp
+ // MIR for `change_loop_body` after ConstProp
fn change_loop_body() -> () {
let mut _0: (); // return place in scope 0 at $DIR/while_let_loops.rs:+0:27: +0:27
let mut _1: i32; // in scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15
let mut _2: (); // in scope 0 at $DIR/while_let_loops.rs:+0:1: +6:2
let mut _3: std::option::Option<u32>; // in scope 0 at $DIR/while_let_loops.rs:+2:28: +2:32
let mut _4: isize; // in scope 0 at $DIR/while_let_loops.rs:+2:15: +2:25
let mut _5: !; // in scope 0 at $DIR/while_let_loops.rs:+2:33: +5:6
let mut _6: !; // in scope 0 at $DIR/while_let_loops.rs:+2:5: +5:6
let _7: (); // in scope 0 at $DIR/while_let_loops.rs:+2:5: +5:6
let mut _8: !; // in scope 0 at $DIR/while_let_loops.rs:+2:5: +5:6
scope 1 {
debug _x => _1; // in scope 1 at $DIR/while_let_loops.rs:+1:9: +1:15
scope 2 {
}
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15
_1 = const 0_i32; // scope 0 at $DIR/while_let_loops.rs:+1:18: +1:19
StorageLive(_3); // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32
Deinit(_3); // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32
discriminant(_3) = 0; // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32
- _4 = discriminant(_3); // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
+ _4 = const 0_isize; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
+ switchInt(const 0_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
}
bb1: {
switchInt(((_3 as Some).0: u32)) -> [0_u32: bb2, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
}
bb2: {
_1 = const 1_i32; // scope 2 at $DIR/while_let_loops.rs:+3:9: +3:15
nop; // scope 2 at $DIR/while_let_loops.rs:+4:9: +4:14
goto -> bb4; // scope 2 at $DIR/while_let_loops.rs:+4:9: +4:14
}
bb3: {
StorageLive(_7); // scope 1 at $DIR/while_let_loops.rs:+2:5: +5:6
nop; // scope 1 at $DIR/while_let_loops.rs:+2:5: +5:6
StorageDead(_7); // scope 1 at $DIR/while_let_loops.rs:+5:5: +5:6
goto -> bb4; // scope 1 at no-location
}
bb4: {
StorageDead(_3); // scope 1 at $DIR/while_let_loops.rs:+5:5: +5:6
StorageDead(_1); // scope 0 at $DIR/while_let_loops.rs:+6:1: +6:2
return; // scope 0 at $DIR/while_let_loops.rs:+6:2: +6:2
}
}

View File

@ -1,17 +0,0 @@
// MIR for `change_loop_body` after PreCodegen
fn change_loop_body() -> () {
let mut _0: (); // return place in scope 0 at $DIR/while_let_loops.rs:+0:27: +0:27
let mut _1: i32; // in scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15
scope 1 {
debug _x => _1; // in scope 1 at $DIR/while_let_loops.rs:+1:9: +1:15
scope 2 {
}
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15
StorageDead(_1); // scope 0 at $DIR/while_let_loops.rs:+6:1: +6:2
return; // scope 0 at $DIR/while_let_loops.rs:+6:2: +6:2
}
}

View File

@ -1,6 +1,5 @@
// EMIT_MIR while_let_loops.change_loop_body.ConstProp.diff
// EMIT_MIR while_let_loops.change_loop_body.PreCodegen.after.mir
// EMIT_MIR_FOR_EACH_BIT_WIDTH
pub fn change_loop_body() {
let mut _x = 0;