Skip to content

Commit 18bfcd3

Browse files
committed
bless mir-opt tests
1 parent bc79557 commit 18bfcd3

File tree

24 files changed

+265
-155
lines changed

24 files changed

+265
-155
lines changed

src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff

+8-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
5656
discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
5757
_3 = const 1_isize; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
58-
goto -> bb2; // scope 0 at $DIR/issue-73223.rs:+1:17: +1:30
58+
goto -> bb3; // scope 0 at $DIR/issue-73223.rs:+1:17: +1:30
5959
}
6060

6161
bb1: {
@@ -66,6 +66,10 @@
6666
}
6767

6868
bb2: {
69+
unreachable; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
70+
}
71+
72+
bb3: {
6973
StorageLive(_4); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
7074
_4 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
7175
_1 = _4; // scope 2 at $DIR/issue-73223.rs:+2:20: +2:21
@@ -108,10 +112,10 @@
108112
StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
109113
_15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
110114
StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
111-
switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
115+
switchInt(move _15) -> [false: bb5, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
112116
}
113117

114-
bb3: {
118+
bb4: {
115119
StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
116120
Deinit(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
117121
discriminant(_20) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
@@ -141,7 +145,7 @@
141145
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
142146
}
143147

144-
bb4: {
148+
bb5: {
145149
nop; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
146150
StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
147151
StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL

src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff

+8-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
5656
discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
5757
_3 = const 1_isize; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
58-
goto -> bb2; // scope 0 at $DIR/issue-73223.rs:+1:17: +1:30
58+
goto -> bb3; // scope 0 at $DIR/issue-73223.rs:+1:17: +1:30
5959
}
6060

6161
bb1: {
@@ -66,6 +66,10 @@
6666
}
6767

6868
bb2: {
69+
unreachable; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
70+
}
71+
72+
bb3: {
6973
StorageLive(_4); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
7074
_4 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
7175
_1 = _4; // scope 2 at $DIR/issue-73223.rs:+2:20: +2:21
@@ -108,10 +112,10 @@
108112
StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
109113
_15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
110114
StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
111-
switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
115+
switchInt(move _15) -> [false: bb5, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
112116
}
113117

114-
bb3: {
118+
bb4: {
115119
StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
116120
Deinit(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
117121
discriminant(_20) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
@@ -141,7 +145,7 @@
141145
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
142146
}
143147

144-
bb4: {
148+
bb5: {
145149
nop; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
146150
StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
147151
StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL

src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.32bit.diff

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,24 @@
88

99
bb0: {
1010
_2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
11-
switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
11+
switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
1212
}
1313

1414
bb1: {
1515
_0 = const 1_u8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
16-
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
16+
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
1717
}
1818

1919
bb2: {
20-
_0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
21-
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
20+
unreachable; // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
2221
}
2322

2423
bb3: {
24+
_0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
25+
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
26+
}
27+
28+
bb4: {
2529
return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
2630
}
2731
}

src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.64bit.diff

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,24 @@
88

99
bb0: {
1010
_2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
11-
switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
11+
switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
1212
}
1313

1414
bb1: {
1515
_0 = const 1_u8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
16-
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
16+
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
1717
}
1818

1919
bb2: {
20-
_0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
21-
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
20+
unreachable; // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
2221
}
2322

2423
bb3: {
24+
_0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
25+
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
26+
}
27+
28+
bb4: {
2529
return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
2630
}
2731
}

src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.32bit.diff

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,24 @@
88

99
bb0: {
1010
_2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
11-
switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
11+
switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
1212
}
1313

1414
bb1: {
1515
_0 = const 1_i8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
16-
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
16+
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
1717
}
1818

1919
bb2: {
20-
_0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
21-
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
20+
unreachable; // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
2221
}
2322

2423
bb3: {
24+
_0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
25+
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
26+
}
27+
28+
bb4: {
2529
return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
2630
}
2731
}

src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.64bit.diff

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,24 @@
88

99
bb0: {
1010
_2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
11-
switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
11+
switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
1212
}
1313

1414
bb1: {
1515
_0 = const 1_i8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
16-
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
16+
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
1717
}
1818

1919
bb2: {
20-
_0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
21-
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
20+
unreachable; // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
2221
}
2322

2423
bb3: {
24+
_0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
25+
goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
26+
}
27+
28+
bb4: {
2529
return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
2630
}
2731
}

src/test/mir-opt/separate_const_switch.identity.ConstProp.diff

+12-8
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
_4 = _1; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
5858
StorageLive(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
5959
_10 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
60-
switchInt(move _10) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
60+
switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
6161
}
6262

6363
bb1: {
@@ -74,6 +74,10 @@
7474
}
7575

7676
bb2: {
77+
unreachable; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
78+
}
79+
80+
bb3: {
7781
StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
7882
_6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
7983
StorageLive(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
@@ -97,7 +101,7 @@
97101
return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
98102
}
99103

100-
bb3: {
104+
bb4: {
101105
StorageLive(_13); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
102106
_13 = move ((_4 as Err).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
103107
StorageLive(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
@@ -115,16 +119,16 @@
115119
StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
116120
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
117121
- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
118-
- switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
122+
- switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
119123
+ _5 = const 1_isize; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
120-
+ switchInt(const 1_isize) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
124+
+ switchInt(const 1_isize) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
121125
}
122126

123-
bb4: {
127+
bb5: {
124128
unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
125129
}
126130

127-
bb5: {
131+
bb6: {
128132
StorageLive(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
129133
_11 = move ((_4 as Ok).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
130134
StorageLive(_12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
@@ -137,9 +141,9 @@
137141
StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
138142
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
139143
- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
140-
- switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
144+
- switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
141145
+ _5 = const 0_isize; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
142-
+ switchInt(const 0_isize) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
146+
+ switchInt(const 0_isize) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
143147
}
144148
}
145149

src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff

+16-11
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@
5757
_4 = _1; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
5858
StorageLive(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
5959
_10 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
60-
- switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
61-
+ switchInt(move _10) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
60+
- switchInt(move _10) -> [0_isize: bb7, 1_isize: bb5, otherwise: bb6]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
61+
+ switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
6262
}
6363

6464
bb1: {
6565
- StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
6666
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
6767
- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
68-
- switchInt(move _5) -> [0_isize: bb2, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
68+
- switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
6969
- }
7070
-
7171
- bb2: {
@@ -83,6 +83,11 @@
8383

8484
- bb3: {
8585
+ bb2: {
86+
unreachable; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
87+
}
88+
89+
- bb4: {
90+
+ bb3: {
8691
StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
8792
_6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
8893
StorageLive(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
@@ -106,8 +111,8 @@
106111
return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
107112
}
108113

109-
- bb4: {
110-
+ bb3: {
114+
- bb5: {
115+
+ bb4: {
111116
StorageLive(_13); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
112117
_13 = move ((_4 as Err).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
113118
StorageLive(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
@@ -126,16 +131,16 @@
126131
+ StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
127132
+ StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
128133
+ _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
129-
+ switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
134+
+ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
130135
}
131136

132-
- bb5: {
133-
+ bb4: {
137+
- bb6: {
138+
+ bb5: {
134139
unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
135140
}
136141

137-
- bb6: {
138-
+ bb5: {
142+
- bb7: {
143+
+ bb6: {
139144
StorageLive(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
140145
_11 = move ((_4 as Ok).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
141146
StorageLive(_12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
@@ -149,7 +154,7 @@
149154
+ StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
150155
+ StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
151156
+ _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
152-
+ switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
157+
+ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
153158
}
154159
}
155160

0 commit comments

Comments
 (0)