[PATCH] D83743: [InlineAdvisor] New inliner advisor to replay inlining from optimization remarks

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 11:43:17 PDT 2020


wenlei marked 3 inline comments as done.
wenlei added inline comments.


================
Comment at: llvm/lib/Analysis/ReplayInlineAdvisor.cpp:59-79
+  std::ostringstream CallSiteLoc;
+  auto DLoc = CB.getDebugLoc();
+  bool First = true;
+  for (DILocation *DIL = DLoc.get(); DIL; DIL = DIL->getInlinedAt()) {
+    if (!First)
+      CallSiteLoc << " @ ";
+    // Note that negative line offset is actually possible, but we use
----------------
wmi wrote:
> Can we extract this part to a function? I think it can be reused by other types of InlineAdvisor, for tuning purpose for example.
Sure, done.


================
Comment at: llvm/test/Transforms/SampleProfile/Inputs/inline-replay.txt:2
+remark: calls.cc:10:0: _Z3sumii inlined into main to match profiling context with (cost=45, threshold=337) at callsite main:3.1
+remark: calls.cc:4:0: _Z3subii inlined into main to match profiling context with (cost=-5, threshold=337) at callsite sum:1 @ main:3.1
----------------
wmi wrote:
> Why it is sum:1 instead of _Z3sumii:1 @ main:3.1?
Oh, this has to do with the contrived `!dbg` metadata where `linkageName` was missing. Changed both the remarks here and `!dbg` to include mangle names now. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83743





More information about the llvm-commits mailing list