Commit b21631f
committed
cranelift/pulley: assert continuation has single predecessor (debug only)
Make the structural invariant explicit: the funcref-dispatch fusion
absorbs the two `VMFuncRef` field loads from the continuation block,
which is only sound when the continuation has exactly one
predecessor (the brif we're replacing). Build a `ControlFlowGraph`
in `pre_lower_pulley` and `debug_assert_eq!(n_preds, 1)` before
sinking.
Both the CFG construction and the assertion are gated on
`#[cfg(debug_assertions)]` so they compile to nothing in release
builds (no runtime overhead).1 parent 24ff906 commit b21631f
1 file changed
Lines changed: 30 additions & 0 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
463 | 493 | | |
464 | 494 | | |
465 | 495 | | |
| |||
0 commit comments