Module: Mesa
Branch: staging/22.2
Commit: 9478d1be89b5a24d84c39011844ffe75586d8407
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9478d1be89b5a24d84c39011844ffe75586d8407

Author: Karol Herbst <[email protected]>
Date:   Thu Sep  1 21:45:20 2022 +0200

nv50/ir: fix OP_UNION resolving when used for vector values

When an OP_UNION def takes part in a vector source e.g. for a tex
instruction we failed to clean up the OP_UNION instruction as rep() points
towards the coalesced value instead.

This fixes a regression on nv50 moving to NIR, but also potentially issues
with nvc0.

The main reason this is common in nv50 is, that we lower OP_SLCT to a set,
predicated movs and a union.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6406
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7117
Cc: mesa-stable
Signed-off-by: Karol Herbst <[email protected]>
Reviewed-by: M Henning <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18377>
(cherry picked from commit b23b94fbc9201368398823ccdc633cf1fa60127c)

---

 .pick_status.json                        | 2 +-
 src/nouveau/codegen/nv50_ir_peephole.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index e76e69bc17a..1f8b8fc285a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3199,7 +3199,7 @@
         "description": "nv50/ir: fix OP_UNION resolving when used for vector 
values",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/nouveau/codegen/nv50_ir_peephole.cpp 
b/src/nouveau/codegen/nv50_ir_peephole.cpp
index a2a33d2e434..398f04f7e7b 100644
--- a/src/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/nouveau/codegen/nv50_ir_peephole.cpp
@@ -53,7 +53,7 @@ Instruction::isNop() const
       if (!getDef(0)->equals(getSrc(0)))
          return false;
       if (op == OP_UNION)
-         if (!def(0).rep()->equals(getSrc(1)))
+         if (!getDef(0)->equals(getSrc(1)))
             return false;
       return true;
    }

Reply via email to