summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2016-05-23 19:32:51 -0700
committerFrancisco Jerez <currojerez@riseup.net>2016-05-27 23:19:20 -0700
commit2db9dd5aeb9566c8480651989981cb1169957748 (patch)
treee253f299e5716532b6afc2a2566d21574c81cc3c /src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
parent8f538d9ae0e09da0a48233332dd3a26de863069d (diff)
downloadexternal_mesa3d-2db9dd5aeb9566c8480651989981cb1169957748.zip
external_mesa3d-2db9dd5aeb9566c8480651989981cb1169957748.tar.gz
external_mesa3d-2db9dd5aeb9566c8480651989981cb1169957748.tar.bz2
i965/fs: Fix off-by-one region overlap comparison in copy propagation.
This was introduced in cf375a3333e54a01462f192202d609436e5fbec8 but the blame is mine because the pseudocode I sent in my review comment for the original patch suggesting to do things this way already had the off-by-one error. This may have caused copy propagation to be unnecessarily strict while checking whether VGRF writes interfere with any ACP entries and possibly miss valid optimization opportunities in cases where multiple copy instructions write sequential locations of the same VGRF. Cc: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@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 9b92986..ceaaf5f 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -719,8 +719,8 @@ inline bool
regions_overlap(const fs_reg &r, unsigned n, const fs_reg &s, unsigned m)
{
return r.file == s.file && r.nr == s.nr &&
- !(r.reg_offset + n < s.reg_offset ||
- s.reg_offset + m < r.reg_offset);
+ !(r.reg_offset + n <= s.reg_offset ||
+ s.reg_offset + m <= r.reg_offset);
}
/* Walks a basic block and does copy propagation on it using the acp