Skip to content

Commit 7fcd8de

Browse files
committed
[Clang][Driver][SamplePGO] Enable -fsample-profile-use-profi by default for SamplePGO
1 parent d433134 commit 7fcd8de

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
@@ -6282,7 +6282,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
62826282

62836283
if (getLastProfileSampleUseArg(Args) &&
62846284
Args.hasFlag(options::OPT_fsample_profile_use_profi,
6285-
options::OPT_fno_sample_profile_use_profi, false)) {
6285+
options::OPT_fno_sample_profile_use_profi, true)) {
62866286
CmdArgs.push_back("-mllvm");
62876287
CmdArgs.push_back("-sample-profile-use-profi");
62886288
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
/// Ensure that profi flag is disabled by default
33

44
// Target specific checks:
5-
// RUN: %clang --target=x86_64 -c -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s --check-prefixes=CHECK-NO-PROFI
6-
// RUN: %clang --target=AArch64 -c -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s --check-prefixes=CHECK-NO-PROFI
5+
// RUN: %clang --target=x86_64 -c -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
6+
// RUN: %clang --target=AArch64 -c -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
77

88
// Target agnostic checks:
9-
// RUN: %clang -c -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s --check-prefixes=CHECK-NO-PROFI
9+
// RUN: %clang -c -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
1010
// RUN: %clang -c -fsample-profile-use-profi -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
1111
// RUN: %clang -c -fno-sample-profile-use-profi -fsample-profile-use-profi -fprofile-sample-use=/dev/null -### %s 2>&1 | FileCheck %s
1212

0 commit comments

Comments
 (0)