[PATCH] D82213: [Remarks] Add callsite locations to inline remarks

Wenlei He via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 19 17:56:08 PDT 2020


wenlei marked an inline comment as done.
wenlei added inline comments.


================
Comment at: llvm/lib/Analysis/InlineAdvisor.cpp:391
+    Remark << ore::NV("Caller", &Caller);
+    if (ProfileGuidedInline)
+      Remark << " by profile guided inliner";
----------------
davidxl wrote:
> is this necessary? User should know if their build has profile or not.
> 
> What is more useful is when PGO is on, but some callsite does not have profile data, then it is worth reporting.
> is this necessary? User should know if their build has profile or not.

This was used to differentiate between SampleProfileLoader inline vs CGSCC inline. Maybe the message `by profile guided inliner` isn't great, but can't think of a better and concise way..

With the differentiation in the message, the inlinee tree recovered through some parsing is what I'm looking for (`[P]` for SampleProfileLoader inline, `[C]` for CGSCC inline):

```
Inlinees for main
[P]  _ZN15largesolidarrayIP6regobjEixEi @ 369
[P]  _Z7random1i @ 363
[C]    _Z8myrandomv @ 2
[P]  _Z7random1i @ 364
[C]    _Z8myrandomv @ 2
[P]  _ZN15largesolidarrayIP6regobjEixEi @ 366
[P]  _ZN6wayobj9createwayEiiiiRP8point16tRi @ 327
[P]    _ZN6wayobj11createwayarEiiRP8point16tRi @ 37.1
[P]      _ZN6wayobj5indexEii @ 143
[P]      _ZN6wayobj5indexEii @ 130
[P]      _ZN6wayobj6indexxEi @ 31
[P]      _ZN6wayobj6indexyEi @ 32
[C]      _ZN8point16tC2Ess @ 2
[C]      _ZN8point16tC2Ess @ 2.1
```

> What is more useful is when PGO is on, but some callsite does not have profile data, then it is worth reporting.

That can be useful. I was also looking for a way to get call site count printed (if we have a count), but looks like it's not available from `InlineCost`. I'm going to defer that for now if that's ok. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82213





More information about the cfe-commits mailing list