[llvm-branch-commits] [llvm] [BOLT] Add pseudo probe inline tree to YAML profile (PR #107137)
Lei Wang via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Sep 11 17:35:42 PDT 2024
================
@@ -58,8 +60,164 @@ const BinaryFunction *YAMLProfileWriter::setCSIDestination(
return nullptr;
}
+std::vector<YAMLProfileWriter::InlineTreeNode>
+YAMLProfileWriter::getInlineTree(const MCPseudoProbeDecoder &Decoder,
+ const MCDecodedPseudoProbeInlineTree *Root) {
+ auto getHash = [&](const MCDecodedPseudoProbeInlineTree &Node) {
+ return Decoder.getFuncDescForGUID(Node.Guid)->FuncHash;
+ };
+ assert(Root);
+ std::vector<InlineTreeNode> InlineTree;
+ InlineTreeNode Node{Root, Root->Guid, getHash(*Root), 0, 0};
+ InlineTree.emplace_back(Node);
----------------
wlei-llvm wrote:
nit: InlineTree.emplace_back(Root, Root->Guid, ...), same to the one below
https://github.com/llvm/llvm-project/pull/107137
More information about the llvm-branch-commits
mailing list