diff options
author | Jim Grosbach <grosbach@apple.com> | 2010-08-24 19:05:43 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2010-08-24 19:05:43 +0000 |
commit | b77d67f318f28e5028254a94502ff1125b75d0b9 (patch) | |
tree | e98c5174b29641b9fc0f5a11db1a4d6d9b720fc4 /llvm/lib/CodeGen/LocalStackSlotAllocation.cpp | |
parent | a209503467ffbb46068646a46780738041da49a1 (diff) | |
download | bcm5719-llvm-b77d67f318f28e5028254a94502ff1125b75d0b9.tar.gz bcm5719-llvm-b77d67f318f28e5028254a94502ff1125b75d0b9.zip |
Move enabling the local stack allocation pass into the target where it belongs.
For now it's still a command line option, but the interface to the generic
code doesn't need to know that.
llvm-svn: 111942
Diffstat (limited to 'llvm/lib/CodeGen/LocalStackSlotAllocation.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LocalStackSlotAllocation.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp index 811cb07628d..3f79593b4ed 100644 --- a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp +++ b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp @@ -74,10 +74,12 @@ FunctionPass *llvm::createLocalStackSlotAllocationPass() { bool LocalStackSlotPass::runOnMachineFunction(MachineFunction &MF) { MachineFrameInfo *MFI = MF.getFrameInfo(); + const TargetRegisterInfo *TRI = MF.getTarget().getRegisterInfo(); unsigned LocalObjectCount = MFI->getObjectIndexEnd(); - // Early exit if there are no locals to consider - if (!LocalObjectCount) + // If the target doesn't want/need this pass, or if there are no locals + // to consider, early exit. + if (!TRI->requiresVirtualBaseRegisters(MF) || LocalObjectCount == 0) return true; // Make sure we have enough space to store the local offsets. |