[PATCH] D94808: [NewPM][Inliner] Move mandatory inliner inside function simplification pipeline

Mircea Trofin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 15 10:48:05 PST 2021


mtrofin added a comment.

I think InlineAdvisor::getAdvice needs to take a bool MandatoryOnly, which Inliner then passes. This allows us to then use the same advisor for both the always case and the policy-driven inliner instances, which allows that advisor to correctly book-keep any module wide state it may want to.



================
Comment at: llvm/include/llvm/Transforms/IPO/Inliner.h:111
+  std::unique_ptr<InlineAdvisor> OwnedAdvisor;
+  bool Mandatory;
 };
----------------
Nit: const bool


================
Comment at: llvm/lib/Transforms/IPO/Inliner.cpp:661
                         FunctionAnalysisManager &FAM, Module &M) {
+  if (Mandatory) {
+    OwnedAdvisor = std::make_unique<MandatoryInlineAdvisor>(FAM);
----------------
This should move to line 675: if we have installed an advisor, we use it, and the inliner pass passes to getAdvice() whether it only needs mandatory advice. All advisors need to support the mandatory case anyway.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94808/new/

https://reviews.llvm.org/D94808



More information about the cfe-commits mailing list