Skip to content

Commit 17525e4

Browse files
committed
Update matches_reduce_branches.rs
1 parent cce6a6e commit 17525e4

11 files changed

+567
-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: bb2, otherwise: bb1];
12+
}
13+
14+
bb1: {
15+
unreachable;
16+
}
17+
18+
bb2: {
19+
_0 = const _;
20+
goto -> bb6;
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: bb2, otherwise: bb1];
12+
}
13+
14+
bb1: {
15+
unreachable;
16+
}
17+
18+
bb2: {
19+
_0 = const -3_i8;
20+
goto -> bb5;
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: bb2, otherwise: bb1];
12+
}
13+
14+
bb1: {
15+
unreachable;
16+
}
17+
18+
bb2: {
19+
_0 = const -3_i16;
20+
goto -> bb5;
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: bb2, otherwise: bb1];
12+
}
13+
14+
bb1: {
15+
unreachable;
16+
}
17+
18+
bb2: {
19+
_0 = const 3_i16;
20+
goto -> bb5;
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: bb2, otherwise: bb1];
12+
}
13+
14+
bb1: {
15+
unreachable;
16+
}
17+
18+
bb2: {
19+
_0 = const 2_i16;
20+
goto -> bb4;
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,26 @@
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+
let mut _0: i16;
6+
let mut _2: u8;
7+
8+
bb0: {
9+
_2 = discriminant(_1);
10+
switchInt(_2) -> [1: bb3, 2: bb1, otherwise: bb2];
11+
}
12+
13+
bb1: {
14+
_0 = const 2_i16;
15+
goto -> bb3;
16+
}
17+
18+
bb2: {
19+
unreachable;
20+
}
21+
22+
bb3: {
23+
return;
24+
}
25+
}
26+
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: bb2, otherwise: bb1];
12+
}
13+
14+
bb1: {
15+
unreachable;
16+
}
17+
18+
bb2: {
19+
_0 = const 3_i16;
20+
goto -> bb4;
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: bb2, otherwise: bb1];
12+
}
13+
14+
bb1: {
15+
unreachable;
16+
}
17+
18+
bb2: {
19+
_0 = const 5_u16;
20+
goto -> bb5;
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+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
- // MIR for `match_u8_u16_2` before MatchBranchSimplification
2+
+ // MIR for `match_u8_u16_2` after MatchBranchSimplification
3+
4+
fn match_u8_u16_2(_1: EnumBu8) -> i16 {
5+
let mut _0: i16;
6+
let mut _2: u8;
7+
8+
bb0: {
9+
_2 = discriminant(_1);
10+
switchInt(_2) -> [1: bb1, 2: bb2, 5: bb3, otherwise: bb4];
11+
}
12+
13+
bb1: {
14+
_0 = const 1_i16;
15+
goto -> bb5;
16+
}
17+
18+
bb2: {
19+
_0 = const 2_i16;
20+
goto -> bb5;
21+
}
22+
23+
bb3: {
24+
_0 = const 5_i16;
25+
_0 = const 5_i16;
26+
goto -> bb5;
27+
}
28+
29+
bb4: {
30+
unreachable;
31+
}
32+
33+
bb5: {
34+
return;
35+
}
36+
}
37+

0 commit comments

Comments
 (0)