From: Evan Cheng Date: Sat, 15 Aug 2009 23:41:42 +0000 (+0000) Subject: Needs to check whether unaligned load / store of i64 is legal here. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8a9d5f96a5681ffe6e48dab9c8c383e71fd82a2c;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index fa99aaabf27..75de2035796 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3108,9 +3108,8 @@ bool MeetsMaxMemopRequirement(std::vector &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 &MemOps, } if (VT == MVT::iAny) { - if (AllowUnalign) { + if (TLI.allowsUnalignedMemoryAccesses(MVT::i64)) { VT = MVT::i64; } else { switch (Align & 7) {