Mesa (master): nir/search: check instr type before adding to worklist

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 20 14:40:18 UTC 2020


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

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Wed Nov  4 13:10:25 2020 +0000

nir/search: check instr type before adding to worklist

nir_algebraic_instr() ignores non-ALU instructions, so there's no point.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7511>

---

 src/compiler/nir/nir_search.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c
index 577f0be0b92..735e2c7d6c6 100644
--- a/src/compiler/nir/nir_search.c
+++ b/src/compiler/nir/nir_search.c
@@ -936,7 +936,8 @@ nir_algebraic_impl(nir_function_impl *impl,
     */
    nir_foreach_block_reverse(block, impl) {
       nir_foreach_instr_reverse(instr, block) {
-         nir_instr_worklist_push_tail(worklist, instr);
+         if (instr->type == nir_instr_type_alu)
+            nir_instr_worklist_push_tail(worklist, instr);
       }
    }
 



More information about the mesa-commit mailing list