[PATCH] D153588: [Pseudo Probe] Remove the assert of allowing only one call probe for a callsite.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 16:41:39 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGabe34ce4e3ba: [Pseudo Probe] Remove the assert of allowing only one call probe for a callsite. (authored by hoy).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153588

Files:
  llvm/lib/MC/MCPseudoProbe.cpp


Index: llvm/lib/MC/MCPseudoProbe.cpp
===================================================================
--- llvm/lib/MC/MCPseudoProbe.cpp
+++ llvm/lib/MC/MCPseudoProbe.cpp
@@ -584,10 +584,20 @@
   const MCDecodedPseudoProbe *CallProbe = nullptr;
   for (const auto &Probe : Probes) {
     if (Probe.isCall()) {
-      assert(!CallProbe &&
-             "There should be only one call probe corresponding to address "
-             "which is a callsite.");
+      // Disabling the assert and returning first call probe seen so far.
+      // Subsequent call probes, if any, are ignored. Due to the the way
+      // .pseudo_probe section is decoded, probes of the same-named independent
+      // static functions are merged thus multiple call probes may be seen for a
+      // callsite. This should only happen to compiler-generated statics, with
+      // -funique-internal-linkage-names where user statics get unique names.
+      //
+      // TODO: re-enable or narrow down the assert to static functions only.
+      //
+      // assert(!CallProbe &&
+      //        "There should be only one call probe corresponding to address "
+      //        "which is a callsite.");
       CallProbe = &Probe;
+      break;
     }
   }
   return CallProbe;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153588.534122.patch
Type: text/x-patch
Size: 1254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230623/aedd8df6/attachment.bin>


More information about the llvm-commits mailing list