i965/fs: Explicitly disallow CSE on predicated instructions.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 6 Aug 2013 00:12:12 +0000 (17:12 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 12 Aug 2013 20:12:57 +0000 (13:12 -0700)
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@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_cse.cpp

index 9b60d9be41b0eef160d8755ec8b5053e520b265f..e715c3767b9ef1b41c0c0ff2ad4f9b8881a12abe 100644 (file)
@@ -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;