Keep the stack frame aligned.
authorChris Lattner <sabre@nondot.org>
Mon, 16 Dec 2002 17:42:40 +0000 (17:42 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 16 Dec 2002 17:42:40 +0000 (17:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5081 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocSimple.cpp

index 9ed6ad98953e0ce2d18f64d4e9eba0b3c736cc10..925915ee771614215173a4bc44d620bbe97cf496 100644 (file)
@@ -324,6 +324,10 @@ bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) {
        MBB != MBBe; ++MBB)
     AllocateBasicBlock(*MBB);
 
+  // Round stack allocation up to a nice alignment to keep the stack aligned
+  // FIXME: This is X86 specific!  Move to frame manager
+  NumBytesAllocated = (NumBytesAllocated + 3) & ~3;
+
   // Add prologue to the function...
   RegInfo->emitPrologue(Fn, NumBytesAllocated);