Commit afa9fef
committed
Auto merge of #112418 - ferrocene:pa-mir-opt-panic, r=ozkanonur,saethlin
Add support for targets without unwinding in `mir-opt`, and improve `--bless` for it
The main goal of this PR is to add support for targets without unwinding support in the `mir-opt` test suite, by adding the `EMIT_MIR_FOR_EACH_PANIC_STRATEGY` comment. Similarly to 32bit vs 64bit, when that comment is present, blessed output files will have the `.panic-unwind` or `.panic-abort` suffix, and the right one will be chosen depending on the target's panic strategy.
The `EMIT_MIR_FOR_EACH_PANIC_STRATEGY` comment replaced all the `ignore-wasm32` comments in the `mir-opt` test suite, as those comments were added due to `wasm32` being a target without unwinding support. The comment was also added on other tests that were only executed on x86 but were still panic strategy dependent.
The `mir-opt` suite was then blessed, which caused a ton of churn as most of the existing output files had to be renamed and (mostly) duplicated with the abort strategy.
---
After [asking on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/mir-opt.20tests.20and.20panic.3Dabort), the main concern about this change is it'd make blessing the `mir-opt` suite even harder, as you'd need to both bless it with an unwinding target and an aborting target. This exacerbated the current situation, where you'd need to bless it with a 32bit and a 64bit target already.
Because of that, this PR also makes significant enhancements to `--bless` for the `mir-opt` suite, where it will automatically bless the suite four times with different targets, while requiring minimal cross-compilation.
To handle the 32bit vs 64bit blessing, there is now an hardcoded list of target mapping between 32bit and 64bit. The goal of the list is to find a related target that will *probably* work without requiring additional cross-compilation toolchains on the system. If a mapping is found, bootstrap will bless the suite with both targets, otherwise just with the current target.
To handle the panic strategy blessing (abort vs unwind), I had to resort to what I call "synthetic targets". For each of the target we're blessing (so either the current one, or a 32bit and a 64bit depending on the previous paragraph), bootstrap will extract the JSON spec of the target and change it to include `"panic-strategy": "abort"`. It will then build the standard library with this synthetic target, and bless the `mir-opt` suite with it.
As a result of these changes, blessing the `mir-opt` suite will actually bless it two or four times with different targets, ensuring all possible variants are actually blessed.
---
This PR is best reviewed commit-by-commit.
r? `@jyn514`
cc `@saethlin` `@oli-obk`File tree
518 files changed
+11693
-251
lines changed- library/std
- src
- bootstrap
- tools
- compiletest/src
- miropt-test-tools/src
- tidy/src
- tests/mir-opt
- const_prop
- copy-prop
- dataflow-const-prop
- dead-store-elimination
- dest-prop
- inline
- issues
- pre-codegen
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
518 files changed
+11693
-251
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1650 | 1650 | | |
1651 | 1651 | | |
1652 | 1652 | | |
1653 | | - | |
| 1653 | + | |
| 1654 | + | |
1654 | 1655 | | |
1655 | 1656 | | |
1656 | 1657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
110 | 106 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
117 | 115 | | |
118 | | - | |
119 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
120 | 122 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 123 | + | |
| 124 | + | |
135 | 125 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
141 | 140 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
153 | 146 | | |
154 | | - | |
155 | | - | |
156 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
172 | 177 | | |
173 | 178 | | |
174 | 179 | | |
| |||
314 | 319 | | |
315 | 320 | | |
316 | 321 | | |
317 | | - | |
| 322 | + | |
318 | 323 | | |
319 | 324 | | |
320 | 325 | | |
| |||
995 | 1000 | | |
996 | 1001 | | |
997 | 1002 | | |
998 | | - | |
999 | | - | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
1000 | 1010 | | |
1001 | 1011 | | |
1002 | 1012 | | |
| |||
1267 | 1277 | | |
1268 | 1278 | | |
1269 | 1279 | | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1270 | 1283 | | |
1271 | 1284 | | |
1272 | 1285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| 432 | + | |
432 | 433 | | |
433 | 434 | | |
434 | 435 | | |
| |||
460 | 461 | | |
461 | 462 | | |
462 | 463 | | |
463 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
464 | 473 | | |
465 | 474 | | |
466 | 475 | | |
| |||
478 | 487 | | |
479 | 488 | | |
480 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
481 | 495 | | |
482 | 496 | | |
483 | 497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
173 | 177 | | |
174 | 178 | | |
175 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
458 | 459 | | |
459 | 460 | | |
460 | 461 | | |
| |||
482 | 483 | | |
483 | 484 | | |
484 | 485 | | |
485 | | - | |
| 486 | + | |
486 | 487 | | |
487 | 488 | | |
488 | 489 | | |
| |||
1103 | 1104 | | |
1104 | 1105 | | |
1105 | 1106 | | |
1106 | | - | |
1107 | | - | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1108 | 1112 | | |
1109 | 1113 | | |
1110 | 1114 | | |
1111 | 1115 | | |
1112 | 1116 | | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1113 | 1120 | | |
1114 | | - | |
1115 | | - | |
| 1121 | + | |
| 1122 | + | |
1116 | 1123 | | |
1117 | 1124 | | |
1118 | 1125 | | |
| |||
1153 | 1160 | | |
1154 | 1161 | | |
1155 | 1162 | | |
1156 | | - | |
1157 | | - | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
1158 | 1168 | | |
1159 | 1169 | | |
1160 | 1170 | | |
1161 | | - | |
1162 | | - | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
1163 | 1176 | | |
1164 | 1177 | | |
1165 | 1178 | | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1169 | 1185 | | |
1170 | 1186 | | |
1171 | 1187 | | |
1172 | 1188 | | |
1173 | 1189 | | |
1174 | 1190 | | |
1175 | 1191 | | |
1176 | | - | |
1177 | | - | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
1178 | 1197 | | |
1179 | 1198 | | |
1180 | 1199 | | |
1181 | 1200 | | |
1182 | 1201 | | |
1183 | | - | |
| 1202 | + | |
1184 | 1203 | | |
1185 | 1204 | | |
1186 | 1205 | | |
1187 | 1206 | | |
1188 | 1207 | | |
1189 | 1208 | | |
1190 | | - | |
| 1209 | + | |
1191 | 1210 | | |
1192 | 1211 | | |
1193 | 1212 | | |
| |||
0 commit comments