[PATCH] D159507: [BOLT] Fix AutoFDO output format after D154120

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 11:48:30 PDT 2023


Amir created this revision.
Amir added a reviewer: bolt.
Herald added subscribers: wlei, treapster, ayermolo, wenlei.
Herald added a reviewer: rafauler.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

AutoFDO profile has no leading 0x in hex dumps.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159507

Files:
  bolt/lib/Profile/DataAggregator.cpp


Index: bolt/lib/Profile/DataAggregator.cpp
===================================================================
--- bolt/lib/Profile/DataAggregator.cpp
+++ bolt/lib/Profile/DataAggregator.cpp
@@ -398,18 +398,18 @@
 
   OutFile << FallthroughLBRs.size() << "\n";
   for (const auto &[Trace, Info] : FallthroughLBRs) {
-    OutFile << formatv("{0:x}-{1:x}:{2}\n", filterAddress(Trace.From),
+    OutFile << formatv("{0:x-}-{1:x-}:{2}\n", filterAddress(Trace.From),
                        filterAddress(Trace.To),
                        Info.InternCount + Info.ExternCount);
   }
 
   OutFile << BasicSamples.size() << "\n";
   for (const auto [PC, HitCount] : BasicSamples)
-    OutFile << formatv("{0:x}:{1}\n", filterAddress(PC), HitCount);
+    OutFile << formatv("{0:x-}:{1}\n", filterAddress(PC), HitCount);
 
   OutFile << BranchLBRs.size() << "\n";
   for (const auto &[Trace, Info] : BranchLBRs) {
-    OutFile << formatv("{0:x}->{1:x}:{2}\n", filterAddress(Trace.From),
+    OutFile << formatv("{0:x-}->{1:x-}:{2}\n", filterAddress(Trace.From),
                        filterAddress(Trace.To), Info.TakenCount);
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159507.556600.patch
Type: text/x-patch
Size: 1127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230912/a00f4aaf/attachment.bin>


More information about the llvm-commits mailing list