From 8a2e2a6a2bd0ed9310a8739c256456567e2adb23 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Thu, 14 May 2020 15:42:26 -0700 Subject: [PATCH] [llvm] Fix refactoring bug introduced in D79042 Incorrectly copied over the GetAssumptionCache snippet. This patch also renames a variable for clarity. --- llvm/lib/Analysis/InlineAdvisor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/lib/Analysis/InlineAdvisor.cpp b/llvm/lib/Analysis/InlineAdvisor.cpp index 2cc57d0..16ab759 100644 --- a/llvm/lib/Analysis/InlineAdvisor.cpp +++ b/llvm/lib/Analysis/InlineAdvisor.cpp @@ -92,19 +92,19 @@ private: std::unique_ptr DefaultInlineAdvisor::getAdvice(CallBase &CB, FunctionAnalysisManager &FAM) { - Function &Callee = *CB.getCalledFunction(); - Function &F = *CB.getCaller(); - ProfileSummaryInfo *PSI = FAM.getResult(F) - .getCachedResult( - *CB.getParent()->getParent()->getParent()); + Function &Caller = *CB.getCaller(); + ProfileSummaryInfo *PSI = + FAM.getResult(Caller) + .getCachedResult( + *CB.getParent()->getParent()->getParent()); - auto &ORE = FAM.getResult(F); + auto &ORE = FAM.getResult(Caller); // FIXME: make GetAssumptionCache's decl similar to the other 2 below. May // need changing the type of getInlineCost parameters? Also see similar case // in Inliner.cpp std::function GetAssumptionCache = [&](Function &F) -> AssumptionCache & { - return FAM.getResult(Callee); + return FAM.getResult(F); }; auto GetBFI = [&](Function &F) -> BlockFrequencyInfo & { return FAM.getResult(F); -- 2.7.4