From: Kenneth Graunke Date: Tue, 6 Aug 2013 00:12:12 +0000 (-0700) Subject: i965/fs: Explicitly disallow CSE on predicated instructions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d21f542aa1f8305ae9d149d97f987c81d2a81bca;p=mesa.git 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 --- 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;