ssair: fix phi edge cleanup for current block#60697
Conversation
|
Fix looks plausible, but I'll need to take a deeper look. It'd be nice to get an ir-level test also in addition to the regression test. |
|
So I think the identification of the issue is correct, but i don't think the fix quite works, because the statement range in (If you paste this into your claude session it'll probably give you correct code). |
|
updated |
When removing an edge during compaction, phi pruning treated only blocks\nwith to < active_bb as already compacted. If the edge was removed into\nthe current block, its phi nodes had already been rewritten with renamed\npredecessors, but the cleanup path still searched using the old\npredecessor ID in the pre-compact IR. This left a live block with a phi\nedge from a dead predecessor and broke IR verification.\n\nTreat to == active_bb as already compacted so phi edges are removed from\nthe result stream with renamed predecessor IDs.
69ddba9 to
71418f1
Compare
🤖: When removing an edge during compaction, phi pruning treated only blocks with to < active_bb as already compacted. If the edge was removed into the current block, its phi nodes had already been rewritten with renamed predecessors, but the cleanup path still searched using the old predecessor ID in the pre-compact IR. This left a live block with a phi edge from a dead predecessor and broke IR verification. Treat
to == active_bbas already compacted so phi edges are removed from the result stream with renamed predecessor IDs.AI fix (take 2) of #60660. Putting up for consideration.
The test only reproduces on 1.13 but figured I might as well add it in for potential backport.