Module: Mesa
Branch: staging/23.0
Commit: 682b695e4a3b6f5f14b2eabfd6cc180539e6e7be
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=682b695e4a3b6f5f14b2eabfd6cc180539e6e7be

Author: Jesse Natalie <[email protected]>
Date:   Thu Mar 16 16:19:32 2023 -0700

nir: Propagate alignment when rematerializing cast derefs

Fixes: 878a8daca6bf ("nir: Add alignment information to cast derefs")
Reviewed-by: Faith Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21975>
(cherry picked from commit 49885f87c3b90cc3e1885530cb5873a8960aca47)

---

 .pick_status.json            | 2 +-
 src/compiler/nir/nir_deref.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index c596f7a5c77..f1ed4709ee3 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4441,7 +4441,7 @@
         "description": "nir: Propagate alignment when rematerializing cast 
derefs",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "878a8daca6bfc856308dda7d265964d93feb05ae"
     },
diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index 9289b23f6a2..9687eba60e6 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -769,6 +769,8 @@ rematerialize_deref_in_block(nir_deref_instr *deref,
 
    case nir_deref_type_cast:
       new_deref->cast.ptr_stride = deref->cast.ptr_stride;
+      new_deref->cast.align_mul = deref->cast.align_mul;
+      new_deref->cast.align_offset = deref->cast.align_offset;
       break;
 
    case nir_deref_type_array:

Reply via email to