[Mesa-dev] [PATCH 1/9] i965/cmod_propagation: Ignore type in cmod prop if scan_inst is cmp

Jason Ekstrand jason at jlekstrand.net
Tue Mar 17 19:17:15 PDT 2015


From: Matt Turner <mattst88 at 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.ekstrand at 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



More information about the mesa-dev mailing list