Mesa (staging/22.1): nir: fix an uninitialized variable valgrind warning in nir_group_loads

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 25 04:07:32 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: 1fddd2dbebccc79097436b97d65421f424c00463
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1fddd2dbebccc79097436b97d65421f424c00463

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Fri Apr 22 01:35:45 2022 -0400

nir: fix an uninitialized variable valgrind warning in nir_group_loads

pass_flags is only initialized for grouped loads, so change the order

Fixes: 33b4eb149ea - nir: add new SSA instruction scheduler grouping loads into indirection groups

Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16090>
(cherry picked from commit f7a77ff9005fdb1af7678d80dac6dcf16b328c21)

---

 .pick_status.json                  | 2 +-
 src/compiler/nir/nir_group_loads.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 124b581d033..6f9bbb01f0e 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -562,7 +562,7 @@
         "description": "nir: fix an uninitialized variable valgrind warning in nir_group_loads",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "33b4eb149ea79d9dd4b80ddda079ad027e5a40bf"
     },
diff --git a/src/compiler/nir/nir_group_loads.c b/src/compiler/nir/nir_group_loads.c
index e290012437c..b9da5c325fb 100644
--- a/src/compiler/nir/nir_group_loads.c
+++ b/src/compiler/nir/nir_group_loads.c
@@ -428,7 +428,7 @@ process_block(nir_block *block, nir_load_grouping grouping,
          }
 
          /* Only group load instructions with the same indirection level. */
-         if (current->pass_flags == level && is_grouped_load(current)) {
+         if (is_grouped_load(current) && current->pass_flags == level) {
             nir_instr *current_resource;
 
             switch (grouping) {



More information about the mesa-commit mailing list