On Mon May 29 11:39:54 2023 +0000, Giovanni Mascellani wrote:
Why downstream code needs to be aware of this? If SM4+ condition is
explicitly written out here, or later, it will only matter if we wanted to remove dead discard calls, by evaluating arguments differently. But even then we might scan for resulting "texkill/discard_nz" later and remove them, and not at IR level. Downstream code needs to be aware because, as your proposal is currently written, `struct hlsl_ir_jump` has a different meaning depending on whether it's SM1 or SM4. So each compiler pass touching a `struct hlsl_ir_jump` will have to check whether that's a SM1 or a SM4 jump and possible change its behavior accordingly.
Depends on what that pass is going to do. The obvious way I can thing of is to have separate jump types, if e.g. we'll want to check for dead texkill/discards later, and for that you'll have to know the meaning of its argument.