Commit e4600c5
authored
Relax constraints on the PHI block (JuliaLang#50308)
In JuliaLang#50158, I tought the verifier to reject code that has invalid
statements in the original PHI block. In JuliaLang#50235, this required
irinterp to stop folding PhiNodes to the respective constants.
I said at the time that a subsequent compact would fix it, but
it turns out that we don't actually have the logic for that.
I might still add that logic, but on the other hand it just
seems kinda silly that PhiNodes need to be a special case here.
This PR relaxes the semantics of the PHI block, to allow any
value-position constant to appear in the PHI block and undoes
the irinterp change from JuliaLang#50235. Only the interpreter really
cares about the semantics of the phi block, so the primary change
is there.
Of note, SSAValue forwards are not allowed in the phi block. This
is because of the following:
```
loop:
%1 = %(...)
%2 = %1
%3 = %(top => %1)
```
The two phi values %1 and %2 have different semantics: %1 gets
the *current* iteration of the loop, while %3 gets the *previous*
value. As a result, any pass that wants to move SSAValues out of
PhiNode uses would have to be aware of these semantics anyway,
and there's no simplicitly benefits to allowing SSAValues in the
middle of a phi block.1 parent 7eb358e commit e4600c5
3 files changed
+43
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| 193 | + | |
| 194 | + | |
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
| 198 | + | |
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
| |||
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
| 211 | + | |
207 | 212 | | |
208 | 213 | | |
209 | 214 | | |
| |||
244 | 249 | | |
245 | 250 | | |
246 | 251 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | 252 | | |
251 | 253 | | |
252 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
253 | 265 | | |
254 | 266 | | |
255 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
356 | | - | |
357 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
358 | 365 | | |
359 | | - | |
| 366 | + | |
360 | 367 | | |
361 | | - | |
362 | | - | |
363 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
364 | 371 | | |
365 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
366 | 380 | | |
367 | 381 | | |
368 | 382 | | |
| |||
405 | 419 | | |
406 | 420 | | |
407 | 421 | | |
408 | | - | |
| 422 | + | |
409 | 423 | | |
410 | 424 | | |
411 | 425 | | |
| |||
418 | 432 | | |
419 | 433 | | |
420 | 434 | | |
421 | | - | |
| 435 | + | |
422 | 436 | | |
423 | 437 | | |
424 | 438 | | |
| |||
0 commit comments