Mesa (master): gallium/ntt: Fix check for "is there anything in the else block?"

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Dec 27 19:34:41 UTC 2020


Module: Mesa
Branch: master
Commit: 746a0f502ae0be3b755946dbaed0e66ee154c41e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=746a0f502ae0be3b755946dbaed0e66ee154c41e

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Dec 22 12:18:28 2020 -0800

gallium/ntt: Fix check for "is there anything in the else block?"

The cf list will always be non-empty, with at least a block in it.
Noticed while checking codegen of a piglit test that was really slow on
softpipe.

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8068>

---

 src/gallium/auxiliary/nir/nir_to_tgsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c
index 1e477de730f..79018fdc21c 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c
@@ -2053,7 +2053,7 @@ ntt_emit_if(struct ntt_compile *c, nir_if *if_stmt)
    ureg_UIF(c->ureg, c->if_cond, &label);
    ntt_emit_cf_list(c, &if_stmt->then_list);
 
-   if (!exec_list_is_empty(&if_stmt->else_list)) {
+   if (!nir_cf_list_is_empty_block(&if_stmt->else_list)) {
       ureg_fixup_label(c->ureg, label, ureg_get_instruction_number(c->ureg));
       ureg_ELSE(c->ureg, &label);
       ntt_emit_cf_list(c, &if_stmt->else_list);



More information about the mesa-commit mailing list