aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-08-15 23:41:42 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-08-15 23:41:42 +0000
commit4e3d397c057e265fbd055301010139a0da8ed621 (patch)
treec79c884b50ba27b959e8e57b95155a510f231a9b /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentace63a60c77432a29c522866c5f8c040263d49c3 (diff)
downloadexternal_llvm-4e3d397c057e265fbd055301010139a0da8ed621.zip
external_llvm-4e3d397c057e265fbd055301010139a0da8ed621.tar.gz
external_llvm-4e3d397c057e265fbd055301010139a0da8ed621.tar.bz2
Needs to check whether unaligned load / store of i64 is legal here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index fa99aaa..75de203 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -3108,9 +3108,8 @@ bool MeetsMaxMemopRequirement(std::vector<EVT> &MemOps,
EVT VT = TLI.getOptimalMemOpType(Size, Align, isSrcConst, isSrcStr, DAG);
bool AllowUnalign = TLI.allowsUnalignedMemoryAccesses(VT);
if (VT != MVT::iAny) {
- unsigned NewAlign = (unsigned)
- TLI.getTargetData()->getABITypeAlignment(
- VT.getTypeForEVT(*DAG.getContext()));
+ const Type *Ty = VT.getTypeForEVT(*DAG.getContext());
+ unsigned NewAlign = (unsigned) TLI.getTargetData()->getABITypeAlignment(Ty);
// If source is a string constant, this will require an unaligned load.
if (NewAlign > Align && (isSrcConst || AllowUnalign)) {
if (Dst.getOpcode() != ISD::FrameIndex) {
@@ -3135,7 +3134,7 @@ bool MeetsMaxMemopRequirement(std::vector<EVT> &MemOps,
}
if (VT == MVT::iAny) {
- if (AllowUnalign) {
+ if (TLI.allowsUnalignedMemoryAccesses(MVT::i64)) {
VT = MVT::i64;
} else {
switch (Align & 7) {