aco: remove divergence check in sanitize_if()
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 6 Apr 2020 10:47:18 +0000 (11:47 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 6 Apr 2020 18:39:29 +0000 (18:39 +0000)
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>

src/amd/compiler/aco_instruction_selection_setup.cpp

index ac7df9201007225ce6ef0af588831ca8b2008bf8..dcaf40f421d7accd9fdb5849877dc013440a77c7 100644 (file)
@@ -154,8 +154,7 @@ unsigned get_interp_input(nir_intrinsic_op intrin, enum glsl_interp_mode interp)
 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);