summaryrefslogtreecommitdiff
path: root/src/intel/compiler/brw_fs_copy_propagation.cpp
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2018-12-07 14:26:23 -0800
committerFrancisco Jerez <currojerez@riseup.net>2019-01-09 12:03:08 -0800
commitc301f447ea8449804208e414f189c0571e4339a8 (patch)
tree1bd867cd56e6a92e8200f0c10d38843da9feaa61 /src/intel/compiler/brw_fs_copy_propagation.cpp
parent464e79144f8090eb42b8994a983470628c248be0 (diff)
intel/fs: Respect CHV/BXT regioning restrictions in copy propagation pass.
Currently the visitor attempts to enforce the regioning restrictions that apply to double-precision instructions on CHV/BXT at NIR-to-i965 translation time. It is possible though for the copy propagation pass to violate this restriction if a strided move is propagated into one of the affected instructions. I've only reproduced this issue on a future platform but it could affect CHV/BXT too under the right conditions. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/intel/compiler/brw_fs_copy_propagation.cpp')
-rw-r--r--src/intel/compiler/brw_fs_copy_propagation.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/intel/compiler/brw_fs_copy_propagation.cpp b/src/intel/compiler/brw_fs_copy_propagation.cpp
index a8ec1c34630..c23ce1ef426 100644
--- a/src/intel/compiler/brw_fs_copy_propagation.cpp
+++ b/src/intel/compiler/brw_fs_copy_propagation.cpp
@@ -315,6 +315,16 @@ can_take_stride(fs_inst *inst, unsigned arg, unsigned stride,
if (stride > 4)
return false;
+ /* Bail if the channels of the source need to be aligned to the byte offset
+ * of the corresponding channel of the destination, and the provided stride
+ * would break this restriction.
+ */
+ if (has_dst_aligned_region_restriction(devinfo, inst) &&
+ !(type_sz(inst->src[arg].type) * stride ==
+ type_sz(inst->dst.type) * inst->dst.stride ||
+ stride == 0))
+ return false;
+
/* 3-source instructions can only be Align16, which restricts what strides
* they can take. They can only take a stride of 1 (the usual case), or 0
* with a special "repctrl" bit. But the repctrl bit doesn't work for