[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:39 PDT 2024


================
@@ -96,6 +101,42 @@ class YAMLProfileReader : public ProfileReaderBase {
         YamlBFAdjacencyMap;
   };
 
+  // A class for matching inline tree nodes between profile and binary.
+  class InlineTreeNodeMapTy {
+    DenseMap<uint32_t, const MCDecodedPseudoProbeInlineTree *> Map;
+
+    void mapInlineTreeNode(uint32_t ProfileNode,
+                           const MCDecodedPseudoProbeInlineTree *BinaryNode) {
+      auto Res = Map.try_emplace(ProfileNode, BinaryNode);
----------------
wlei-llvm wrote:

nit: perhaps use `[[maybe_unused]]` to avoid the `(void)Res;` line

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


More information about the llvm-branch-commits mailing list