i965/fs: Ignore mov.sat instructions in interference check in sat prop.
authorMatt Turner <mattst88@gmail.com>
Mon, 8 Sep 2014 19:06:49 +0000 (12:06 -0700)
committerMatt Turner <mattst88@gmail.com>
Sat, 27 Sep 2014 19:18:37 +0000 (12:18 -0700)
When an instruction's result was consumed by multiple mov.sat
instructions, we would decide that we couldn't move the saturate
modifier because something else was using the result, even though it was
just another mov.sat!

total instructions in shared programs: 4275598 -> 4274842 (-0.02%)
instructions in affected programs:     75634 -> 74878 (-1.00%)

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp

index 6f8f8d05c0ceed98c8a90c5c26b865f5fe495723..6f7fb6c4e2cd42b318f5673a34fc30e50bb65938 100644 (file)
@@ -67,7 +67,8 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
             break;
          }
          for (int i = 0; i < scan_inst->sources; i++) {
-            if (scan_inst->src[i].file == GRF &&
+            if ((scan_inst->opcode != BRW_OPCODE_MOV || !scan_inst->saturate) &&
+                scan_inst->src[i].file == GRF &&
                 scan_inst->src[i].reg == inst->src[0].reg &&
                 scan_inst->src[i].reg_offset == inst->src[0].reg_offset) {
                interfered = true;