NVPTX: Don't even create a regalloc if we're not going to use it.

Fixes a leak found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183031 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2013-05-31 19:21:58 +00:00
parent 504e2da08c
commit 488401e9c9

View File

@ -109,6 +109,7 @@ public:
virtual bool addPreRegAlloc();
virtual bool addPostRegAlloc();
virtual FunctionPass *createTargetRegisterAllocator(bool) LLVM_OVERRIDE;
virtual void addFastRegAlloc(FunctionPass *RegAllocPass);
virtual void addOptimizedRegAlloc(FunctionPass *RegAllocPass);
};
@ -147,12 +148,16 @@ bool NVPTXPassConfig::addPostRegAlloc() {
return false;
}
FunctionPass *NVPTXPassConfig::createTargetRegisterAllocator(bool) {
return 0; // No reg alloc
}
void NVPTXPassConfig::addFastRegAlloc(FunctionPass *RegAllocPass) {
// No reg alloc
assert(!RegAllocPass && "NVPTX uses no regalloc!");
addPass(&StrongPHIEliminationID);
}
void NVPTXPassConfig::addOptimizedRegAlloc(FunctionPass *RegAllocPass) {
// No reg alloc
assert(!RegAllocPass && "NVPTX uses no regalloc!");
addPass(&StrongPHIEliminationID);
}