summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LocalStackSlotAllocation.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-08-24 19:05:43 +0000
committerJim Grosbach <grosbach@apple.com>2010-08-24 19:05:43 +0000
commita273442891ae20fd8192526132e3819ea9e5eda9 (patch)
tree0e28d05f881cbe240efb9fba0d59f0072c149869 /lib/CodeGen/LocalStackSlotAllocation.cpp
parent05ea54e8869a81b8dd846397175f218f97968907 (diff)
downloadllvm-a273442891ae20fd8192526132e3819ea9e5eda9.tar.gz
llvm-a273442891ae20fd8192526132e3819ea9e5eda9.tar.bz2
llvm-a273442891ae20fd8192526132e3819ea9e5eda9.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111942 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LocalStackSlotAllocation.cpp')
-rw-r--r--lib/CodeGen/LocalStackSlotAllocation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/LocalStackSlotAllocation.cpp b/lib/CodeGen/LocalStackSlotAllocation.cpp
index 811cb07628..3f79593b4e 100644
--- a/lib/CodeGen/LocalStackSlotAllocation.cpp
+++ b/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.