[PATCH] D112040: [InlineAdvisor] Add fallback/format switches and negative remark processing to Replay Inliner

Di Mo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 28 16:31:35 PDT 2021


modimo added inline comments.


================
Comment at: llvm/include/llvm/Analysis/InlineAdvisor.h:289
 
+struct CallSiteFormat {
+  enum class Format : int {
----------------
mtrofin wrote:
> can formatting (so callsiteformat and getCallSiteLocation) be moved to ReplayInlineAdvisor.h?
> 
> also: s/getCallSiteLocation/formatCallSiteLocation. 
Yes, this was originally added for replay and only that consumes this atm.


================
Comment at: llvm/lib/Transforms/IPO/Inliner.cpp:877
 
-      auto Advice = Advisor.getAdvice(*CB, OnlyMandatory);
+      std::unique_ptr<InlineAdvice> Advice =
+          Advisor.getAdvice(*CB, OnlyMandatory);
----------------
mtrofin wrote:
> unrelated change?
The comment below is that `!Advice` isn't very clear with auto and also tripped me up: the previous change
`if (!Advice || !Advice->isInliningRecommended()) {`

treated `!Advice` as having "negative" advice rather than being empty. Clearing this up seems valuable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112040



More information about the llvm-commits mailing list