aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/ARMFrameLowering.cpp
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2015-08-17 22:36:27 +0000
committerGuozhi Wei <carrot@google.com>2015-08-17 22:36:27 +0000
commitf66d3844439e3cadf9b4234fd4af7b452b4a5f62 (patch)
tree0975518cd6f9936175bbadc9948406d6b9707fe3 /llvm/lib/Target/ARM/ARMFrameLowering.cpp
parent4e2d799cabdc6cd4d9e38e7594088f44ed952fba (diff)
downloadllvm-f66d3844439e3cadf9b4234fd4af7b452b4a5f62.zip
llvm-f66d3844439e3cadf9b4234fd4af7b452b4a5f62.tar.gz
llvm-f66d3844439e3cadf9b4234fd4af7b452b4a5f62.tar.bz2
Align SP adjustment in function getSPAdjust
This commit adds a new function TargetFrameLowering::alignSPAdjust and calls it from TargetInstrInfo::getSPAdjust. It fixes PR24142. llvm-svn: 245253
Diffstat (limited to 'llvm/lib/Target/ARM/ARMFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMFrameLowering.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 68f9385..0133232 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -1734,8 +1734,7 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
// We need to keep the stack aligned properly. To do this, we round the
// amount of space needed for the outgoing arguments up to the next
// alignment boundary.
- unsigned Align = getStackAlignment();
- Amount = (Amount+Align-1)/Align*Align;
+ Amount = alignSPAdjust(Amount);
ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
assert(!AFI->isThumb1OnlyFunction() &&