nir: Use the nir_builder _imm helpers in setting up deref offsets.
authorEric Anholt <eric@anholt.net>
Wed, 17 Apr 2019 17:12:48 +0000 (10:12 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 19 Apr 2019 15:45:14 +0000 (08:45 -0700)
commit38c75aff4cb07a68d8956e0f96f3167cfe3fa964
tree67d6bba6a45246dbe7f45cdbc9e46f263eac1021
parent9ac5ec2f90f8b6b2c0e67039b1ae7590374be872
nir: Use the nir_builder _imm helpers in setting up deref offsets.

When looking at the dEQP nested_struct_array_dynamic_index_fragment code
after lowering, I was horrified at the amount of adding and multiplying by
0 we were doing.  The builder _imm helpers handle that for you so that the
following optimization passes have less work to do.  Plus, it's easier to
read.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_deref.c