Label ID allocation; we want to avoid using any label IDs already used by the original shader.
I guess we don't support TPF shaders which already have some LABEL instructions (before we add ours), do we? And we don't expect to find many in the first place? In that case I would just suggest to have the TPF frontend directly fail if it sees one of them.
The issue Giovanni identified about the intermediate state of e.g. IF/ELSE/ENDIF inside loops. One thing that's not clear to me is whether that ends up resulting in invalid SPIR-V, or just vsir that looks a bit funny. I think we end up with essentially the same SPIR-V as before, so in that sense it may be fine, right?
AFAICT (and I didn't investigate in depth), yes, I think the intermediate VSIR is a bit strange, but the generated SPIR-V is (essentially) the same. Also tests seem to pass, and we have tests with control flow. So end-to-end we're fine, I think. I don't like the idea of having ill-defined VSIR code, but if it's just for those three commits I don't care.