[llvm-branch-commits] [llvm] [BOLT] Match blocks with pseudo probes (PR #99891)

Lei Wang via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Sep 18 11:28:38 PDT 2024


================
@@ -722,6 +770,15 @@ Error YAMLProfileReader::readProfile(BinaryContext &BC) {
     }
   }
 
+  if (opts::StaleMatchingWithPseudoProbes) {
+    const MCPseudoProbeDecoder *Decoder = BC.getPseudoProbeDecoder();
+    assert(Decoder &&
+           "If pseudo probes are in use, pseudo probe decoder should exist");
+    for (const MCDecodedPseudoProbeInlineTree &TopLev :
+         Decoder->getDummyInlineRoot().getChildren())
+      TopLevelGUIDToInlineTree[TopLev.Guid] = &TopLev;
+  }
+
----------------
wlei-llvm wrote:

How about moving this code near to where it's used, i.e the `matchWeightsByHashes`. It seems the ` ... BC.getPseudoProbeDecoder() ...` can be shared there.

https://github.com/llvm/llvm-project/pull/99891


More information about the llvm-branch-commits mailing list