diff options
author | Matt Turner <mattst88@gmail.com> | 2014-06-23 22:07:20 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2014-07-17 15:59:00 -0700 |
commit | 7fcfdfb17b187c2370a0c31da32908973d526eb3 (patch) | |
tree | 1a551840c6ce168f826e2ff8acf6c66745f51b27 | |
parent | 8612a12a62ce1ed3f8989ca3e969e9992429206e (diff) | |
download | mesa-7fcfdfb17b187c2370a0c31da32908973d526eb3.tar.gz mesa-7fcfdfb17b187c2370a0c31da32908973d526eb3.tar.xz |
i965/fs: Constant propagate into 2-src math instructions on Gen8.
total instructions in shared programs: 1878133 -> 1876986 (-0.06%)
instructions in affected programs: 153007 -> 151860 (-0.75%)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 038eb649b30dfddaf40888ea28b5e88de3af2214)
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp index ee73d26e9a..ef149c8b97 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp @@ -361,7 +361,8 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry) static bool -try_constant_propagate(fs_inst *inst, acp_entry *entry) +try_constant_propagate(struct brw_context *brw, fs_inst *inst, + acp_entry *entry) { bool progress = false; @@ -389,6 +390,12 @@ try_constant_propagate(fs_inst *inst, acp_entry *entry) progress = true; break; + case SHADER_OPCODE_POW: + case SHADER_OPCODE_INT_QUOTIENT: + case SHADER_OPCODE_INT_REMAINDER: + if (brw->gen < 8) + break; + /* fallthrough */ case BRW_OPCODE_BFI1: case BRW_OPCODE_ASR: case BRW_OPCODE_SHL: @@ -530,7 +537,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block, foreach_list(entry_node, &acp[inst->src[i].reg % ACP_HASH_SIZE]) { acp_entry *entry = (acp_entry *)entry_node; - if (try_constant_propagate(inst, entry)) + if (try_constant_propagate(brw, inst, entry)) progress = true; if (try_copy_propagate(inst, i, entry)) |