vc4: Coalesce into TLB writes as well as VPM/tex.
authorEric Anholt <eric@anholt.net>
Wed, 18 Jan 2017 22:31:45 +0000 (09:31 +1100)
committerEric Anholt <eric@anholt.net>
Sun, 29 Jan 2017 03:35:20 +0000 (19:35 -0800)
This generally cuts an instruction when blending is enabled and we thus
have a single instruction generating the color value.

total instructions in shared programs: 91759 -> 91634 (-0.14%)
instructions in affected programs:     5338 -> 5213 (-2.34%)

src/gallium/drivers/vc4/vc4_opt_coalesce_ff_writes.c

index b247c690d8288e903e09e7d58402c398b5e4414e..e4f8e57fcd756424b0170b00e2ebc4cc0bf6fbbd 100644 (file)
@@ -57,7 +57,10 @@ qir_opt_coalesce_ff_writes(struct vc4_compile *c)
                 if (mov_inst->src[0].file != QFILE_TEMP)
                         continue;
 
-                if (!(mov_inst->dst.file == QFILE_VPM || qir_is_tex(mov_inst)))
+                if (!(mov_inst->dst.file == QFILE_VPM ||
+                      mov_inst->dst.file == QFILE_TLB_COLOR_WRITE ||
+                      mov_inst->dst.file == QFILE_TLB_COLOR_WRITE_MS ||
+                      qir_is_tex(mov_inst)))
                         continue;
 
                 uint32_t temp = mov_inst->src[0].index;
@@ -80,6 +83,7 @@ qir_opt_coalesce_ff_writes(struct vc4_compile *c)
 
                 if (qir_has_side_effects(c, inst) ||
                     qir_has_side_effect_reads(c, inst) ||
+                    inst->op == QOP_TLB_COLOR_READ ||
                     inst->op == QOP_VARY_ADD_C) {
                         continue;
                 }