From d2f52e61c2c18a5418e10a98cfbe7d6f2567fdbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 5 Apr 2024 17:02:46 +0200 Subject: [PATCH] nir/divergence: change nir_has_divergent_loop() to return true only for divergent breaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The important information is whether a loop has a uniform number of iterations. Reviewed-by: Marek Olšák Part-of: --- src/compiler/nir/nir_divergence_analysis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_divergence_analysis.c b/src/compiler/nir/nir_divergence_analysis.c index 860b5bdd9fd..d413f7c639c 100644 --- a/src/compiler/nir/nir_divergence_analysis.c +++ b/src/compiler/nir/nir_divergence_analysis.c @@ -1477,7 +1477,7 @@ nir_has_divergent_loop(nir_shader *shader) foreach_list_typed(nir_cf_node, node, node, &func->body) { if (node->type == nir_cf_node_loop) { - if (nir_loop_is_divergent(nir_cf_node_as_loop(node))) + if (nir_cf_node_as_loop(node)->divergent_break) return true; } }