Skip to content

Commit 6204a51

Browse files
committed
Update matches_reduce_branches.rs
1 parent bf3c6c5 commit 6204a51

10 files changed

+486
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
- // MIR for `match_i128_u128` before MatchBranchSimplification
2+
+ // MIR for `match_i128_u128` after MatchBranchSimplification
3+
4+
fn match_i128_u128(_1: EnumAi128) -> u128 {
5+
debug i => _1;
6+
let mut _0: u128;
7+
let mut _2: i128;
8+
9+
bb0: {
10+
_2 = discriminant(_1);
11+
switchInt(move _2) -> [1: bb3, 2: bb4, 3: bb5, 340282366920938463463374607431768211455: bb1, otherwise: bb2];
12+
}
13+
14+
bb1: {
15+
_0 = const _;
16+
goto -> bb6;
17+
}
18+
19+
bb2: {
20+
unreachable;
21+
}
22+
23+
bb3: {
24+
_0 = const 1_u128;
25+
goto -> bb6;
26+
}
27+
28+
bb4: {
29+
_0 = const 2_u128;
30+
goto -> bb6;
31+
}
32+
33+
bb5: {
34+
_0 = const 3_u128;
35+
goto -> bb6;
36+
}
37+
38+
bb6: {
39+
return;
40+
}
41+
}
42+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
- // MIR for `match_i16_i8` before MatchBranchSimplification
2+
+ // MIR for `match_i16_i8` after MatchBranchSimplification
3+
4+
fn match_i16_i8(_1: EnumAi16) -> i8 {
5+
debug i => _1;
6+
let mut _0: i8;
7+
let mut _2: i16;
8+
9+
bb0: {
10+
_2 = discriminant(_1);
11+
switchInt(move _2) -> [65535: bb3, 2: bb4, 65533: bb1, otherwise: bb2];
12+
}
13+
14+
bb1: {
15+
_0 = const -3_i8;
16+
goto -> bb5;
17+
}
18+
19+
bb2: {
20+
unreachable;
21+
}
22+
23+
bb3: {
24+
_0 = const -1_i8;
25+
goto -> bb5;
26+
}
27+
28+
bb4: {
29+
_0 = const 2_i8;
30+
goto -> bb5;
31+
}
32+
33+
bb5: {
34+
return;
35+
}
36+
}
37+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
- // MIR for `match_i8_i16` before MatchBranchSimplification
2+
+ // MIR for `match_i8_i16` after MatchBranchSimplification
3+
4+
fn match_i8_i16(_1: EnumAi8) -> i16 {
5+
debug i => _1;
6+
let mut _0: i16;
7+
let mut _2: i8;
8+
9+
bb0: {
10+
_2 = discriminant(_1);
11+
switchInt(move _2) -> [255: bb3, 2: bb4, 253: bb1, otherwise: bb2];
12+
}
13+
14+
bb1: {
15+
_0 = const -3_i16;
16+
goto -> bb5;
17+
}
18+
19+
bb2: {
20+
unreachable;
21+
}
22+
23+
bb3: {
24+
_0 = const -1_i16;
25+
goto -> bb5;
26+
}
27+
28+
bb4: {
29+
_0 = const 2_i16;
30+
goto -> bb5;
31+
}
32+
33+
bb5: {
34+
return;
35+
}
36+
}
37+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
- // MIR for `match_i8_i16_failed` before MatchBranchSimplification
2+
+ // MIR for `match_i8_i16_failed` after MatchBranchSimplification
3+
4+
fn match_i8_i16_failed(_1: EnumAi8) -> i16 {
5+
debug i => _1;
6+
let mut _0: i16;
7+
let mut _2: i8;
8+
9+
bb0: {
10+
_2 = discriminant(_1);
11+
switchInt(move _2) -> [255: bb3, 2: bb4, 253: bb1, otherwise: bb2];
12+
}
13+
14+
bb1: {
15+
_0 = const 3_i16;
16+
goto -> bb5;
17+
}
18+
19+
bb2: {
20+
unreachable;
21+
}
22+
23+
bb3: {
24+
_0 = const -1_i16;
25+
goto -> bb5;
26+
}
27+
28+
bb4: {
29+
_0 = const 2_i16;
30+
goto -> bb5;
31+
}
32+
33+
bb5: {
34+
return;
35+
}
36+
}
37+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
- // MIR for `match_u8_i16` before MatchBranchSimplification
2+
+ // MIR for `match_u8_i16` after MatchBranchSimplification
3+
4+
fn match_u8_i16(_1: EnumAu8) -> i16 {
5+
debug i => _1;
6+
let mut _0: i16;
7+
let mut _2: u8;
8+
9+
bb0: {
10+
_2 = discriminant(_1);
11+
switchInt(move _2) -> [1: bb3, 2: bb1, otherwise: bb2];
12+
}
13+
14+
bb1: {
15+
_0 = const 2_i16;
16+
goto -> bb4;
17+
}
18+
19+
bb2: {
20+
unreachable;
21+
}
22+
23+
bb3: {
24+
_0 = const 1_i16;
25+
goto -> bb4;
26+
}
27+
28+
bb4: {
29+
return;
30+
}
31+
}
32+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
- // MIR for `match_u8_i16_2` before MatchBranchSimplification
2+
+ // MIR for `match_u8_i16_2` after MatchBranchSimplification
3+
4+
fn match_u8_i16_2(_1: EnumAu8) -> i16 {
5+
debug i => _1;
6+
let mut _0: i16;
7+
let mut _2: i16;
8+
let _3: ();
9+
let mut _4: u8;
10+
scope 1 {
11+
debug r => _2;
12+
}
13+
14+
bb0: {
15+
StorageLive(_2);
16+
_2 = const 0_i16;
17+
StorageLive(_3);
18+
_4 = discriminant(_1);
19+
switchInt(move _4) -> [1: bb3, 2: bb1, otherwise: bb2];
20+
}
21+
22+
bb1: {
23+
_2 = const 2_i16;
24+
_3 = const ();
25+
goto -> bb4;
26+
}
27+
28+
bb2: {
29+
unreachable;
30+
}
31+
32+
bb3: {
33+
_3 = const ();
34+
goto -> bb4;
35+
}
36+
37+
bb4: {
38+
StorageDead(_3);
39+
_0 = _2;
40+
StorageDead(_2);
41+
return;
42+
}
43+
}
44+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
- // MIR for `match_u8_i16_failed` before MatchBranchSimplification
2+
+ // MIR for `match_u8_i16_failed` after MatchBranchSimplification
3+
4+
fn match_u8_i16_failed(_1: EnumAu8) -> i16 {
5+
debug i => _1;
6+
let mut _0: i16;
7+
let mut _2: u8;
8+
9+
bb0: {
10+
_2 = discriminant(_1);
11+
switchInt(move _2) -> [1: bb3, 2: bb1, otherwise: bb2];
12+
}
13+
14+
bb1: {
15+
_0 = const 3_i16;
16+
goto -> bb4;
17+
}
18+
19+
bb2: {
20+
unreachable;
21+
}
22+
23+
bb3: {
24+
_0 = const 1_i16;
25+
goto -> bb4;
26+
}
27+
28+
bb4: {
29+
return;
30+
}
31+
}
32+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
- // MIR for `match_u8_i16_fallback` before MatchBranchSimplification
2+
+ // MIR for `match_u8_i16_fallback` after MatchBranchSimplification
3+
4+
fn match_u8_i16_fallback(_1: u8) -> i16 {
5+
debug i => _1;
6+
let mut _0: i16;
7+
8+
bb0: {
9+
switchInt(_1) -> [1: bb2, 2: bb3, otherwise: bb1];
10+
}
11+
12+
bb1: {
13+
_0 = const 3_i16;
14+
goto -> bb4;
15+
}
16+
17+
bb2: {
18+
_0 = const 1_i16;
19+
goto -> bb4;
20+
}
21+
22+
bb3: {
23+
_0 = const 2_i16;
24+
goto -> bb4;
25+
}
26+
27+
bb4: {
28+
return;
29+
}
30+
}
31+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
- // MIR for `match_u8_u16` before MatchBranchSimplification
2+
+ // MIR for `match_u8_u16` after MatchBranchSimplification
3+
4+
fn match_u8_u16(_1: EnumBu8) -> u16 {
5+
debug i => _1;
6+
let mut _0: u16;
7+
let mut _2: u8;
8+
9+
bb0: {
10+
_2 = discriminant(_1);
11+
switchInt(move _2) -> [1: bb3, 2: bb4, 5: bb1, otherwise: bb2];
12+
}
13+
14+
bb1: {
15+
_0 = const 5_u16;
16+
goto -> bb5;
17+
}
18+
19+
bb2: {
20+
unreachable;
21+
}
22+
23+
bb3: {
24+
_0 = const 1_u16;
25+
goto -> bb5;
26+
}
27+
28+
bb4: {
29+
_0 = const 2_u16;
30+
goto -> bb5;
31+
}
32+
33+
bb5: {
34+
return;
35+
}
36+
}
37+

0 commit comments

Comments
 (0)