1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[llvm] Fix refactoring bug introduced in D79042

Incorrectly copied over the GetAssumptionCache snippet.

This patch also renames a variable for clarity.
This commit is contained in:
Mircea Trofin 2020-05-14 15:42:26 -07:00
parent e2942d2604
commit e17cf2c9c0

View File

@ -92,19 +92,19 @@ private:
std::unique_ptr<InlineAdvice>
DefaultInlineAdvisor::getAdvice(CallBase &CB, FunctionAnalysisManager &FAM) {
Function &Callee = *CB.getCalledFunction();
Function &F = *CB.getCaller();
ProfileSummaryInfo *PSI = FAM.getResult<ModuleAnalysisManagerFunctionProxy>(F)
.getCachedResult<ProfileSummaryAnalysis>(
*CB.getParent()->getParent()->getParent());
Function &Caller = *CB.getCaller();
ProfileSummaryInfo *PSI =
FAM.getResult<ModuleAnalysisManagerFunctionProxy>(Caller)
.getCachedResult<ProfileSummaryAnalysis>(
*CB.getParent()->getParent()->getParent());
auto &ORE = FAM.getResult<OptimizationRemarkEmitterAnalysis>(F);
auto &ORE = FAM.getResult<OptimizationRemarkEmitterAnalysis>(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<AssumptionCache &(Function &)> GetAssumptionCache =
[&](Function &F) -> AssumptionCache & {
return FAM.getResult<AssumptionAnalysis>(Callee);
return FAM.getResult<AssumptionAnalysis>(F);
};
auto GetBFI = [&](Function &F) -> BlockFrequencyInfo & {
return FAM.getResult<BlockFrequencyAnalysis>(F);