Skip to content

Commit d87441a

Browse files
authored
[llvm-profdata] Fix detailed summary format on Windows (#124169)
The detailed summary format was changed in #105915 which broke `llvm/test/tools/llvm-profdata/general.proftext` (XFAILed in #124165). Apparently the behavior of `%lu` is different between Linux and Windows, so I reverted back to using `<<` style formats.
1 parent 631a6e0 commit d87441a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

llvm/lib/IR/ProfileSummary.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,11 @@ void ProfileSummary::printSummary(raw_ostream &OS) const {
259259
void ProfileSummary::printDetailedSummary(raw_ostream &OS) const {
260260
OS << "Detailed summary:\n";
261261
for (const auto &Entry : DetailedSummary) {
262-
OS << format("%lu blocks (%.2f%%) with count >= %lu account for %0.6g%% of "
263-
"the total counts.\n",
264-
Entry.NumCounts,
265-
NumCounts ? (100.f * Entry.NumCounts / NumCounts) : 0,
266-
Entry.MinCount, 100.f * Entry.Cutoff / Scale);
262+
OS << Entry.NumCounts << " blocks "
263+
<< format("(%.2f%%)",
264+
NumCounts ? (100.f * Entry.NumCounts / NumCounts) : 0)
265+
<< " with count >= " << Entry.MinCount << " account for "
266+
<< format("%0.6g", 100.f * Entry.Cutoff / Scale)
267+
<< "% of the total counts.\n";
267268
}
268269
}

llvm/test/tools/llvm-profdata/general.proftext

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# FIXME: Somehow this is failing on windows after https://github.com/llvm/llvm-project/pull/105915
2-
# XFAIL: system-windows
31
# RUN: llvm-profdata merge -sparse=true %s -o %t.profdata
42

53
# RUN: llvm-profdata merge -sparse=false %s -o %t.profdata.dense

0 commit comments

Comments
 (0)