i965/fs: Clear variable from live-set if it's completely overwritten.
authorMatt Turner <mattst88@gmail.com>
Mon, 14 Apr 2014 18:17:13 +0000 (11:17 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 15 Apr 2014 16:25:44 +0000 (09:25 -0700)
One program affected:

instructions in affected programs:     246 -> 244 (-0.81%)

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp

index 390ac9ada5b58dbd75272529fd20337f1bcdbd8f..6672f840fc529bfe05f7e9357d05d065e104914f 100644 (file)
@@ -85,6 +85,15 @@ fs_visitor::dead_code_eliminate()
             }
          }
 
+         if (inst->dst.file == GRF) {
+            if (!inst->is_partial_write()) {
+               int var = live_intervals->var_from_vgrf[inst->dst.reg];
+               for (int i = 0; i < inst->regs_written; i++) {
+                  BITSET_CLEAR(live, var + inst->dst.reg_offset + i);
+               }
+            }
+         }
+
          for (int i = 0; i < 3; i++) {
             if (inst->src[i].file == GRF) {
                int var = live_intervals->var_from_vgrf[inst->src[i].reg];