Mesa (master): nir/load_store_vectorize: Use nir_iadd_imm for offsets

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 3 20:51:09 UTC 2020


Module: Mesa
Branch: master
Commit: b6273291b5646887c8488f71b2119709e15e7d0e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b6273291b5646887c8488f71b2119709e15e7d0e

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Tue Mar 31 12:40:36 2020 -0500

nir/load_store_vectorize: Use nir_iadd_imm for offsets

This makes it capable of handling 64-bit offsets

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

---

 src/compiler/nir/nir_opt_load_store_vectorize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_opt_load_store_vectorize.c b/src/compiler/nir/nir_opt_load_store_vectorize.c
index b0d3a7d0d90..fded9f5ca49 100644
--- a/src/compiler/nir/nir_opt_load_store_vectorize.c
+++ b/src/compiler/nir/nir_opt_load_store_vectorize.c
@@ -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));



More information about the mesa-commit mailing list