[PATCH] D97481: [CSSPGO] Unblocking optimizations by dangling pseudo probes.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 21:23:37 PST 2021


hoy added a comment.

In D97481#2589255 <https://reviews.llvm.org/D97481#2589255>, @wmi wrote:

> A general question, do we care about where we should put dangling probe? Currently dangling probes are scattered in some predecessor/successor blocks they don't belong to. Looks like they can be anywhere. Wondering whether it is better to collect all of them to some place (entry block?). I am not sure about it either. Just want to know what you think.

That's a very good question. We don't care about where a dangling probe is placed technically. But in reality placing dangling probes around the original place they are from helps IR readability. It can help reason about why they are dangled.



================
Comment at: llvm/include/llvm/CodeGen/MachineBasicBlock.h:674
   /// or end().
-  iterator getFirstNonDebugInstr();
-  const_iterator getFirstNonDebugInstr() const {
-    return const_cast<MachineBasicBlock *>(this)->getFirstNonDebugInstr();
+  iterator getFirstNonDebugInstr(bool SkipPseudoOp = false);
+  const_iterator getFirstNonDebugInstr(bool SkipPseudoOp = false) const {
----------------
wmi wrote:
> In which case SkipPseudoOp needs to be true and which case to be false?
Good question. `SkipPseudoOp` should be true when we are sure that the probes should not be ignored. For example, we don't want to merge blocks that look the same except for their pseudo probes because the merge will make it hard to infer the counts for the original edges. On the contrary, `SkipPseudoOp` should be false when we are sure probes are movable or removable. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97481



More information about the llvm-commits mailing list