That's another approach. It's a bit more complicated because it requires more coordination with the rest of the code generator, which needs to know when to stop and resume emitting code,
Could we prune it from the IR before starting SPIR-V generation?