[PATCH] D86499: [CSSPGO] Pseudo probe instrumentation pass

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 21:02:21 PDT 2020


wmi added inline comments.


================
Comment at: llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h:36
+/// Insert pseudo probes for block sampling and value sampling.
+class SampleProfileProber {
+public:
----------------
Will the class be used in files other than SampleProfileProbe.cpp? If not, it is better to be placed in SampleProfileProbe.cpp. 


================
Comment at: llvm/lib/Transforms/IPO/SampleProfileProbe.cpp:73-76
+    Instruction *J = &*BB->getFirstInsertionPt();
+    while (J != BB->getTerminator() && !HasValidDbgLine(J)) {
+      J = J->getNextNode();
+    }
----------------
Can we add a stat support here to see how frequent the probe cannot find an instruction with valid dbgline?  Even if no instruction with valid dbgline can be found, is it possible to create a dbgline for it and set the line number to 0 or to the function start (I assume line number is of no use. Only the inline context matters here)? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86499



More information about the llvm-commits mailing list