summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-06-04 23:37:54 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-06-04 23:37:54 +0000
commit976b1eee816cdb14a19ca88db0289d877dd034f2 (patch)
tree1dea95cf9509420d86d96fd174ec23de66025856 /llvm/lib
parentd5bf26fa26e69c8bc54e9a2876cc23ee688f807c (diff)
downloadbcm5719-llvm-976b1eee816cdb14a19ca88db0289d877dd034f2.tar.gz
bcm5719-llvm-976b1eee816cdb14a19ca88db0289d877dd034f2.zip
Fix a memcpy lowering bug. Even though the memcpy alignment is smaller than the desired alignment, the frame destination alignment may still be larger than the desired alignment. Don't change its alignment to something smaller.
llvm-svn: 51970
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index a9b7381a096..8d0d344d62b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2633,8 +2633,9 @@ bool MeetsMaxMemopRequirement(std::vector<MVT::ValueType> &MemOps,
if (AllowUnalign)
VT = MVT::iAny;
} else {
- // Give the stack frame object a larger alignment.
- MFI->setObjectAlignment(FI, NewAlign);
+ // Give the stack frame object a larger alignment if needed.
+ if (MFI->getObjectAlignment(FI) < NewAlign)
+ MFI->setObjectAlignment(FI, NewAlign);
Align = NewAlign;
}
}
OpenPOWER on IntegriCloud