Skip to content

Commit f6aab30

Browse files
kazutakahirataDanielCChen
authored andcommitted
[llvm-profdata] Default to MemProf version 3 (llvm#108863)
It's very confusing to have support for Verion 3 but not default to it. This patch teaches llvm-profdata to use MemProf version 3 by default.
1 parent c0c30d1 commit f6aab30

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

llvm/test/tools/llvm-profdata/memprof-merge-versions.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ RUN: llvm-profdata show %t.prof.v3 | FileCheck %s
2525
RUN: llvm-profdata merge %t.proftext %p/Inputs/basic.memprofraw --memprof-version=3 --memprof-full-schema --profiled-binary %p/Inputs/basic.memprofexe -o %t.prof.v3
2626
RUN: llvm-profdata show %t.prof.v3 | FileCheck %s
2727

28+
Check to see if llvm-profdata produces V3 by default.
29+
RUN: llvm-profdata merge %t.proftext %p/Inputs/basic.memprofraw --memprof-full-schema --profiled-binary %p/Inputs/basic.memprofexe -o %t.prof.default
30+
RUN: cmp %t.prof.default %t.prof.v3
31+
2832
For now we only check the validity of the instrumented profile since we don't
2933
have a way to display the contents of the memprof indexed format yet.
3034

llvm/tools/llvm-profdata/llvm-profdata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ cl::opt<bool> DoWritePrevVersion(
332332
cl::opt<memprof::IndexedVersion> MemProfVersionRequested(
333333
"memprof-version", cl::Hidden, cl::sub(MergeSubcommand),
334334
cl::desc("Specify the version of the memprof format to use"),
335-
cl::init(memprof::Version0),
335+
cl::init(memprof::Version3),
336336
cl::values(clEnumValN(memprof::Version0, "0", "version 0"),
337337
clEnumValN(memprof::Version1, "1", "version 1"),
338338
clEnumValN(memprof::Version2, "2", "version 2"),

0 commit comments

Comments
 (0)