Mesa (master): i965/fs: Explicitly disallow CSE on predicated instructions.

Kenneth Graunke kwg at kemper.freedesktop.org
Mon Aug 12 20:14:00 UTC 2013


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Aug  5 17:12:12 2013 -0700

i965/fs: Explicitly disallow CSE on predicated instructions.

The existing inst->is_partial_write() already disallows predicated
instructions, so this has no functional change.  However, it's worth
doing explicitly since the CSE pass does not consider the flag register.
This means it could blindly factor out operations that use the same
sources, but which have different condition codes set.

This prevents a regression in the next commit.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/mesa/drivers/dri/i965/brw_fs_cse.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
index 9b60d9b..e715c37 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
@@ -97,7 +97,9 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
 	inst = (fs_inst *) inst->next) {
 
       /* Skip some cases. */
-      if (is_expression(inst) && !inst->is_partial_write() &&
+      if (is_expression(inst) &&
+          !inst->predicate &&
+          !inst->is_partial_write() &&
           !inst->conditional_mod)
       {
 	 bool found = false;




More information about the mesa-commit mailing list