Skip to content

Commit 2fc4a4a

Browse files
authored
[Driver][SamplePGO] Enable -fsample-profile-use-profi (#146795)
Since profile inference improves sample coverage, it should be turned on by default.
1 parent 9337594 commit 2fc4a4a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6265,7 +6265,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
62656265

62666266
if (getLastProfileSampleUseArg(Args) &&
62676267
Args.hasFlag(options::OPT_fsample_profile_use_profi,
6268-
options::OPT_fno_sample_profile_use_profi, false)) {
6268+
options::OPT_fno_sample_profile_use_profi, true)) {
62696269
CmdArgs.push_back("-mllvm");
62706270
CmdArgs.push_back("-sample-profile-use-profi");
62716271
}

clang/test/Driver/pgo-sample-use-profi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/// Test if profi flag is enabled/disabled correctly based on user-specified configuration.
2-
/// Ensure that profi flag is disabled by default
2+
/// Ensure that profi flag is enabled by default
33

4-
// RUN: %clang --target=x86_64 -c -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s --check-prefixes=CHECK-NO-PROFI
4+
// RUN: %clang --target=x86_64 -c -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
55
// RUN: %clang --target=x86_64 -c -fsample-profile-use-profi -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
66
// RUN: %clang --target=x86_64 -c -fno-sample-profile-use-profi -fsample-profile-use-profi -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
77

8-
// RUN: %clang --target=AArch64 -c -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s --check-prefixes=CHECK-NO-PROFI
8+
// RUN: %clang --target=AArch64 -c -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
99
// RUN: %clang --target=AArch64 -c -fsample-profile-use-profi -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
1010
// RUN: %clang --target=AArch64 -c -fno-sample-profile-use-profi -fsample-profile-use-profi -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
1111

0 commit comments

Comments
 (0)