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

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 10:46:44 PDT 2020


wmi 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
----------------
Can we extract this part to a function? I think it can be reused by other types of InlineAdvisor, for tuning purpose for example.


================
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
----------------
Why it is sum:1 instead of _Z3sumii:1 @ main:3.1?


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