[PATCH] D94334: [InlineAdvisor] Allow replay of inline decisions for the CGSCC inliner from optimization remarks

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 21:07:19 PST 2021


wenlei added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Inliner.cpp:669
+
+  if (!CGSCCInlineReplayFile.empty()) {
+    if (!ReplayAdvisor)
----------------
Plug in replay inline advisor here isn't extensible. In the future we want to be able to use inline replay only for a specific function, or enforce/prevent certain inlining at particular callsite, and fall back to  regular advisor for the rest (see comments in D83743). 

That means we would need to be able to fall back from replay advisor to default advisor (or whatever main advisor being used) when replay advisor doesn't have info. For that cascaded model, we would need inline advise to have something like `hasInlineRecommendation` in addition to `isInliningRecommended`. We should probably still record inlining on each advice, but don't want to emit duplicated remarks from each advice. These changes can come later, but current change better offer that flexibility - we don't to stick to replay advisor for the entire module inliner pass.  


================
Comment at: llvm/test/Transforms/Inline/cgscc-inline-replay.ll:4
+;; Check replay inline decisions
+; RUN: opt < %s -passes=inline -cgscc-inline-replay=%S/Inputs/cgscc-inline-replay.txt -pass-remarks=inline -S 2>&1 | FileCheck -check-prefix=REPLAY %s
+
----------------
Better verify inline decision without replay first, to make sure the replay has visible impact on inlining. See DEFAULT and REPLAY check for SampleProfile/inline-replay.ll.


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

https://reviews.llvm.org/D94334



More information about the llvm-commits mailing list