Mesa (master): nir/lower_locals_to_regs: Use the imul_imm helper instead of forcing it.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 8 22:47:45 UTC 2021


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jan  6 16:08:43 2021 -0800

nir/lower_locals_to_regs: Use the imul_imm helper instead of forcing it.

Cleaned up a bit of addressing math in the shader I just had to debug.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8373>

---

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

diff --git a/src/compiler/nir/nir_lower_locals_to_regs.c b/src/compiler/nir/nir_lower_locals_to_regs.c
index 36a59678199..02f23a6f979 100644
--- a/src/compiler/nir/nir_lower_locals_to_regs.c
+++ b/src/compiler/nir/nir_lower_locals_to_regs.c
@@ -169,7 +169,7 @@ get_deref_reg_src(nir_deref_instr *deref, struct locals_to_regs_state *state)
          nir_ssa_def *index = nir_i2i(b, nir_ssa_for_src(b, d->arr.index, 1), 32);
          src.reg.indirect->ssa =
             nir_iadd(b, src.reg.indirect->ssa,
-                        nir_imul(b, index, nir_imm_int(b, inner_array_size)));
+                        nir_imul_imm(b, index, inner_array_size));
       }
 
       inner_array_size *= glsl_get_length(nir_deref_instr_parent(d)->type);



More information about the mesa-commit mailing list