[Mesa-dev] [PATCH 1/2] i965: Don't treat IF or WHILE with cmod as writing the flag.

Matt Turner mattst88 at gmail.com
Mon Dec 1 10:13:20 PST 2014


---
These are a couple of fixes from a Jenkins run of my flagdce branch.

 src/mesa/drivers/dri/i965/brw_fs.cpp | 4 +++-
 src/mesa/drivers/dri/i965/brw_vec4.h | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 028eff2..37015ec 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -933,7 +933,9 @@ fs_inst::reads_flag() const
 bool
 fs_inst::writes_flag() const
 {
-   return (conditional_mod && opcode != BRW_OPCODE_SEL) ||
+   return (conditional_mod && (opcode != BRW_OPCODE_SEL &&
+                               opcode != BRW_OPCODE_IF &&
+                               opcode != BRW_OPCODE_WHILE)) ||
           opcode == FS_OPCODE_MOV_DISPATCH_TO_FLAGS;
 }
 
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index 7d814ca..abdab99 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -234,7 +234,9 @@ public:
 
    bool writes_flag()
    {
-      return conditional_mod && opcode != BRW_OPCODE_SEL;
+      return (conditional_mod && (opcode != BRW_OPCODE_SEL &&
+                                  opcode != BRW_OPCODE_IF &&
+                                  opcode != BRW_OPCODE_WHILE));
    }
 };
 
-- 
2.0.4



More information about the mesa-dev mailing list