[Mesa-dev] [PATCH 26/32] i965/vec4: Don't assume a value is dead when its VGRF is only partially overwritten.

Francisco Jerez currojerez at riseup.net
Fri Feb 6 06:43:06 PST 2015


---
 src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp
index 9604e60..5df0d31 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp
@@ -122,7 +122,8 @@ vec4_visitor::dead_code_eliminate()
             }
          }
 
-         if (inst->dst.file == GRF && !inst->predicate) {
+         if (inst->dst.file == GRF && !inst->predicate &&
+             inst->regs_written == alloc.sizes[inst->dst.reg]) {
             for (int c = 0; c < 4; c++) {
                if (inst->dst.writemask & (1 << c)) {
                   int var = inst->dst.reg * 4 + c;
-- 
2.1.3



More information about the mesa-dev mailing list