summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-02-05 23:16:05 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-02-05 23:16:05 +0000
commita9ff3fd9427b0b7a14b133258e52aef030af1053 (patch)
tree27913ec0214c6356de267673feb1e4274551b356 /lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parentbb7bf85f3c7149e74e1cc2be823d558e33469bad (diff)
downloadllvm-a9ff3fd9427b0b7a14b133258e52aef030af1053.tar.gz
llvm-a9ff3fd9427b0b7a14b133258e52aef030af1053.tar.bz2
llvm-a9ff3fd9427b0b7a14b133258e52aef030af1053.tar.xz
Pass address space to allowsUnalignedMemoryAccesses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200888 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 55e96a4dea..bf52579679 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5723,9 +5723,13 @@ bool SelectionDAGBuilder::visitMemCmpCall(const CallInst &I) {
// bloat the code.
const TargetLowering *TLI = TM.getTargetLowering();
if (ActuallyDoIt && CSize->getZExtValue() > 4) {
+ unsigned DstAS = LHS->getType()->getPointerAddressSpace();
+ unsigned SrcAS = RHS->getType()->getPointerAddressSpace();
// TODO: Handle 5 byte compare as 4-byte + 1 byte.
// TODO: Handle 8 byte compare on x86-32 as two 32-bit loads.
- if (!TLI->isTypeLegal(LoadVT) ||!TLI->allowsUnalignedMemoryAccesses(LoadVT))
+ if (!TLI->isTypeLegal(LoadVT) ||
+ !TLI->allowsUnalignedMemoryAccesses(LoadVT, SrcAS) ||
+ !TLI->allowsUnalignedMemoryAccesses(LoadVT, DstAS))
ActuallyDoIt = false;
}