summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit1b55dd9a81b20c861d46d5d9f4ee24e460822c8e (patch)
treec6153d6c99120205db97132aa94aa7b950f5e302 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent25793a3f2295397583aa9243d0a9d8676dd0c8a8 (diff)
downloadbcm5719-llvm-1b55dd9a81b20c861d46d5d9f4ee24e460822c8e.tar.gz
bcm5719-llvm-1b55dd9a81b20c861d46d5d9f4ee24e460822c8e.zip
Pass address space to allowsUnalignedMemoryAccesses
llvm-svn: 200888
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 55e96a4dea2..bf525796797 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud