diff --git a/llvm/lib/Transforms/IPO/PartialInlining.cpp b/llvm/lib/Transforms/IPO/PartialInlining.cpp index 739b0dae3146..8dff2fb3be8a 100644 --- a/llvm/lib/Transforms/IPO/PartialInlining.cpp +++ b/llvm/lib/Transforms/IPO/PartialInlining.cpp @@ -591,6 +591,10 @@ void PartialInlinerImpl::computeCallsiteToProfCountMap( else CallSiteToProfCountMap[User] = 0; } + if (!GetBFI) { + if (CurrentCallerBFI) + delete CurrentCallerBFI; + } } Function *PartialInlinerImpl::unswitchFunction(Function *F) {