@@ -3295,9 +3295,12 @@ InlineCostAnnotationPrinterPass::run(Function &F,
32953295 [&](Function &F) -> AssumptionCache & {
32963296 return FAM.getResult <AssumptionAnalysis>(F);
32973297 };
3298- Module *M = F.getParent ();
3299- ProfileSummaryInfo PSI (*M);
3300- TargetTransformInfo TTI (M->getDataLayout ());
3298+
3299+ auto &MAMProxy = FAM.getResult <ModuleAnalysisManagerFunctionProxy>(F);
3300+ ProfileSummaryInfo *PSI =
3301+ MAMProxy.getCachedResult <ProfileSummaryAnalysis>(*F.getParent ());
3302+ const TargetTransformInfo &TTI = FAM.getResult <TargetIRAnalysis>(F);
3303+
33013304 // FIXME: Redesign the usage of InlineParams to expand the scope of this pass.
33023305 // In the current implementation, the type of InlineParams doesn't matter as
33033306 // the pass serves only for verification of inliner's decisions.
@@ -3312,7 +3315,7 @@ InlineCostAnnotationPrinterPass::run(Function &F,
33123315 continue ;
33133316 OptimizationRemarkEmitter ORE (CalledFunction);
33143317 InlineCostCallAnalyzer ICCA (*CalledFunction, *CB, Params, TTI,
3315- GetAssumptionCache, nullptr , nullptr , & PSI,
3318+ GetAssumptionCache, nullptr , nullptr , PSI,
33163319 &ORE);
33173320 ICCA.analyze ();
33183321 OS << " Analyzing call of " << CalledFunction->getName ()
0 commit comments