From: Matt Turner <matts...@gmail.com>

Shader-db results for FS instructions with NIR on HSW:

total instructions in shared programs: 4186747 -> 4129871 (-1.36%)
instructions in affected programs:     2438094 -> 2381218 (-2.33%)
helped:                                13525
HURT:                                  0
GAINED:                                1
LOST:                                  5

Revewed-by: Jason Ekstrand <jason.ekstr...@intel.com>
---
 src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

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 1935f06..1b24358 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp
@@ -94,6 +94,15 @@ opt_cmod_propagation_local(bblock_t *block)
                 scan_inst->dst.reg_offset != inst->src[0].reg_offset)
                break;
 
+            if (inst->conditional_mod == BRW_CONDITIONAL_NZ &&
+                scan_inst->opcode == BRW_OPCODE_CMP &&
+                (inst->dst.type == BRW_REGISTER_TYPE_D ||
+                 inst->dst.type == BRW_REGISTER_TYPE_UD)) {
+               inst->remove(block);
+               progress = true;
+               break;
+            }
+
             /* This must be done before the dst.type check because the result
              * type of the AND will always be D, but the result of the CMP
              * could be anything.  The assumption is that the AND is just
-- 
2.3.2

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to