We also need to do this if a side ends in a divergent break.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4461>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4461>
bool
sanitize_if(nir_function_impl *impl, bool *divergent, nir_if *nif)
{
- if (!divergent[nif->condition.ssa->index])
- return false;
+ //TODO: skip this if the condition is uniform and there are no divergent breaks/continues?
nir_block *then_block = nir_if_last_then_block(nif);
nir_block *else_block = nir_if_last_else_block(nif);