From fb4db316d835fa9774d608ac58336a24c7867192 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 4 Jun 2008 23:37:54 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51970 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index a9b7381..8d0d344 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2633,8 +2633,9 @@ bool MeetsMaxMemopRequirement(std::vector &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; } } -- cgit v1.1