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

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


wmi added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/MachineInstr.h:1805
+  PseudoProbeAttributes getPseudoProbeAttribute() const {
+    assert(isPseudoProbe());
+    return (PseudoProbeAttributes)getOperand(3).getImm();
----------------
Add an assertion message.


================
Comment at: llvm/include/llvm/CodeGen/MachineInstr.h:1810
+  void addPseudoProbeAttribute(PseudoProbeAttributes Attr) {
+    assert(isPseudoProbe());
+    MachineOperand &AttrOperand = getOperand(3);
----------------
Add an assertion message.


================
Comment at: llvm/include/llvm/CodeGen/MachineInstr.h:1812-1814
+    uint32_t OrigAttr = AttrOperand.getImm();
+    OrigAttr |= (uint32_t)Attr;
+    AttrOperand.setImm(OrigAttr);
----------------
Nit: AttrOperand.setImm(AttrOperand.getImm() | (uint32_t)Attr);


================
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
----------------
Can it stop when MII equals to FirstInstr? Otherwise will the moved pseudo probe be removed and inserted before FirstInstr again?


================
Comment at: llvm/lib/CodeGen/PseudoProbeInserter.cpp:110
+          if (MI.isPseudoProbe())
+            MI.addPseudoProbeAttribute(PseudoProbeAttributes::Dangling);
+        }
----------------
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?


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