================
@@ -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)
----------------
maksfb wrote:

Previously, we would record data for unknown destinations, but now we are 
ignoring those. Not sure if it matters in practice. But if we are going to 
ignore them, the code that could be simplified/refactored.

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

Reply via email to