summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
parent4e2d799cabdc6cd4d9e38e7594088f44ed952fba (diff)
downloadbcm5719-llvm-f66d3844439e3cadf9b4234fd4af7b452b4a5f62.tar.gz
bcm5719-llvm-f66d3844439e3cadf9b4234fd4af7b452b4a5f62.zip
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')
-rw-r--r--llvm/lib/CodeGen/TargetInstrInfo.cpp1
-rw-r--r--llvm/lib/Target/ARM/ARMFrameLowering.cpp3
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp
index e321a49a4f0..740d0e46240 100644
--- a/llvm/lib/CodeGen/TargetInstrInfo.cpp
+++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp
@@ -655,6 +655,7 @@ int TargetInstrInfo::getSPAdjust(const MachineInstr *MI) const {
return 0;
int SPAdj = MI->getOperand(0).getImm();
+ SPAdj = TFI->alignSPAdjust(SPAdj);
if ((!StackGrowsDown && MI->getOpcode() == FrameSetupOpcode) ||
(StackGrowsDown && MI->getOpcode() == FrameDestroyOpcode))
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 68f938533cf..0133232b05d 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() &&
OpenPOWER on IntegriCloud