broadcom/vc5: Also check the update flags for avoiding DCE.
authorEric Anholt <eric@anholt.net>
Fri, 12 Jan 2018 23:34:22 +0000 (15:34 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 13 Jan 2018 05:58:11 +0000 (21:58 -0800)
I was trying to do a NULL-destination UF, and it got removed.

src/broadcom/compiler/vir_opt_dead_code.c

index 1f9e504e6be579db82239fb08ff8961354ea952e..7ce05fb5f5102824530bc66fa886d80ce13a2cdf 100644 (file)
@@ -49,6 +49,8 @@ dce(struct v3d_compile *c, struct qinst *inst)
         }
         assert(inst->qpu.flags.apf == V3D_QPU_PF_NONE);
         assert(inst->qpu.flags.mpf == V3D_QPU_PF_NONE);
+        assert(inst->qpu.flags.auf == V3D_QPU_UF_NONE);
+        assert(inst->qpu.flags.muf == V3D_QPU_UF_NONE);
         vir_remove_instruction(c, inst);
 }
 
@@ -108,7 +110,9 @@ vir_opt_dead_code(struct v3d_compile *c)
                                 continue;
 
                         if (inst->qpu.flags.apf != V3D_QPU_PF_NONE ||
-                            inst->qpu.flags.mpf != V3D_QPU_PF_NONE||
+                            inst->qpu.flags.mpf != V3D_QPU_PF_NONE ||
+                            inst->qpu.flags.auf != V3D_QPU_UF_NONE ||
+                            inst->qpu.flags.muf != V3D_QPU_UF_NONE ||
                             has_nonremovable_reads(c, inst)) {
                                 /* If we can't remove the instruction, but we
                                  * don't need its destination value, just