[PATCH] D120575: avoid constructing an incomplete TTI in InlineCostAnnotationPrinterPass

Jameson Nash via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 25 10:50:28 PST 2022


vtjnash created this revision.
Herald added subscribers: ChuanqiXu, haicheng, hiraditya.
vtjnash requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

It is not an essential pass, but analysis is supposed to come from the
FAM, not be constructed here (it is missing the TargetMachine).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120575

Files:
  llvm/lib/Analysis/InlineCost.cpp


Index: llvm/lib/Analysis/InlineCost.cpp
===================================================================
--- llvm/lib/Analysis/InlineCost.cpp
+++ llvm/lib/Analysis/InlineCost.cpp
@@ -3098,10 +3098,10 @@
       [&](Function &F) -> AssumptionCache & {
     return FAM.getResult<AssumptionAnalysis>(F);
   };
+  TargetTransformInfo &TTI = FAM.getResult<TargetIRAnalysis>(F);
   Module *M = F.getParent();
   ProfileSummaryInfo PSI(*M);
   DataLayout DL(M);
-  TargetTransformInfo TTI(DL);
   // FIXME: Redesign the usage of InlineParams to expand the scope of this pass.
   // In the current implementation, the type of InlineParams doesn't matter as
   // the pass serves only for verification of inliner's decisions.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120575.411459.patch
Type: text/x-patch
Size: 719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220225/b322f0b1/attachment.bin>


More information about the llvm-commits mailing list