From: Stanislav Mekhanoshin Date: Wed, 20 Sep 2017 06:34:28 +0000 (+0000) Subject: [AMDGPU] Fixed memory leak with inliner replaced X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5a9104224ac49def36f7b6c172a5f4aa54c106b;p=llvm [AMDGPU] Fixed memory leak with inliner replaced Delete inliner before replacing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313723 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp index 7badd2c8be1..25d3629cd69 100644 --- a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp +++ b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp @@ -337,8 +337,10 @@ void AMDGPUTargetMachine::adjustPassManager(PassManagerBuilder &Builder) { bool AMDGPUAA = EnableAMDGPUAliasAnalysis && EnableOpt; bool LibCallSimplify = EnableLibCallSimplify && EnableOpt; - if (EnableAMDGPUFunctionCalls) + if (EnableAMDGPUFunctionCalls) { + delete Builder.Inliner; Builder.Inliner = createAMDGPUFunctionInliningPass(); + } if (Internalize) { // If we're generating code, we always have the whole program available. The