parent
15598a83db
commit
a6dccfeb23
22 changed files with 652 additions and 374 deletions
52
src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff
Normal file
52
src/test/mir-opt/const_goto.issue_77355_opt.ConstGoto.diff
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
- // MIR for `issue_77355_opt` before ConstGoto
|
||||
+ // MIR for `issue_77355_opt` after ConstGoto
|
||||
|
||||
fn issue_77355_opt(_1: Foo) -> u64 {
|
||||
debug num => _1; // in scope 0 at $DIR/const_goto.rs:11:20: 11:23
|
||||
let mut _0: u64; // return place in scope 0 at $DIR/const_goto.rs:11:33: 11:36
|
||||
- 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/const_goto.rs:12:22: 12:28
|
||||
+ let mut _2: isize; // in scope 0 at $DIR/const_goto.rs:12:22: 12:28
|
||||
|
||||
bb0: {
|
||||
- StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
- _3 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:12:22: 12:28
|
||||
- switchInt(move _3) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto.rs:12:22: 12:28
|
||||
+ _2 = discriminant(_1); // scope 0 at $DIR/const_goto.rs:12:22: 12:28
|
||||
+ switchInt(move _2) -> [1_isize: bb2, 2_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto.rs:12:22: 12:28
|
||||
}
|
||||
|
||||
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
|
||||
+ _0 = const 42_u64; // scope 0 at $DIR/const_goto.rs:12:53: 12:55
|
||||
+ goto -> bb3; // scope 0 at $DIR/const_goto.rs:12:5: 12:57
|
||||
}
|
||||
|
||||
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 $DIR/const_goto.rs:12:5: 12:57
|
||||
- }
|
||||
-
|
||||
- bb4: {
|
||||
_0 = const 23_u64; // scope 0 at $DIR/const_goto.rs:12:41: 12:43
|
||||
- goto -> bb6; // scope 0 at $DIR/const_goto.rs:12:5: 12:57
|
||||
+ goto -> bb3; // scope 0 at $DIR/const_goto.rs:12:5: 12:57
|
||||
}
|
||||
|
||||
- bb5: {
|
||||
- _0 = const 42_u64; // scope 0 at $DIR/const_goto.rs:12:53: 12:55
|
||||
- goto -> bb6; // scope 0 at $DIR/const_goto.rs:12:5: 12:57
|
||||
- }
|
||||
-
|
||||
- bb6: {
|
||||
- StorageDead(_2); // scope 0 at $DIR/const_goto.rs:12:56: 12:57
|
||||
+ bb3: {
|
||||
return; // scope 0 at $DIR/const_goto.rs:13:2: 13:2
|
||||
}
|
||||
}
|
||||
|
||||
16
src/test/mir-opt/const_goto.rs
Normal file
16
src/test/mir-opt/const_goto.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
pub enum Foo {
|
||||
A,
|
||||
B,
|
||||
C,
|
||||
D,
|
||||
E,
|
||||
F,
|
||||
}
|
||||
|
||||
// EMIT_MIR const_goto.issue_77355_opt.ConstGoto.diff
|
||||
fn issue_77355_opt(num: Foo) -> u64 {
|
||||
if matches!(num, Foo::B | Foo::C) { 23 } else { 42 }
|
||||
}
|
||||
fn main() {
|
||||
issue_77355_opt(Foo::A);
|
||||
}
|
||||
51
src/test/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff
Normal file
51
src/test/mir-opt/const_goto_const_eval_fail.f.ConstGoto.diff
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
- // MIR for `f` before ConstGoto
|
||||
+ // MIR for `f` after ConstGoto
|
||||
|
||||
fn f() -> u64 {
|
||||
let mut _0: u64; // return place in scope 0 at $DIR/const_goto_const_eval_fail.rs:6:44: 6:47
|
||||
let mut _1: bool; // in scope 0 at $DIR/const_goto_const_eval_fail.rs:7:11: 12:6
|
||||
let mut _2: i32; // in scope 0 at $DIR/const_goto_const_eval_fail.rs:8:15: 8:16
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/const_goto_const_eval_fail.rs:7:11: 12:6
|
||||
StorageLive(_2); // scope 0 at $DIR/const_goto_const_eval_fail.rs:8:15: 8:16
|
||||
_2 = const A; // scope 0 at $DIR/const_goto_const_eval_fail.rs:8:15: 8:16
|
||||
switchInt(_2) -> [1_i32: bb2, 2_i32: bb2, 3_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:9:13: 9:14
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_1 = const true; // scope 0 at $DIR/const_goto_const_eval_fail.rs:10:18: 10:22
|
||||
goto -> bb3; // scope 0 at $DIR/const_goto_const_eval_fail.rs:8:9: 11:10
|
||||
}
|
||||
|
||||
bb2: {
|
||||
_1 = const B; // scope 0 at $DIR/const_goto_const_eval_fail.rs:9:26: 9:27
|
||||
- goto -> bb3; // scope 0 at $DIR/const_goto_const_eval_fail.rs:8:9: 11:10
|
||||
+ switchInt(_1) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:13:9: 13:14
|
||||
}
|
||||
|
||||
bb3: {
|
||||
- switchInt(_1) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/const_goto_const_eval_fail.rs:13:9: 13:14
|
||||
- }
|
||||
-
|
||||
- bb4: {
|
||||
_0 = const 2_u64; // scope 0 at $DIR/const_goto_const_eval_fail.rs:14:17: 14:18
|
||||
- goto -> bb6; // scope 0 at $DIR/const_goto_const_eval_fail.rs:7:5: 15:6
|
||||
+ goto -> bb5; // scope 0 at $DIR/const_goto_const_eval_fail.rs:7:5: 15:6
|
||||
}
|
||||
|
||||
- bb5: {
|
||||
+ bb4: {
|
||||
_0 = const 1_u64; // scope 0 at $DIR/const_goto_const_eval_fail.rs:13:18: 13:19
|
||||
- goto -> bb6; // scope 0 at $DIR/const_goto_const_eval_fail.rs:7:5: 15:6
|
||||
+ goto -> bb5; // scope 0 at $DIR/const_goto_const_eval_fail.rs:7:5: 15:6
|
||||
}
|
||||
|
||||
- bb6: {
|
||||
+ bb5: {
|
||||
StorageDead(_2); // scope 0 at $DIR/const_goto_const_eval_fail.rs:16:1: 16:2
|
||||
StorageDead(_1); // scope 0 at $DIR/const_goto_const_eval_fail.rs:16:1: 16:2
|
||||
return; // scope 0 at $DIR/const_goto_const_eval_fail.rs:16:2: 16:2
|
||||
}
|
||||
}
|
||||
|
||||
16
src/test/mir-opt/const_goto_const_eval_fail.rs
Normal file
16
src/test/mir-opt/const_goto_const_eval_fail.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#![feature(min_const_generics)]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// If const eval fails, then don't crash
|
||||
// EMIT_MIR const_goto_const_eval_fail.f.ConstGoto.diff
|
||||
pub fn f<const A: i32, const B: bool>() -> u64 {
|
||||
match {
|
||||
match A {
|
||||
1 | 2 | 3 => B,
|
||||
_ => true,
|
||||
}
|
||||
} {
|
||||
false => 1,
|
||||
true => 2,
|
||||
}
|
||||
}
|
||||
|
|
@ -2,84 +2,84 @@
|
|||
+ // 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:12:8: 12:9
|
||||
let mut _0: (bool, bool, bool, bool); // return place in scope 0 at $DIR/matches_reduce_branches.rs:12:19: 12:43
|
||||
let _2: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:13:9: 13:10
|
||||
let _6: (); // in scope 0 at $DIR/matches_reduce_branches.rs:18:5: 33:6
|
||||
let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:35:6: 35:7
|
||||
let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:35:9: 35:10
|
||||
let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:35:12: 35:13
|
||||
let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:35:15: 35:16
|
||||
+ let mut _11: i32; // in scope 0 at $DIR/matches_reduce_branches.rs:19:9: 19:10
|
||||
debug i => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:13:8: 13:9
|
||||
let mut _0: (bool, bool, bool, bool); // return place in scope 0 at $DIR/matches_reduce_branches.rs:13:19: 13:43
|
||||
let _2: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
let _6: (); // in scope 0 at $DIR/matches_reduce_branches.rs:19:5: 34:6
|
||||
let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:36:6: 36:7
|
||||
let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:36:9: 36:10
|
||||
let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:36:12: 36:13
|
||||
let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:36:15: 36:16
|
||||
+ let mut _11: i32; // in scope 0 at $DIR/matches_reduce_branches.rs:20:9: 20:10
|
||||
scope 1 {
|
||||
debug a => _2; // in scope 1 at $DIR/matches_reduce_branches.rs:13:9: 13:10
|
||||
let _3: bool; // in scope 1 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
debug a => _2; // in scope 1 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
let _3: bool; // in scope 1 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
scope 2 {
|
||||
debug b => _3; // in scope 2 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
let _4: bool; // in scope 2 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
debug b => _3; // in scope 2 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
let _4: bool; // in scope 2 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
scope 3 {
|
||||
debug c => _4; // in scope 3 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
let _5: bool; // in scope 3 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
debug c => _4; // in scope 3 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
let _5: bool; // in scope 3 at $DIR/matches_reduce_branches.rs:17:9: 17:10
|
||||
scope 4 {
|
||||
debug d => _5; // in scope 4 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
debug d => _5; // in scope 4 at $DIR/matches_reduce_branches.rs:17:9: 17:10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:13:9: 13:10
|
||||
StorageLive(_3); // scope 1 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
StorageLive(_4); // scope 2 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
StorageLive(_5); // scope 3 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:18:5: 33:6
|
||||
- switchInt(_1) -> [7_i32: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:19:9: 19:10
|
||||
StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
StorageLive(_3); // scope 1 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
StorageLive(_4); // scope 2 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
StorageLive(_5); // scope 3 at $DIR/matches_reduce_branches.rs:17:9: 17:10
|
||||
StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:19:5: 34:6
|
||||
- switchInt(_1) -> [7_i32: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:20:9: 20:10
|
||||
- }
|
||||
-
|
||||
- bb1: {
|
||||
- _2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:27:13: 27:21
|
||||
- _3 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:28:13: 28:22
|
||||
- _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:29:13: 29:22
|
||||
- _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:30:13: 30:21
|
||||
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:18:5: 33:6
|
||||
- _2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:28:13: 28:21
|
||||
- _3 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:29:13: 29:22
|
||||
- _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:30:13: 30:22
|
||||
- _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:31:13: 31:21
|
||||
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:19:5: 34:6
|
||||
- }
|
||||
-
|
||||
- bb2: {
|
||||
- _2 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:20:13: 20:22
|
||||
- _3 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:21
|
||||
+ StorageLive(_11); // scope 4 at $DIR/matches_reduce_branches.rs:19:9: 19:10
|
||||
+ _11 = _1; // scope 4 at $DIR/matches_reduce_branches.rs:19:9: 19:10
|
||||
+ _2 = Ne(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:20:13: 20:22
|
||||
+ _3 = Eq(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:21
|
||||
_4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:22:13: 22:22
|
||||
_5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:23:13: 23:21
|
||||
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:18:5: 33:6
|
||||
- _2 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:22
|
||||
- _3 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:22:13: 22:21
|
||||
+ StorageLive(_11); // scope 4 at $DIR/matches_reduce_branches.rs:20:9: 20:10
|
||||
+ _11 = _1; // scope 4 at $DIR/matches_reduce_branches.rs:20:9: 20:10
|
||||
+ _2 = Ne(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:22
|
||||
+ _3 = Eq(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:22:13: 22:21
|
||||
_4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:23:13: 23:22
|
||||
_5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:24:13: 24:21
|
||||
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:19:5: 34:6
|
||||
- }
|
||||
-
|
||||
- bb3: {
|
||||
+ StorageDead(_11); // scope 4 at $DIR/matches_reduce_branches.rs:19:9: 19:10
|
||||
StorageDead(_6); // scope 4 at $DIR/matches_reduce_branches.rs:33:6: 33:7
|
||||
StorageLive(_7); // scope 4 at $DIR/matches_reduce_branches.rs:35:6: 35:7
|
||||
_7 = _2; // scope 4 at $DIR/matches_reduce_branches.rs:35:6: 35:7
|
||||
StorageLive(_8); // scope 4 at $DIR/matches_reduce_branches.rs:35:9: 35:10
|
||||
_8 = _3; // scope 4 at $DIR/matches_reduce_branches.rs:35:9: 35:10
|
||||
StorageLive(_9); // scope 4 at $DIR/matches_reduce_branches.rs:35:12: 35:13
|
||||
_9 = _4; // scope 4 at $DIR/matches_reduce_branches.rs:35:12: 35:13
|
||||
StorageLive(_10); // scope 4 at $DIR/matches_reduce_branches.rs:35:15: 35:16
|
||||
_10 = _5; // scope 4 at $DIR/matches_reduce_branches.rs:35:15: 35:16
|
||||
(_0.0: bool) = move _7; // scope 4 at $DIR/matches_reduce_branches.rs:35:5: 35:17
|
||||
(_0.1: bool) = move _8; // scope 4 at $DIR/matches_reduce_branches.rs:35:5: 35:17
|
||||
(_0.2: bool) = move _9; // scope 4 at $DIR/matches_reduce_branches.rs:35:5: 35:17
|
||||
(_0.3: bool) = move _10; // scope 4 at $DIR/matches_reduce_branches.rs:35:5: 35:17
|
||||
StorageDead(_10); // scope 4 at $DIR/matches_reduce_branches.rs:35:16: 35:17
|
||||
StorageDead(_9); // scope 4 at $DIR/matches_reduce_branches.rs:35:16: 35:17
|
||||
StorageDead(_8); // scope 4 at $DIR/matches_reduce_branches.rs:35:16: 35:17
|
||||
StorageDead(_7); // scope 4 at $DIR/matches_reduce_branches.rs:35:16: 35:17
|
||||
StorageDead(_5); // scope 3 at $DIR/matches_reduce_branches.rs:36:1: 36:2
|
||||
StorageDead(_4); // scope 2 at $DIR/matches_reduce_branches.rs:36:1: 36:2
|
||||
StorageDead(_3); // scope 1 at $DIR/matches_reduce_branches.rs:36:1: 36:2
|
||||
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:36:1: 36:2
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:36:2: 36:2
|
||||
+ StorageDead(_11); // scope 4 at $DIR/matches_reduce_branches.rs:20:9: 20:10
|
||||
StorageDead(_6); // scope 4 at $DIR/matches_reduce_branches.rs:34:6: 34:7
|
||||
StorageLive(_7); // scope 4 at $DIR/matches_reduce_branches.rs:36:6: 36:7
|
||||
_7 = _2; // scope 4 at $DIR/matches_reduce_branches.rs:36:6: 36:7
|
||||
StorageLive(_8); // scope 4 at $DIR/matches_reduce_branches.rs:36:9: 36:10
|
||||
_8 = _3; // scope 4 at $DIR/matches_reduce_branches.rs:36:9: 36:10
|
||||
StorageLive(_9); // scope 4 at $DIR/matches_reduce_branches.rs:36:12: 36:13
|
||||
_9 = _4; // scope 4 at $DIR/matches_reduce_branches.rs:36:12: 36:13
|
||||
StorageLive(_10); // scope 4 at $DIR/matches_reduce_branches.rs:36:15: 36:16
|
||||
_10 = _5; // scope 4 at $DIR/matches_reduce_branches.rs:36:15: 36:16
|
||||
(_0.0: bool) = move _7; // scope 4 at $DIR/matches_reduce_branches.rs:36:5: 36:17
|
||||
(_0.1: bool) = move _8; // scope 4 at $DIR/matches_reduce_branches.rs:36:5: 36:17
|
||||
(_0.2: bool) = move _9; // scope 4 at $DIR/matches_reduce_branches.rs:36:5: 36:17
|
||||
(_0.3: bool) = move _10; // scope 4 at $DIR/matches_reduce_branches.rs:36:5: 36:17
|
||||
StorageDead(_10); // scope 4 at $DIR/matches_reduce_branches.rs:36:16: 36:17
|
||||
StorageDead(_9); // scope 4 at $DIR/matches_reduce_branches.rs:36:16: 36:17
|
||||
StorageDead(_8); // scope 4 at $DIR/matches_reduce_branches.rs:36:16: 36:17
|
||||
StorageDead(_7); // scope 4 at $DIR/matches_reduce_branches.rs:36:16: 36:17
|
||||
StorageDead(_5); // scope 3 at $DIR/matches_reduce_branches.rs:37:1: 37:2
|
||||
StorageDead(_4); // scope 2 at $DIR/matches_reduce_branches.rs:37:1: 37:2
|
||||
StorageDead(_3); // scope 1 at $DIR/matches_reduce_branches.rs:37:1: 37:2
|
||||
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:37:1: 37:2
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:37:2: 37:2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,84 +2,84 @@
|
|||
+ // 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:12:8: 12:9
|
||||
let mut _0: (bool, bool, bool, bool); // return place in scope 0 at $DIR/matches_reduce_branches.rs:12:19: 12:43
|
||||
let _2: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:13:9: 13:10
|
||||
let _6: (); // in scope 0 at $DIR/matches_reduce_branches.rs:18:5: 33:6
|
||||
let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:35:6: 35:7
|
||||
let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:35:9: 35:10
|
||||
let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:35:12: 35:13
|
||||
let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:35:15: 35:16
|
||||
+ let mut _11: i32; // in scope 0 at $DIR/matches_reduce_branches.rs:19:9: 19:10
|
||||
debug i => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:13:8: 13:9
|
||||
let mut _0: (bool, bool, bool, bool); // return place in scope 0 at $DIR/matches_reduce_branches.rs:13:19: 13:43
|
||||
let _2: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
let _6: (); // in scope 0 at $DIR/matches_reduce_branches.rs:19:5: 34:6
|
||||
let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:36:6: 36:7
|
||||
let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:36:9: 36:10
|
||||
let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:36:12: 36:13
|
||||
let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:36:15: 36:16
|
||||
+ let mut _11: i32; // in scope 0 at $DIR/matches_reduce_branches.rs:20:9: 20:10
|
||||
scope 1 {
|
||||
debug a => _2; // in scope 1 at $DIR/matches_reduce_branches.rs:13:9: 13:10
|
||||
let _3: bool; // in scope 1 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
debug a => _2; // in scope 1 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
let _3: bool; // in scope 1 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
scope 2 {
|
||||
debug b => _3; // in scope 2 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
let _4: bool; // in scope 2 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
debug b => _3; // in scope 2 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
let _4: bool; // in scope 2 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
scope 3 {
|
||||
debug c => _4; // in scope 3 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
let _5: bool; // in scope 3 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
debug c => _4; // in scope 3 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
let _5: bool; // in scope 3 at $DIR/matches_reduce_branches.rs:17:9: 17:10
|
||||
scope 4 {
|
||||
debug d => _5; // in scope 4 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
debug d => _5; // in scope 4 at $DIR/matches_reduce_branches.rs:17:9: 17:10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:13:9: 13:10
|
||||
StorageLive(_3); // scope 1 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
StorageLive(_4); // scope 2 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
StorageLive(_5); // scope 3 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:18:5: 33:6
|
||||
- switchInt(_1) -> [7_i32: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:19:9: 19:10
|
||||
StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:14:9: 14:10
|
||||
StorageLive(_3); // scope 1 at $DIR/matches_reduce_branches.rs:15:9: 15:10
|
||||
StorageLive(_4); // scope 2 at $DIR/matches_reduce_branches.rs:16:9: 16:10
|
||||
StorageLive(_5); // scope 3 at $DIR/matches_reduce_branches.rs:17:9: 17:10
|
||||
StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:19:5: 34:6
|
||||
- switchInt(_1) -> [7_i32: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:20:9: 20:10
|
||||
- }
|
||||
-
|
||||
- bb1: {
|
||||
- _2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:27:13: 27:21
|
||||
- _3 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:28:13: 28:22
|
||||
- _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:29:13: 29:22
|
||||
- _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:30:13: 30:21
|
||||
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:18:5: 33:6
|
||||
- _2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:28:13: 28:21
|
||||
- _3 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:29:13: 29:22
|
||||
- _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:30:13: 30:22
|
||||
- _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:31:13: 31:21
|
||||
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:19:5: 34:6
|
||||
- }
|
||||
-
|
||||
- bb2: {
|
||||
- _2 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:20:13: 20:22
|
||||
- _3 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:21
|
||||
+ StorageLive(_11); // scope 4 at $DIR/matches_reduce_branches.rs:19:9: 19:10
|
||||
+ _11 = _1; // scope 4 at $DIR/matches_reduce_branches.rs:19:9: 19:10
|
||||
+ _2 = Ne(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:20:13: 20:22
|
||||
+ _3 = Eq(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:21
|
||||
_4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:22:13: 22:22
|
||||
_5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:23:13: 23:21
|
||||
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:18:5: 33:6
|
||||
- _2 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:22
|
||||
- _3 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:22:13: 22:21
|
||||
+ StorageLive(_11); // scope 4 at $DIR/matches_reduce_branches.rs:20:9: 20:10
|
||||
+ _11 = _1; // scope 4 at $DIR/matches_reduce_branches.rs:20:9: 20:10
|
||||
+ _2 = Ne(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:22
|
||||
+ _3 = Eq(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:22:13: 22:21
|
||||
_4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:23:13: 23:22
|
||||
_5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:24:13: 24:21
|
||||
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:19:5: 34:6
|
||||
- }
|
||||
-
|
||||
- bb3: {
|
||||
+ StorageDead(_11); // scope 4 at $DIR/matches_reduce_branches.rs:19:9: 19:10
|
||||
StorageDead(_6); // scope 4 at $DIR/matches_reduce_branches.rs:33:6: 33:7
|
||||
StorageLive(_7); // scope 4 at $DIR/matches_reduce_branches.rs:35:6: 35:7
|
||||
_7 = _2; // scope 4 at $DIR/matches_reduce_branches.rs:35:6: 35:7
|
||||
StorageLive(_8); // scope 4 at $DIR/matches_reduce_branches.rs:35:9: 35:10
|
||||
_8 = _3; // scope 4 at $DIR/matches_reduce_branches.rs:35:9: 35:10
|
||||
StorageLive(_9); // scope 4 at $DIR/matches_reduce_branches.rs:35:12: 35:13
|
||||
_9 = _4; // scope 4 at $DIR/matches_reduce_branches.rs:35:12: 35:13
|
||||
StorageLive(_10); // scope 4 at $DIR/matches_reduce_branches.rs:35:15: 35:16
|
||||
_10 = _5; // scope 4 at $DIR/matches_reduce_branches.rs:35:15: 35:16
|
||||
(_0.0: bool) = move _7; // scope 4 at $DIR/matches_reduce_branches.rs:35:5: 35:17
|
||||
(_0.1: bool) = move _8; // scope 4 at $DIR/matches_reduce_branches.rs:35:5: 35:17
|
||||
(_0.2: bool) = move _9; // scope 4 at $DIR/matches_reduce_branches.rs:35:5: 35:17
|
||||
(_0.3: bool) = move _10; // scope 4 at $DIR/matches_reduce_branches.rs:35:5: 35:17
|
||||
StorageDead(_10); // scope 4 at $DIR/matches_reduce_branches.rs:35:16: 35:17
|
||||
StorageDead(_9); // scope 4 at $DIR/matches_reduce_branches.rs:35:16: 35:17
|
||||
StorageDead(_8); // scope 4 at $DIR/matches_reduce_branches.rs:35:16: 35:17
|
||||
StorageDead(_7); // scope 4 at $DIR/matches_reduce_branches.rs:35:16: 35:17
|
||||
StorageDead(_5); // scope 3 at $DIR/matches_reduce_branches.rs:36:1: 36:2
|
||||
StorageDead(_4); // scope 2 at $DIR/matches_reduce_branches.rs:36:1: 36:2
|
||||
StorageDead(_3); // scope 1 at $DIR/matches_reduce_branches.rs:36:1: 36:2
|
||||
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:36:1: 36:2
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:36:2: 36:2
|
||||
+ StorageDead(_11); // scope 4 at $DIR/matches_reduce_branches.rs:20:9: 20:10
|
||||
StorageDead(_6); // scope 4 at $DIR/matches_reduce_branches.rs:34:6: 34:7
|
||||
StorageLive(_7); // scope 4 at $DIR/matches_reduce_branches.rs:36:6: 36:7
|
||||
_7 = _2; // scope 4 at $DIR/matches_reduce_branches.rs:36:6: 36:7
|
||||
StorageLive(_8); // scope 4 at $DIR/matches_reduce_branches.rs:36:9: 36:10
|
||||
_8 = _3; // scope 4 at $DIR/matches_reduce_branches.rs:36:9: 36:10
|
||||
StorageLive(_9); // scope 4 at $DIR/matches_reduce_branches.rs:36:12: 36:13
|
||||
_9 = _4; // scope 4 at $DIR/matches_reduce_branches.rs:36:12: 36:13
|
||||
StorageLive(_10); // scope 4 at $DIR/matches_reduce_branches.rs:36:15: 36:16
|
||||
_10 = _5; // scope 4 at $DIR/matches_reduce_branches.rs:36:15: 36:16
|
||||
(_0.0: bool) = move _7; // scope 4 at $DIR/matches_reduce_branches.rs:36:5: 36:17
|
||||
(_0.1: bool) = move _8; // scope 4 at $DIR/matches_reduce_branches.rs:36:5: 36:17
|
||||
(_0.2: bool) = move _9; // scope 4 at $DIR/matches_reduce_branches.rs:36:5: 36:17
|
||||
(_0.3: bool) = move _10; // scope 4 at $DIR/matches_reduce_branches.rs:36:5: 36:17
|
||||
StorageDead(_10); // scope 4 at $DIR/matches_reduce_branches.rs:36:16: 36:17
|
||||
StorageDead(_9); // scope 4 at $DIR/matches_reduce_branches.rs:36:16: 36:17
|
||||
StorageDead(_8); // scope 4 at $DIR/matches_reduce_branches.rs:36:16: 36:17
|
||||
StorageDead(_7); // scope 4 at $DIR/matches_reduce_branches.rs:36:16: 36:17
|
||||
StorageDead(_5); // scope 3 at $DIR/matches_reduce_branches.rs:37:1: 37:2
|
||||
StorageDead(_4); // scope 2 at $DIR/matches_reduce_branches.rs:37:1: 37:2
|
||||
StorageDead(_3); // scope 1 at $DIR/matches_reduce_branches.rs:37:1: 37:2
|
||||
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:37:1: 37:2
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:37:2: 37:2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,47 +2,26 @@
|
|||
+ // MIR for `foo` after MatchBranchSimplification
|
||||
|
||||
fn foo(_1: Option<()>) -> () {
|
||||
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:6:8: 6:11
|
||||
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:6:25: 6: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:7:22: 7:26
|
||||
+ let mut _4: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:7:22: 7:26
|
||||
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:7:8: 7:11
|
||||
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:7:25: 7:25
|
||||
let mut _2: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
|
||||
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:7:22: 7:26
|
||||
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:7:22: 7:26
|
||||
+ StorageLive(_4); // scope 0 at $DIR/matches_reduce_branches.rs:7:22: 7:26
|
||||
+ _4 = move _3; // scope 0 at $DIR/matches_reduce_branches.rs:7:22: 7:26
|
||||
+ _2 = Eq(_4, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
+ StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:7:22: 7:26
|
||||
+ switchInt(move _2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6
|
||||
_2 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
}
|
||||
|
||||
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: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6
|
||||
- }
|
||||
-
|
||||
- bb4: {
|
||||
_0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:9:6: 9:6
|
||||
- goto -> bb5; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6
|
||||
+ goto -> bb2; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6
|
||||
_0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:10:6: 10:6
|
||||
goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:8:5: 10:6
|
||||
}
|
||||
|
||||
- bb5: {
|
||||
+ bb2: {
|
||||
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:9:5: 9:6
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:10:2: 10:2
|
||||
bb2: {
|
||||
goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
}
|
||||
|
||||
bb3: {
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:11:2: 11:2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,47 +2,26 @@
|
|||
+ // MIR for `foo` after MatchBranchSimplification
|
||||
|
||||
fn foo(_1: Option<()>) -> () {
|
||||
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:6:8: 6:11
|
||||
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:6:25: 6: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:7:22: 7:26
|
||||
+ let mut _4: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:7:22: 7:26
|
||||
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:7:8: 7:11
|
||||
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:7:25: 7:25
|
||||
let mut _2: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
|
||||
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:7:22: 7:26
|
||||
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:7:22: 7:26
|
||||
+ StorageLive(_4); // scope 0 at $DIR/matches_reduce_branches.rs:7:22: 7:26
|
||||
+ _4 = move _3; // scope 0 at $DIR/matches_reduce_branches.rs:7:22: 7:26
|
||||
+ _2 = Eq(_4, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
+ StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:7:22: 7:26
|
||||
+ switchInt(move _2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6
|
||||
_2 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
}
|
||||
|
||||
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: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6
|
||||
- }
|
||||
-
|
||||
- bb4: {
|
||||
_0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:9:6: 9:6
|
||||
- goto -> bb5; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6
|
||||
+ goto -> bb2; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6
|
||||
_0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:10:6: 10:6
|
||||
goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:8:5: 10:6
|
||||
}
|
||||
|
||||
- bb5: {
|
||||
+ bb2: {
|
||||
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:9:5: 9:6
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:10:2: 10:2
|
||||
bb2: {
|
||||
goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
}
|
||||
|
||||
bb3: {
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:11:2: 11:2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
// MIR for `foo` before PreCodegen
|
||||
|
||||
fn foo(_1: Option<()>) -> () {
|
||||
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:7:8: 7:11
|
||||
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:7:25: 7:25
|
||||
let mut _2: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
|
||||
bb0: {
|
||||
_2 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:10:6: 10:6
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:8:5: 10:6
|
||||
}
|
||||
|
||||
bb2: {
|
||||
return; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
// MIR for `foo` before PreCodegen
|
||||
|
||||
fn foo(_1: Option<()>) -> () {
|
||||
debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:7:8: 7:11
|
||||
let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:7:25: 7:25
|
||||
let mut _2: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
|
||||
bb0: {
|
||||
_2 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:8:22: 8:26
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:10:6: 10:6
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:8:5: 10:6
|
||||
}
|
||||
|
||||
bb2: {
|
||||
return; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
}
|
||||
}
|
||||
|
|
@ -2,110 +2,110 @@
|
|||
+ // 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:38:25: 38:29
|
||||
let _1: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:39:9: 39:12
|
||||
let mut _2: (); // in scope 0 at $DIR/matches_reduce_branches.rs:39:21: 39:23
|
||||
let mut _3: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
let mut _4: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
let mut _5: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
let mut _6: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28
|
||||
+ let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
+ let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
+ let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
let mut _0: bool; // return place in scope 0 at $DIR/matches_reduce_branches.rs:39:25: 39:29
|
||||
let _1: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:9: 40:12
|
||||
let mut _2: (); // in scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:23
|
||||
let mut _3: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
let mut _4: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
let mut _5: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
let mut _6: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28
|
||||
+ let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
+ let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
+ let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
+ let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
scope 1 {
|
||||
debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:39:9: 39:12
|
||||
debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:40:9: 40:12
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:39:9: 39:12
|
||||
StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:39:21: 39:23
|
||||
StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
StorageLive(_4); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28
|
||||
_6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28
|
||||
- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:40:9: 40:12
|
||||
StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:23
|
||||
StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
StorageLive(_4); // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28
|
||||
_6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28
|
||||
- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
- }
|
||||
-
|
||||
- bb1: {
|
||||
- _5 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:30: 40:34
|
||||
- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
- _5 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:41:31: 41:35
|
||||
- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
- }
|
||||
-
|
||||
- bb2: {
|
||||
- _5 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:42: 40:47
|
||||
- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
- _5 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:41:45: 41:50
|
||||
- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
- }
|
||||
-
|
||||
- bb3: {
|
||||
+ StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
+ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
+ _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:42: 40:47
|
||||
+ StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:47: 40:48
|
||||
- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
+ StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
+ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
+ _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:41:45: 41:50
|
||||
+ StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:41:51: 41:52
|
||||
- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
- }
|
||||
-
|
||||
- bb4: {
|
||||
- _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:50: 40:54
|
||||
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
- _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:41:55: 41:59
|
||||
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
- }
|
||||
-
|
||||
- bb5: {
|
||||
- _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67
|
||||
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
- _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:41:69: 41:74
|
||||
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
- }
|
||||
-
|
||||
- bb6: {
|
||||
+ StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
+ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
+ _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67
|
||||
+ StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:67: 40:68
|
||||
- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
+ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
+ _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:41:69: 41:74
|
||||
+ StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:41:75: 41:76
|
||||
- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
- }
|
||||
-
|
||||
- bb7: {
|
||||
- _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:70: 40:74
|
||||
- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
- _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:42:13: 42:17
|
||||
- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
- }
|
||||
-
|
||||
- bb8: {
|
||||
- _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87
|
||||
- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
- _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:44:13: 44:18
|
||||
- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
- }
|
||||
-
|
||||
- bb9: {
|
||||
+ StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87
|
||||
+ StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:40:87: 40:88
|
||||
- switchInt(move _3) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
+ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
+ _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:44:13: 44:18
|
||||
+ StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:45:9: 45:10
|
||||
- switchInt(move _3) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
- }
|
||||
-
|
||||
- bb10: {
|
||||
+ StorageLive(_10); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ _10 = move _3; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:40:95: 40:96
|
||||
- _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:92: 40:96
|
||||
- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:39:15: 42:6
|
||||
+ StorageLive(_10); // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
+ _10 = move _3; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:48:9: 48:10
|
||||
- _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:47:13: 47:17
|
||||
- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 50:6
|
||||
- }
|
||||
-
|
||||
- bb11: {
|
||||
- StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:40:95: 40:96
|
||||
- _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:41:14: 41:19
|
||||
- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:39:15: 42:6
|
||||
- StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:48:9: 48:10
|
||||
- _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:49:14: 49:19
|
||||
- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 50:6
|
||||
- }
|
||||
-
|
||||
- bb12: {
|
||||
+ _1 = Ne(_10, const false); // scope 0 at $DIR/matches_reduce_branches.rs:41:14: 41:19
|
||||
+ StorageDead(_10); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:42:6: 42:7
|
||||
_0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:43:5: 43:8
|
||||
StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:44:1: 44:2
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:44:2: 44:2
|
||||
+ _1 = Ne(_10, const false); // scope 0 at $DIR/matches_reduce_branches.rs:49:14: 49:19
|
||||
+ StorageDead(_10); // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:50:6: 50:7
|
||||
_0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:51:5: 51:8
|
||||
StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:52:1: 52:2
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:52:2: 52:2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,110 +2,110 @@
|
|||
+ // 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:38:25: 38:29
|
||||
let _1: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:39:9: 39:12
|
||||
let mut _2: (); // in scope 0 at $DIR/matches_reduce_branches.rs:39:21: 39:23
|
||||
let mut _3: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
let mut _4: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
let mut _5: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
let mut _6: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28
|
||||
+ let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
+ let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
+ let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
let mut _0: bool; // return place in scope 0 at $DIR/matches_reduce_branches.rs:39:25: 39:29
|
||||
let _1: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:40:9: 40:12
|
||||
let mut _2: (); // in scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:23
|
||||
let mut _3: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
let mut _4: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
let mut _5: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
let mut _6: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28
|
||||
+ let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
+ let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
+ let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
+ let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
scope 1 {
|
||||
debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:39:9: 39:12
|
||||
debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:40:9: 40:12
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:39:9: 39:12
|
||||
StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:39:21: 39:23
|
||||
StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
StorageLive(_4); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28
|
||||
_6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28
|
||||
- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:40:9: 40:12
|
||||
StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:23
|
||||
StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
StorageLive(_4); // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28
|
||||
_6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:41:24: 41:28
|
||||
- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
- }
|
||||
-
|
||||
- bb1: {
|
||||
- _5 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:30: 40:34
|
||||
- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
- _5 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:41:31: 41:35
|
||||
- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
- }
|
||||
-
|
||||
- bb2: {
|
||||
- _5 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:42: 40:47
|
||||
- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
- _5 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:41:45: 41:50
|
||||
- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
- }
|
||||
-
|
||||
- bb3: {
|
||||
+ StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
+ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
+ _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:42: 40:47
|
||||
+ StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48
|
||||
StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:47: 40:48
|
||||
- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
+ StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
+ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
+ _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:41:45: 41:50
|
||||
+ StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:41:21: 41:52
|
||||
StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:41:51: 41:52
|
||||
- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
- }
|
||||
-
|
||||
- bb4: {
|
||||
- _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:50: 40:54
|
||||
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
- _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:41:55: 41:59
|
||||
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
- }
|
||||
-
|
||||
- bb5: {
|
||||
- _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67
|
||||
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
- _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:41:69: 41:74
|
||||
- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
- }
|
||||
-
|
||||
- bb6: {
|
||||
+ StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
+ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
+ _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67
|
||||
+ StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68
|
||||
StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:67: 40:68
|
||||
- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
+ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
+ _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:41:69: 41:74
|
||||
+ StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:41:18: 41:76
|
||||
StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:41:75: 41:76
|
||||
- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
- }
|
||||
-
|
||||
- bb7: {
|
||||
- _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:70: 40:74
|
||||
- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
- _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:42:13: 42:17
|
||||
- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
- }
|
||||
-
|
||||
- bb8: {
|
||||
- _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87
|
||||
- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
- _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:44:13: 44:18
|
||||
- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
- }
|
||||
-
|
||||
- bb9: {
|
||||
+ StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87
|
||||
+ StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:40:87: 40:88
|
||||
- switchInt(move _3) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
+ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
+ _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:44:13: 44:18
|
||||
+ StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:45:9: 45:10
|
||||
- switchInt(move _3) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
- }
|
||||
-
|
||||
- bb10: {
|
||||
+ StorageLive(_10); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
+ _10 = move _3; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:40:95: 40:96
|
||||
- _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:92: 40:96
|
||||
- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:39:15: 42:6
|
||||
+ StorageLive(_10); // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
+ _10 = move _3; // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:48:9: 48:10
|
||||
- _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:47:13: 47:17
|
||||
- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 50:6
|
||||
- }
|
||||
-
|
||||
- bb11: {
|
||||
- StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:40:95: 40:96
|
||||
- _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:41:14: 41:19
|
||||
- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:39:15: 42:6
|
||||
- StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:48:9: 48:10
|
||||
- _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:49:14: 49:19
|
||||
- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 50:6
|
||||
- }
|
||||
-
|
||||
- bb12: {
|
||||
+ _1 = Ne(_10, const false); // scope 0 at $DIR/matches_reduce_branches.rs:41:14: 41:19
|
||||
+ StorageDead(_10); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88
|
||||
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:42:6: 42:7
|
||||
_0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:43:5: 43:8
|
||||
StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:44:1: 44:2
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:44:2: 44:2
|
||||
+ _1 = Ne(_10, const false); // scope 0 at $DIR/matches_reduce_branches.rs:49:14: 49:19
|
||||
+ StorageDead(_10); // scope 0 at $DIR/matches_reduce_branches.rs:41:15: 45:10
|
||||
StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:50:6: 50:7
|
||||
_0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:51:5: 51:8
|
||||
StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:52:1: 52:2
|
||||
return; // scope 0 at $DIR/matches_reduce_branches.rs:52:2: 52:2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
// EMIT_MIR matches_reduce_branches.foo.MatchBranchSimplification.diff
|
||||
// EMIT_MIR matches_reduce_branches.foo.PreCodegen.before.mir
|
||||
// EMIT_MIR matches_reduce_branches.bar.MatchBranchSimplification.diff
|
||||
// EMIT_MIR matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff
|
||||
|
||||
fn foo(bar: Option<()>) {
|
||||
if matches!(bar, None) {
|
||||
()
|
||||
()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -37,15 +38,22 @@ fn bar(i: i32) -> (bool, bool, bool, bool) {
|
|||
|
||||
fn match_nested_if() -> bool {
|
||||
let val = match () {
|
||||
() if if if if true {true} else {false} {true} else {false} {true} else {false} => true,
|
||||
() if if if if true { true } else { false } { true } else { false } {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
} =>
|
||||
{
|
||||
true
|
||||
}
|
||||
_ => false,
|
||||
};
|
||||
val
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _ = foo(None);
|
||||
let _ = foo(Some(()));
|
||||
let _ = bar(0);
|
||||
let _ = match_nested_if();
|
||||
let _ = foo(None);
|
||||
let _ = foo(Some(()));
|
||||
let _ = bar(0);
|
||||
let _ = match_nested_if();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,50 +1,34 @@
|
|||
- // MIR for `opt` before InstCombine
|
||||
+ // MIR for `opt` after InstCombine
|
||||
|
||||
fn opt(_1: Option<()>) -> bool {
|
||||
fn opt(_1: bool) -> u32 {
|
||||
debug x => _1; // in scope 0 at $DIR/not_equal_false.rs:3:8: 3:9
|
||||
let mut _0: bool; // return place in scope 0 at $DIR/not_equal_false.rs:3:26: 3:30
|
||||
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/not_equal_false.rs:4:17: 4:21
|
||||
let mut _4: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
let mut _5: isize; // in scope 0 at $DIR/not_equal_false.rs:4:38: 4:45
|
||||
let mut _6: isize; // in scope 0 at $DIR/not_equal_false.rs:4:17: 4:21
|
||||
let mut _7: isize; // in scope 0 at $DIR/not_equal_false.rs:4:38: 4:45
|
||||
let mut _8: bool; // in scope 0 at $DIR/not_equal_false.rs:4:5: 4:46
|
||||
let mut _0: u32; // return place in scope 0 at $DIR/not_equal_false.rs:3:20: 3:23
|
||||
let mut _2: bool; // in scope 0 at $DIR/not_equal_false.rs:4:8: 4:18
|
||||
let mut _3: bool; // in scope 0 at $DIR/not_equal_false.rs:4:8: 4:9
|
||||
|
||||
bb0: {
|
||||
StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_3 = discriminant(_1); // scope 0 at $DIR/not_equal_false.rs:4:17: 4:21
|
||||
StorageLive(_6); // scope 0 at $DIR/not_equal_false.rs:4:17: 4:21
|
||||
_6 = move _3; // scope 0 at $DIR/not_equal_false.rs:4:17: 4:21
|
||||
_2 = Eq(_6, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_6); // scope 0 at $DIR/not_equal_false.rs:4:17: 4:21
|
||||
switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46
|
||||
StorageLive(_2); // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18
|
||||
StorageLive(_3); // scope 0 at $DIR/not_equal_false.rs:4:8: 4:9
|
||||
_3 = _1; // scope 0 at $DIR/not_equal_false.rs:4:8: 4:9
|
||||
- _2 = Ne(move _3, const false); // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18
|
||||
+ _2 = move _3; // scope 0 at $DIR/not_equal_false.rs:4:8: 4:18
|
||||
StorageDead(_3); // scope 0 at $DIR/not_equal_false.rs:4:17: 4:18
|
||||
switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:35
|
||||
}
|
||||
|
||||
bb1: {
|
||||
_0 = const true; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46
|
||||
goto -> bb3; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46
|
||||
_0 = const 0_u32; // scope 0 at $DIR/not_equal_false.rs:4:21: 4:22
|
||||
goto -> bb3; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:35
|
||||
}
|
||||
|
||||
bb2: {
|
||||
StorageLive(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
_5 = discriminant(_1); // scope 0 at $DIR/not_equal_false.rs:4:38: 4:45
|
||||
StorageLive(_7); // scope 0 at $DIR/not_equal_false.rs:4:38: 4:45
|
||||
_7 = move _5; // scope 0 at $DIR/not_equal_false.rs:4:38: 4:45
|
||||
_4 = Eq(_7, const 1_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
||||
StorageDead(_7); // scope 0 at $DIR/not_equal_false.rs:4:38: 4:45
|
||||
StorageLive(_8); // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46
|
||||
_8 = move _4; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46
|
||||
- _0 = Ne(_8, const false); // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46
|
||||
+ _0 = _8; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46
|
||||
StorageDead(_8); // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46
|
||||
goto -> bb3; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:46
|
||||
_0 = const 1_u32; // scope 0 at $DIR/not_equal_false.rs:4:32: 4:33
|
||||
goto -> bb3; // scope 0 at $DIR/not_equal_false.rs:4:5: 4:35
|
||||
}
|
||||
|
||||
bb3: {
|
||||
StorageDead(_4); // scope 0 at $DIR/not_equal_false.rs:4:45: 4:46
|
||||
StorageDead(_2); // scope 0 at $DIR/not_equal_false.rs:4:45: 4:46
|
||||
StorageDead(_2); // scope 0 at $DIR/not_equal_false.rs:4:34: 4:35
|
||||
return; // scope 0 at $DIR/not_equal_false.rs:5:2: 5:2
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
// EMIT_MIR not_equal_false.opt.InstCombine.diff
|
||||
|
||||
fn opt(x: Option<()>) -> bool {
|
||||
matches!(x, None) || matches!(x, Some(_))
|
||||
fn opt(x: bool) -> u32 {
|
||||
if x != false { 0 } else { 1 }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
opt(None);
|
||||
opt(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue