summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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
commitbadf17cdc7faa4717215a3a2f68bd75a28bfefec (patch)
treebfc0860a396632068bc69abcd730060e5a3202f7 /llvm/lib/CodeGen
parentf86a8d10307db47974c41b71ffcd90a00cc93f24 (diff)
downloadbcm5719-llvm-badf17cdc7faa4717215a3a2f68bd75a28bfefec.tar.gz
bcm5719-llvm-badf17cdc7faa4717215a3a2f68bd75a28bfefec.zip
Needs to check whether unaligned load / store of i64 is legal here.
llvm-svn: 79150
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index fa99aaabf27..75de2035796 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud