From d21f542aa1f8305ae9d149d97f987c81d2a81bca Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 5 Aug 2013 17:12:12 -0700 Subject: [PATCH] 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 Reviewed-by: Matt Turner --- src/mesa/drivers/dri/i965/brw_fs_cse.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp index 9b60d9be41b..e715c3767b9 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; -- 2.30.2