vc4: Don't try to CSE non-SSA instructions.
authorEric Anholt <eric@anholt.net>
Fri, 23 Oct 2015 15:34:01 +0000 (16:34 +0100)
committerEric Anholt <eric@anholt.net>
Fri, 23 Oct 2015 17:11:21 +0000 (18:11 +0100)
This can happen when we're doing destination packing -- we don't know
what's in the rest of the register.

Signed-off-by: Eric Anholt <eric@anholt.net>
src/gallium/drivers/vc4/vc4_opt_cse.c

index 0e5480ea781dadff146a2c9bd6bb47b164715591..8b4d429074c3e3234c8db7fe0093635baecef1d1 100644 (file)
@@ -65,6 +65,7 @@ vc4_find_cse(struct vc4_compile *c, struct hash_table *ht,
              struct qinst *inst, uint32_t sf_count)
 {
         if (inst->dst.file != QFILE_TEMP ||
+            !c->defs[inst->dst.index] ||
             inst->op == QOP_MOV ||
             qir_get_op_nsrc(inst->op) > 4) {
                 return NULL;