Update local stack block allocation to let PEI do the allocs if no additional
[oota-llvm.git] / lib / CodeGen / LocalStackSlotAllocation.cpp
index b7071dec474b3aa31fdc410b4ec43a23c7cff706..a4a43875ceed5719d5e2608dea68596de6c1292c 100644 (file)
@@ -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;
 }