[Mesa-dev] [PATCH 2/3] i965/fs: Clear variable from live-set if it's completely overwritten.

Matt Turner mattst88 at gmail.com
Mon Apr 14 15:00:34 PDT 2014


One program affected:

instructions in affected programs:     246 -> 244 (-0.81%)
---
 src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
index 6addbb3..1ae7606 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
@@ -80,6 +80,13 @@ fs_visitor::dead_code_eliminate()
             }
          }
 
+         if (inst->dst.file == GRF) {
+            if (!inst->is_partial_write()) {
+               int var = live_intervals->var_from_reg(&inst->dst);
+               BITSET_CLEAR(live, var);
+            }
+         }
+
          for (int i = 0; i < 3; i++) {
             if (inst->src[i].file == GRF) {
                int var = live_intervals->var_from_vgrf[inst->src[i].reg];
-- 
1.8.3.2



More information about the mesa-dev mailing list