Skip to content

nir: Delete the rest of the CF list when adding a halt

Faith Ekstrand requested to merge gfxstrand/mesa:nir/lower-terminate-harder into main

In nir_lower_terminate_to_demote(), we were deleting the rest of the block contents when we added a halt instruction but left any subsequent CF nodes in the list. While this may be technically okay, that much dead code makes the rest of NIR pretty grumpy. It's better to delete everything to the end of the CF list, not just everything to the end of the block.

This MR also adds NIR validation to keep anyone else from making the same mistake.

Merge request reports