Align SP adjustment in function getSPAdjust
[oota-llvm.git] / lib / Target / ARM / ARMFrameLowering.cpp
index 68f938533cfe3bb03a26b82a4b220c7b9eb5057a..0133232b05d89212e6debf6c81bb3b626f313ffb 100644 (file)
@@ -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() &&