================ @@ -78,32 +97,15 @@ YAMLProfileWriter::convert(const BinaryFunction &BF, bool UseDFS) { if (!ICSP) continue; for (const IndirectCallProfile &CSP : ICSP.get()) { - StringRef TargetName = ""; - CSI.DestId = 0; // designated for unknown functions - CSI.EntryDiscriminator = 0; - if (CSP.Symbol) { - const BinaryFunction *Callee = BC.getFunctionForSymbol(CSP.Symbol); - if (Callee) { - CSI.DestId = Callee->getFunctionNumber(); - TargetName = Callee->getOneName(); - } - } + const BinaryFunction *Callee = setCSIDestination(BC, CSI, CSP.Symbol); CSI.Count = CSP.Count; CSI.Mispreds = CSP.Mispreds; - CSTargets.emplace_back(TargetName, CSI); + if (CSI.Count && Callee) ---------------- aaupov wrote:
Good catch. I don't intend to change the behavior here, will fix. https://github.com/llvm/llvm-project/pull/82128 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits