"Removing jumps" in ACO means skipping the jump instruction at the beginning of a divergent branch (but still modify exec).
ACO already supports implicitly removing jumps when it decides that executing a branch with empty exec mask is more beneficial than a jump.
This commit adds the possibility to use this explicitly through nir_selection_control. ACO will respect this setting and remove the branch instructions when this is specified, unless it decides that this would cause bugs (eg. exp instruction).
There are two cases that benefit from the new change:
- When the application requests to "flatten" a branch (ie. remove control flow), we now respect that.
- When the compiler stack determines that a divergent branch is always taken.
- in NGG culling shaders
- in TCS (tess factor write)
elect()is used as a branch condition: MR !18059 (closed)