[PATCH] D95962: [CSSPGO] Introducing dangling pseudo probes.

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 22:56:12 PST 2021


wmi added inline comments.


================
Comment at: llvm/lib/CodeGen/PseudoProbeInserter.cpp:87
+        auto MII = MBB.rbegin();
+        while (MII != MBB.rend()) {
+          // Skip all pseudo probes followed by a real instruction since they
----------------
hoy wrote:
> wmi wrote:
> > Can it stop when MII equals to FirstInstr? Otherwise will the moved pseudo probe be removed and inserted before FirstInstr again?
> Yes, it can stop. Note that `FirstInstr` is not a probe but a real instruction. When MII equals to it, the `break` below will be run. 
Ah, I see. 


================
Comment at: llvm/lib/CodeGen/PseudoProbeInserter.cpp:110
+          if (MI.isPseudoProbe())
+            MI.addPseudoProbeAttribute(PseudoProbeAttributes::Dangling);
+        }
----------------
hoy wrote:
> wmi wrote:
> > It set all the pseudo probes in MBB to dangling. For DirectCall/IndirectCall types of pseudo probe, they are used to represent inline stack. Do they need to be set to dangling?
> DirectCalls/IndirectCalls are real call instructions and can be sampled correctly. If there are calls in the block, other types of probes will not be considered dangling.
If the call is inlined, will the DirectCall be left in the block? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95962



More information about the llvm-commits mailing list