vc4: Allow multi-instruction QIR nodes to get VPM optimization.
authorEric Anholt <eric@anholt.net>
Mon, 21 Mar 2016 19:18:07 +0000 (12:18 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 9 Apr 2016 01:41:45 +0000 (18:41 -0700)
There used to be multi-instruction operations that would use src[] twice,
which is why we couldn't do some optimizations on them.  This is no longer
the case.

total instructions in shared programs: 77973 -> 77969 (-0.01%)
instructions in affected programs:     84 -> 80 (-4.76%)
total estimated cycles in shared programs: 234165 -> 234157 (-0.00%)
estimated cycles in affected programs:     92 -> 84 (-8.70%)

src/gallium/drivers/vc4/vc4_opt_vpm.c

index d15b0c1a39f4c07518f0a94b654674699ccd5c88..d31b673bd63f0dfbf2421244998a8078e4c7eb2b 100644 (file)
@@ -65,7 +65,7 @@ qir_opt_vpm(struct vc4_compile *c)
          * result, try to move the instruction up in place of the VPM read.
          */
         list_for_each_entry(struct qinst, inst, &c->instructions, link) {
-                if (!inst || qir_is_multi_instruction(inst))
+                if (!inst)
                         continue;
 
                 if (qir_depends_on_flags(inst) || inst->sf)
@@ -132,7 +132,7 @@ qir_opt_vpm(struct vc4_compile *c)
                         continue;
 
                 struct qinst *inst = c->defs[temp];
-                if (!inst || qir_is_multi_instruction(inst))
+                if (!inst)
                         continue;
 
                 if (qir_depends_on_flags(inst) || inst->sf)