[Mesa-dev] [PATCH] i965/fs: Add support for removing NOT.NZ and NOT.Z instructions.
Ian Romanick
idr at freedesktop.org
Fri May 8 19:05:40 PDT 2015
From: Ian Romanick <ian.d.romanick at intel.com>
Shader-db results:
GM45 and Iron Lake:
total instructions in shared programs: 7888585 -> 7888585 (0.00%)
instructions in affected programs: 0 -> 0
Sandy Bridge, Ivy Bridge, Haswell, and Broadwell:
total instructions in shared programs: 9598608 -> 9598572 (-0.00%)
instructions in affected programs: 6506 -> 6470 (-0.55%)
helped: 36
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp
index 469f2ea..d72a83a 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp
@@ -59,7 +59,8 @@ opt_cmod_propagation_local(bblock_t *block)
if ((inst->opcode != BRW_OPCODE_AND &&
inst->opcode != BRW_OPCODE_CMP &&
- inst->opcode != BRW_OPCODE_MOV) ||
+ inst->opcode != BRW_OPCODE_MOV &&
+ inst->opcode != BRW_OPCODE_NOT) ||
inst->predicate != BRW_PREDICATE_NONE ||
!inst->dst.is_null() ||
inst->src[0].file != GRF ||
@@ -86,6 +87,11 @@ opt_cmod_propagation_local(bblock_t *block)
inst->conditional_mod != BRW_CONDITIONAL_NZ)
continue;
+ if (inst->opcode == BRW_OPCODE_NOT &&
+ inst->conditional_mod != BRW_CONDITIONAL_Z &&
+ inst->conditional_mod != BRW_CONDITIONAL_NZ)
+ continue;
+
bool read_flag = false;
foreach_inst_in_block_reverse_starting_from(fs_inst, scan_inst, inst,
block) {
--
2.1.0
More information about the mesa-dev
mailing list