summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2018-06-13 17:14:33 -0700
committerIan Romanick <ian.d.romanick@intel.com>2018-09-04 17:25:23 -0700
commit47087875510a9f124dec68f1ec0c4c10adb9b867 (patch)
treea717284d3265a06ae892e49e3e8ada34151ce2fe
parente86ec7cb4d85a9b8029a7b046574f0a73b53fcae (diff)
i965/fs: Propagate conditional modifiers from not instructions to compare instructionscmod-propagation-work
No changes.
-rw-r--r--src/intel/compiler/brw_fs_cmod_propagation.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/intel/compiler/brw_fs_cmod_propagation.cpp b/src/intel/compiler/brw_fs_cmod_propagation.cpp
index b07da8f03a4..4268265e8b9 100644
--- a/src/intel/compiler/brw_fs_cmod_propagation.cpp
+++ b/src/intel/compiler/brw_fs_cmod_propagation.cpp
@@ -157,6 +157,20 @@ cmod_propagate_not(const gen_device_info *devinfo, bblock_t *block,
break;
}
+ /* Elide a bunch of the usual checks here. Compares can always do
+ * conditional modifiers, and the instruction will always already have a
+ * conditional modifier set.
+ */
+ if (scan_inst->opcode == BRW_OPCODE_CMP &&
+ scan_inst->src[1].is_zero() &&
+ scan_inst->src[0].equals(inst->src[0]) &&
+ !scan_inst->is_partial_write() &&
+ scan_inst->exec_size == inst->exec_size &&
+ scan_inst->conditional_mod == cond) {
+ inst->remove(block);
+ return true;
+ }
+
if (scan_inst->flags_written())
break;