summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2016-09-01 21:20:18 -0700
committerFrancisco Jerez <currojerez@riseup.net>2016-09-14 14:50:55 -0700
commit5cc6425d708a9b8c660c2f43f5e277c507c98bf0 (patch)
tree89e8d3c86a338d420b3e3a05deff12347b882e1c /src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
parent9ae77d702043231571b5ef08951224e3c77baddd (diff)
downloadexternal_mesa3d-5cc6425d708a9b8c660c2f43f5e277c507c98bf0.zip
external_mesa3d-5cc6425d708a9b8c660c2f43f5e277c507c98bf0.tar.gz
external_mesa3d-5cc6425d708a9b8c660c2f43f5e277c507c98bf0.tar.bz2
i965/fs: Fix can_propagate_from() source/destination overlap check.
The previous overlap condition only made sure that the VGRF numbers or GRF-aligned offsets were different without taking the amount of data written and read by the instruction into consideration. Use the regions_overlap() helper instead. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp4
1 files changed, 2 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 f8238aa..4a56aff 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -739,8 +739,8 @@ can_propagate_from(fs_inst *inst)
return (inst->opcode == BRW_OPCODE_MOV &&
inst->dst.file == VGRF &&
((inst->src[0].file == VGRF &&
- (inst->src[0].nr != inst->dst.nr ||
- inst->src[0].offset / REG_SIZE != inst->dst.offset / REG_SIZE)) ||
+ !regions_overlap(inst->dst, inst->size_written,
+ inst->src[0], inst->size_read(0))) ||
inst->src[0].file == ATTR ||
inst->src[0].file == UNIFORM ||
inst->src[0].file == IMM) &&