nir/opt_sink: do not sink inverse_ballot out of loops

Inverse_ballot result is undefined if the input is not dynamically uniform.
And sinking out of loops might make the input divergent.

Fixes: 18a0ff137f ("nir: sink/move inverse_ballot like moves")

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30906>
(cherry picked from commit 91f8e32a85)
This commit is contained in:
Georg Lehmann 2024-08-28 19:03:53 +02:00 committed by Eric Engestrom
parent ce70d51e83
commit be004d4797
2 changed files with 2 additions and 1 deletions

View file

@ -1174,7 +1174,7 @@
"description": "nir/opt_sink: do not sink inverse_ballot out of loops",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "18a0ff137ffa38257b3e54b70c5394c7de4c7b3d",
"notes": null

View file

@ -253,6 +253,7 @@ can_sink_out_of_loop(nir_intrinsic_instr *intrin)
*/
return intrin->intrinsic != nir_intrinsic_load_ubo &&
intrin->intrinsic != nir_intrinsic_load_ubo_vec4 &&
intrin->intrinsic != nir_intrinsic_inverse_ballot &&
intrin->intrinsic != nir_intrinsic_load_ssbo;
}