diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-14 20:10:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-14 20:10:59 +0000 |
commit | 612ce0c47c627f984f00ab56abab118c41278715 (patch) | |
tree | dd2a3f774c68b4c70b18aec0c2b193f917f854ad /llvm/lib/CodeGen | |
parent | 7dceed5ff9ab793def36067b222a3e8927eaae17 (diff) | |
download | bcm5719-llvm-612ce0c47c627f984f00ab56abab118c41278715.tar.gz bcm5719-llvm-612ce0c47c627f984f00ab56abab118c41278715.zip |
There is no reason to align the stack pointer if there are no callees of this function!
llvm-svn: 11449
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/PrologEpilogInserter.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp index 8f34cf48adb..bf1726d6ed9 100644 --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -216,8 +216,11 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) { FFI->setObjectOffset(i, -Offset); // Set the computed offset } - // Align the final stack pointer offset... - Offset = (Offset+StackAlignment-1)/StackAlignment*StackAlignment; + // Align the final stack pointer offset, but only if there are calls in the + // function. This ensures that any calls to subroutines have their stack + // frames suitable aligned. + if (FFI->hasCalls()) + Offset = (Offset+StackAlignment-1)/StackAlignment*StackAlignment; // Set the final value of the stack pointer... FFI->setStackSize(Offset-TFI.getOffsetOfLocalArea()); |