aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LocalStackSlotAllocation.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-08-19 02:47:08 +0000
committerJim Grosbach <grosbach@apple.com>2010-08-19 02:47:08 +0000
commitca48e70d0444ac828a1f3bed1a70d09eb657e19d (patch)
treedcb5018dec268aa79c5967a30e8a94d2380f43e0 /lib/CodeGen/LocalStackSlotAllocation.cpp
parenta565b92b2a79b89d68d6e7a53e3e81ea061d6d5f (diff)
downloadexternal_llvm-ca48e70d0444ac828a1f3bed1a70d09eb657e19d.zip
external_llvm-ca48e70d0444ac828a1f3bed1a70d09eb657e19d.tar.gz
external_llvm-ca48e70d0444ac828a1f3bed1a70d09eb657e19d.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LocalStackSlotAllocation.cpp')
-rw-r--r--lib/CodeGen/LocalStackSlotAllocation.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/LocalStackSlotAllocation.cpp b/lib/CodeGen/LocalStackSlotAllocation.cpp
index b7071de..a4a4387 100644
--- a/lib/CodeGen/LocalStackSlotAllocation.cpp
+++ b/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;
}