nir/deref: copy ptr_stride when rematerializing
authorKarol Herbst <kherbst@redhat.com>
Thu, 5 Mar 2020 21:35:10 +0000 (22:35 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 14 May 2020 15:13:13 +0000 (15:13 +0000)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4068>

src/compiler/nir/nir_deref.c

index e06fd07aeb223ea9c6d68dc67155a0ff1bd0f94d..09eaa524e423b21a79b4281de4522b1f16acf558 100644 (file)
@@ -657,10 +657,13 @@ rematerialize_deref_in_block(nir_deref_instr *deref,
    switch (deref->deref_type) {
    case nir_deref_type_var:
    case nir_deref_type_array_wildcard:
-   case nir_deref_type_cast:
       /* Nothing more to do */
       break;
 
+   case nir_deref_type_cast:
+      new_deref->cast.ptr_stride = deref->cast.ptr_stride;
+      break;
+
    case nir_deref_type_array:
    case nir_deref_type_ptr_as_array:
       assert(!nir_src_as_deref(deref->arr.index));