nir/load_store_vectorize: Use nir_iadd_imm for offsets
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 31 Mar 2020 17:40:36 +0000 (12:40 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 3 Apr 2020 20:26:54 +0000 (20:26 +0000)
This makes it capable of handling 64-bit offsets

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4367>

src/compiler/nir/nir_opt_load_store_vectorize.c

index b0d3a7d0d90192ce11cfde94e13bc816d073b092..fded9f5ca49810d26bb660615ff1e65448bd9132 100644 (file)
@@ -793,7 +793,7 @@ vectorize_loads(nir_builder *b, struct vectorize_ctx *ctx,
       b->cursor = nir_before_instr(first->instr);
 
       nir_ssa_def *new_base = first->intrin->src[info->base_src].ssa;
-      new_base = nir_iadd(b, new_base, nir_imm_int(b, -(high_start / 8u)));
+      new_base = nir_iadd_imm(b, new_base, -(int)(high_start / 8u));
 
       nir_instr_rewrite_src(first->instr, &first->intrin->src[info->base_src],
                             nir_src_for_ssa(new_base));