nir: Fix copy_prop_src when src is an indirect access on a reg.
authorEric Anholt <eric@anholt.net>
Sun, 26 Jun 2016 00:33:16 +0000 (17:33 -0700)
committerEric Anholt <eric@anholt.net>
Sun, 26 Jun 2016 22:38:09 +0000 (15:38 -0700)
The intent was to continue down the indirect chain, not to call ourselves
with unchanged input arguments.  Found by code inspection, and comparison
to copy_prop_alu_src().

We haven't hit this because callers of NIR's copy prop are doing so in
SSA, before indirect variable dereferences have been lowered to registers.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_opt_copy_propagate.c

index adca7fa..c26e07f 100644 (file)
@@ -103,7 +103,7 @@ copy_prop_src(nir_src *src, nir_instr *parent_instr, nir_if *parent_if)
 {
    if (!src->is_ssa) {
       if (src->reg.indirect)
-         return copy_prop_src(src, parent_instr, parent_if);
+         return copy_prop_src(src->reg.indirect, parent_instr, parent_if);
       return false;
    }