[PATCH] D95982: [CSSPGO] Unblock optimizations with pseudo probe instrumentation.

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 00:18:01 PST 2021


wmi added inline comments.


================
Comment at: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:805-809
     if (OtherMI.isDebugInstr())
       continue;
+    // Pseudo probe instructions cannot be counted against the limit.
+    if (OtherMI.isPseudoProbe())
+      continue;
----------------
Similar to IR pass, add a MachineInstr::isDebugOrPseudoInstr()?


================
Comment at: llvm/lib/Transforms/IPO/FunctionAttrs.cpp:152-157
+      // A pseudo probe call shouldn't change any function attribute since it
+      // doesn't translate to a real instruction. It comes with a memory access
+      // tag to prevent itself being removed by optimizations and not block
+      // other instructions being optimized.
+      if (isa<PseudoProbeInst>(I))
+        continue;
----------------
Make it a little more general?

  if (auto *CB = dyn_cast<CallBase>(I))
    if (CB->onlyAccessesInaccessibleMemory())
      continue;


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp:595
   for (++BBI; BBI != E; ++BBI)
-    if (BBI->mayWriteToMemory())
+    if (BBI->mayWriteToMemory() && !isa<PseudoProbeInst>(BBI))
       return false;
----------------
Make it a little more general in the same way as above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95982



More information about the llvm-commits mailing list