[llvm] r183031 - NVPTX: Don't even create a regalloc if we're not going to use it.
Justin Holewinski
justin.holewinski at gmail.com
Fri May 31 13:21:13 PDT 2013
Thanks!
On Fri, May 31, 2013 at 3:21 PM, Benjamin Kramer
<benny.kra at googlemail.com>wrote:
> Author: d0k
> Date: Fri May 31 14:21:58 2013
> New Revision: 183031
>
> URL: http://llvm.org/viewvc/llvm-project?rev=183031&view=rev
> Log:
> NVPTX: Don't even create a regalloc if we're not going to use it.
>
> Fixes a leak found by valgrind.
>
> Modified:
> llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
>
> Modified: llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp?rev=183031&r1=183030&r2=183031&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp Fri May 31 14:21:58
> 2013
> @@ -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);
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
--
Thanks,
Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130531/9d6e4281/attachment.html>
More information about the llvm-commits
mailing list