[PATCH] D110658: [InlineAdvisor] Add -inline-replay-strict to replay inline decisions only in callers that have remarks

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 12 18:03:09 PDT 2021


wenlei accepted this revision.
wenlei added a comment.

lgtm, thanks.

> That being said, negative mode itself is different in that it assumes all other legal sites will be inlined.

Depends on how we define it. This is how I think about it now: in non-strict mode, positive/negative means do or don't do certain inlining, but leave the rest to default heuristic. With strict mode, anything unspecific gets the opposite replay decision (not inline for positive, inline for negative). With that definition, negative is no different in that it can have both strict and non-strict mode.

> Negative mode only really works in function-scope since module scope would likely lead to never-ending compilation.

I think negative + strict only works in function-scope; but negative + non-strict should be fine. On the other hand, people can spell out all negative decision in input, same as positive ones, then negative + strict works for whole program too.



================
Comment at: llvm/include/llvm/Analysis/ReplayInlineAdvisor.h:43
+  StringMap<bool> InlineSitesFromRemarks;
+  StringSet<> InlineCallersFromRemarks;
 };
----------------
modimo wrote:
> wenlei wrote:
> > modimo wrote:
> > > wenlei wrote:
> > > > nit: `InlineCallersFromRemarks` -> `InlinerFromRemarks`
> > > This is to indicate which callers should have replay enforced in function scope, don't think `InlinerFromRemarks` is enough to capture that.
> > What I meant is `Inliner` is equivalent to `InlineCaller`, but more of a concise and canonical term. I guess you intend to emphasize on top level inliner, but InlinerCaller doesn't really carry that info either. Not a big deal though.
> Hmm maybe `CallersToReplay`? The key point is that this is a list of callers to replay on.
sounds good.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110658



More information about the llvm-commits mailing list