summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2015-03-18 19:46:54 +0200
committerFrancisco Jerez <[email protected]>2015-03-23 14:12:52 +0200
commitd041a43c0f3e01c9d6f81244cbf1c85d4f3a17d5 (patch)
tree3d97bae79108984bd431e8360f3a657e71af9caa
parent588859e18cb597612e56980a65a762ef069363e4 (diff)
i965/vec4: Fix handling of multiple register reads and writes during copy propagation.
Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
index a603dd65b98..e897be299ba 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -74,9 +74,8 @@ is_channel_updated(vec4_instruction *inst, src_reg *values[4], int ch)
if (!src || src->file != GRF)
return false;
- return (src->reg == inst->dst.reg &&
- src->reg_offset == inst->dst.reg_offset &&
- inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch)));
+ return (src->in_range(inst->dst, inst->regs_written) &&
+ inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch)));
}
static unsigned
@@ -397,6 +396,10 @@ vec4_visitor::opt_copy_propagation(bool do_constant_prop)
inst->src[i].reladdr)
continue;
+ /* We only handle single-register copies. */
+ if (inst->regs_read(i) != 1)
+ continue;
+
int reg = (alloc.offsets[inst->src[i].reg] +
inst->src[i].reg_offset);