i965/fs: Use the var_from_vgrf helper function instead of doing it manually
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 Sep 2014 01:34:28 +0000 (18:34 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 30 Sep 2014 17:29:13 +0000 (10:29 -0700)
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp

index 0d26103cc6629bedbd2afce248552ceb4b10785b..7838775dd17316cb655010cea54ec1c01e51d034 100644 (file)
@@ -78,19 +78,19 @@ 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];
+               int var = live_intervals->var_from_reg(&inst->dst);
                for (int i = 0; i < inst->regs_written; i++) {
-                  BITSET_CLEAR(live, var + inst->dst.reg_offset + i);
+                  BITSET_CLEAR(live, var + i);
                }
             }
          }
 
          for (int i = 0; i < inst->sources; i++) {
             if (inst->src[i].file == GRF) {
-               int var = live_intervals->var_from_vgrf[inst->src[i].reg];
+               int var = live_intervals->var_from_reg(&inst->src[i]);
 
                for (int j = 0; j < inst->regs_read(this, i); j++) {
-                  BITSET_SET(live, var + inst->src[i].reg_offset + j);
+                  BITSET_SET(live, var + j);
                }
             }
          }