summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2016-10-14 18:10:39 +0000
committerTom Stellard <thomas.stellard@amd.com>2016-10-14 18:10:39 +0000
commit64a9d0876c55a95db04378e3788f0c34caa2edbf (patch)
treece3200e5f25d6686f0d46d0f6fe3e7350156b27d /llvm/lib/Target/AMDGPU/SIISelLowering.cpp
parentaaa44fe5cd376c059ba72fdc02fb939b8f68391d (diff)
downloadbcm5719-llvm-64a9d0876c55a95db04378e3788f0c34caa2edbf.tar.gz
bcm5719-llvm-64a9d0876c55a95db04378e3788f0c34caa2edbf.zip
AMDGPU/SI: Don't allow unaligned scratch access
Summary: The hardware doesn't support this. Reviewers: arsenm Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye Differential Revision: https://reviews.llvm.org/D25523 llvm-svn: 284257
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIISelLowering.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/SIISelLowering.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index be669c112b7..e6329511f3f 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -459,6 +459,15 @@ bool SITargetLowering::allowsMisalignedMemoryAccesses(EVT VT,
return AlignedBy4;
}
+ // FIXME: We have to be conservative here and assume that flat operations
+ // will access scratch. If we had access to the IR function, then we
+ // could determine if any private memory was used in the function.
+ if (!Subtarget->hasUnalignedScratchAccess() &&
+ (AddrSpace == AMDGPUAS::PRIVATE_ADDRESS ||
+ AddrSpace == AMDGPUAS::FLAT_ADDRESS)) {
+ return false;
+ }
+
if (Subtarget->hasUnalignedBufferAccess()) {
// If we have an uniform constant load, it still requires using a slow
// buffer instruction if unaligned.
OpenPOWER on IntegriCloud