rust/tests/mir-opt/matches_reduce_branches.foo...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.0 KiB
Diff
Raw Normal View History

- // MIR for `foo` before MatchBranchSimplification
+ // MIR for `foo` after MatchBranchSimplification
fn foo(_1: Option<()>) -> () {
2023-06-06 21:47:00 +08:00
debug bar => _1;
let mut _0: ();
let mut _2: bool;
let mut _3: isize;
+ let mut _4: isize;
bb0: {
2023-06-06 21:47:00 +08:00
StorageLive(_2);
_3 = discriminant(_1);
- switchInt(move _3) -> [0: bb2, otherwise: bb1];
+ StorageLive(_4);
+ _4 = move _3;
+ _2 = Eq(_4, const 0_isize);
+ StorageDead(_4);
+ switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
2023-06-06 21:47:00 +08:00
- _2 = const false;
+ _0 = ();
goto -> bb3;
}
bb2: {
- _2 = const true;
+ _0 = const ();
goto -> bb3;
}
bb3: {
- switchInt(move _2) -> [0: bb5, otherwise: bb4];
2021-03-17 09:32:53 +08:00
- }
-
2023-06-06 21:47:00 +08:00
- bb4: {
- _0 = ();
- goto -> bb6;
2021-03-17 09:32:53 +08:00
- }
-
2023-06-06 21:47:00 +08:00
- bb5: {
- _0 = const ();
- goto -> bb6;
- }
-
- bb6: {
2023-06-06 21:47:00 +08:00
StorageDead(_2);
return;
}
}