From 743d7c80e48e8ffbdf874bd14b5b45a47c1d7e56 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Thu, 19 Aug 2010 02:47:08 +0000 Subject: Update local stack block allocation to let PEI do the allocs if no additional base registers were required. This will allow for slightly better packing of the locals when alignment padding is necessary after callee saved registers. llvm-svn: 111508 --- llvm/lib/CodeGen/LocalStackSlotAllocation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/CodeGen/LocalStackSlotAllocation.cpp') diff --git a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp index b7071de..a4a4387 100644 --- a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp +++ b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp @@ -89,6 +89,13 @@ bool LocalStackSlotPass::runOnMachineFunction(MachineFunction &MF) { // Insert virtual base registers to resolve frame index references. insertFrameReferenceRegisters(MF); + // Tell MFI whether any base registers were allocated. PEI will only + // want to use the local block allocations from this pass if there were any. + // Otherwise, PEI can do a bit better job of getting the alignment right + // without a hole at the start since it knows the alignment of the stack + // at the start of local allocation, and this pass doesn't. + MFI->setUseLocalStackAllocationBlock(NumBaseRegisters > 0); + return true; } -- cgit v1.1