summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-10-30 14:38:41 -0700
committerEric Anholt <[email protected]>2012-11-04 11:15:44 -0800
commit545b59b62a65a9cf1121668bd407e3365bbfa296 (patch)
tree653d0842f68e25f60ffb1d1761656cbbc6e06be8 /src
parentcf26b4569a2effc59d072ffd2b2bf9b055faab43 (diff)
i965/fs: Allow copy-propagation on pull constant load values.
Given that we handle similarly-regioned GRFs registers for our copy propagation from our UNIFORM file, there's no reason not to allow it. The shader-db impact is negligible -- +90 instructions total, 2 shaders helped and 7 hurt (slightly increased register pressure increased spilling), but this is to prevent regression in other shaders when fixing copy_propagation to reduce register pressure in the shaders that are hurt here. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp7
1 files changed, 4 insertions, 3 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 2fff6888335..73fe1a58a13 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -52,12 +52,14 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
bool has_source_modifiers = entry->src.abs || entry->src.negate;
if (intel->gen == 6 && inst->is_math() &&
- (has_source_modifiers || entry->src.file == UNIFORM))
+ (has_source_modifiers || entry->src.file == UNIFORM ||
+ entry->src.smear != -1))
return false;
inst->src[arg].file = entry->src.file;
inst->src[arg].reg = entry->src.reg;
inst->src[arg].reg_offset = entry->src.reg_offset;
+ inst->src[arg].smear = entry->src.smear;
if (!inst->src[arg].abs) {
inst->src[arg].abs = entry->src.abs;
@@ -255,8 +257,7 @@ fs_visitor::opt_copy_propagate_local(void *mem_ctx, bblock_t *block)
!inst->saturate &&
!inst->predicate &&
!inst->force_uncompressed &&
- !inst->force_sechalf &&
- inst->src[0].smear == -1) {
+ !inst->force_sechalf) {
acp_entry *entry = ralloc(mem_ctx, acp_entry);
entry->dst = inst->dst;
entry->src = inst->src[0];