Mesa (master): i965/vec4: Don' t DCE flag-writing insts because dest was unused.

Matt Turner mattst88 at kemper.freedesktop.org
Fri Dec 5 17:50:08 UTC 2014


Module: Mesa
Branch: master
Commit: 15f6118b77cbe42fb997174715bce4c2548aa1f1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=15f6118b77cbe42fb997174715bce4c2548aa1f1

Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed Dec  3 23:32:30 2014 -0800

i965/vec4: Don't DCE flag-writing insts because dest was unused.

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

---

 src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp |    2 +-
 1 file changed, 1 insertion(+), 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 b8370ba..9604e60 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
@@ -103,7 +103,7 @@ vec4_visitor::dead_code_eliminate()
                   progress = true;
 
                   if (inst->dst.writemask == 0) {
-                     if (inst->writes_accumulator) {
+                     if (inst->writes_accumulator || inst->writes_flag()) {
                         inst->dst = dst_reg(retype(brw_null_reg(), inst->dst.type));
                      } else {
                         inst->opcode = BRW_OPCODE_NOP;




More information about the mesa-commit mailing list