[PATCH] D86490: [CSSPGO] IR instrinsic for pseudo-probe block instrumentation

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 14:51:19 PDT 2020


davidxl added a comment.
Herald added a subscriber: dexonsmith.

How about inline cost analysis? It needs to skip the new instructions. Similarly for the Partial inliner, the static cost of this should be set to zero.



================
Comment at: llvm/include/llvm/IR/BasicBlock.h:185
+  /// PHINode, a debug intrinsic, or a pseudo probe intrinsic.
+  const Instruction *getFirstNonPHIOrDbgOrPseudoProbe() const;
+  Instruction *getFirstNonPHIOrDbgOrPseudoProbe() {
----------------
Is it possible to also need to skip both PseudoProbe and Lifetime Markers?


================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:2239
     BasicBlock::iterator BI = BB->begin();
-    while (isa<DbgInfoIntrinsic>(BI)) ++BI;
+    while (isa<DbgInfoIntrinsic>(BI) || isa<PseudoProbeInst>(BI))
+      ++BI;
----------------
Perhaps introduce a helper function to skip non-code instructions


================
Comment at: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:240
       CallInst *CI = dyn_cast<CallInst>(&I);
-      if (!CI || CI->isTailCall() || isa<DbgInfoIntrinsic>(&I))
+      // A PseudoProbeInst does access memory and will be marked as a tail call
+      // if we don't bail out here.
----------------
why does it access memory?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86490



More information about the llvm-commits mailing list