diff --git a/lib/Analysis/InlineAdvisor.cpp b/lib/Analysis/InlineAdvisor.cpp index 2cc57d0f750..16ab7598ee4 100644 --- a/lib/Analysis/InlineAdvisor.cpp +++ b/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);