Mesa (master): vc4: Don't try to CSE non-SSA instructions.

Eric Anholt anholt at kemper.freedesktop.org
Fri Oct 23 17:12:52 UTC 2015


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Oct 23 16:34:01 2015 +0100

vc4: Don't try to CSE non-SSA instructions.

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 at anholt.net>

---

 src/gallium/drivers/vc4/vc4_opt_cse.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/vc4/vc4_opt_cse.c b/src/gallium/drivers/vc4/vc4_opt_cse.c
index 0e5480e..8b4d429 100644
--- a/src/gallium/drivers/vc4/vc4_opt_cse.c
+++ b/src/gallium/drivers/vc4/vc4_opt_cse.c
@@ -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;




More information about the mesa-commit mailing list