From 7afc9632a6d03ed8d23fbab08b564da594b9cfd6 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 5 Mar 2020 22:35:10 +0100 Subject: [PATCH] nir/deref: copy ptr_stride when rematerializing Signed-off-by: Karol Herbst Reviewed-by: Jason Ekstrand Part-of: --- src/compiler/nir/nir_deref.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c index e06fd07aeb2..09eaa524e42 100644 --- a/src/compiler/nir/nir_deref.c +++ b/src/compiler/nir/nir_deref.c @@ -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)); -- 2.30.2