Skip to content

Commit 432a871

Browse files
authored
Deprecate order file instrumentation (#121514)
1 parent 5ee8418 commit 432a871

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ defm pseudo_probe_for_profiling : BoolFOption<"pseudo-probe-for-profiling",
18901890
" pseudo probes for sample profiling">>;
18911891
def forder_file_instrumentation : Flag<["-"], "forder-file-instrumentation">,
18921892
Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
1893-
HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
1893+
HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var). Deprecated, please use temporal profiling.">;
18941894
def fprofile_list_EQ : Joined<["-"], "fprofile-list=">,
18951895
Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
18961896
HelpText<"Filename defining the list of functions/files to instrument. "

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
80108010
}
80118011
}
80128012

8013-
if (Args.hasArg(options::OPT_forder_file_instrumentation)) {
8014-
CmdArgs.push_back("-forder-file-instrumentation");
8015-
// Enable order file instrumentation when ThinLTO is not on. When ThinLTO is
8016-
// on, we need to pass these flags as linker flags and that will be handled
8017-
// outside of the compiler.
8018-
if (!IsUsingLTO) {
8019-
CmdArgs.push_back("-mllvm");
8020-
CmdArgs.push_back("-enable-order-file-instrumentation");
8021-
}
8013+
if (const Arg *A =
8014+
Args.getLastArg(options::OPT_forder_file_instrumentation)) {
8015+
D.Diag(diag::warn_drv_deprecated_arg)
8016+
<< A->getAsString(Args) << /*hasReplacement=*/true
8017+
<< "-mllvm -pgo-temporal-instrumentation";
8018+
CmdArgs.push_back("-forder-file-instrumentation");
8019+
// Enable order file instrumentation when ThinLTO is not on. When ThinLTO is
8020+
// on, we need to pass these flags as linker flags and that will be handled
8021+
// outside of the compiler.
8022+
if (!IsUsingLTO) {
8023+
CmdArgs.push_back("-mllvm");
8024+
CmdArgs.push_back("-enable-order-file-instrumentation");
8025+
}
80228026
}
80238027

80248028
if (Arg *A = Args.getLastArg(options::OPT_fforce_enable_int128,

clang/test/Driver/clang_f_opts.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@
364364
// RUN: -fno-devirtualize-speculatively \
365365
// RUN: -fslp-vectorize-aggressive \
366366
// RUN: -fno-slp-vectorize-aggressive \
367+
// RUN: -forder-file-instrumentation \
367368
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s
368369
// CHECK-WARNING-DAG: optimization flag '-finline-limit=1000' is not supported
369370
// CHECK-WARNING-DAG: optimization flag '-finline-limit' is not supported
@@ -423,6 +424,7 @@
423424
// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize-speculatively' is not supported
424425
// CHECK-WARNING-DAG: the flag '-fslp-vectorize-aggressive' has been deprecated and will be ignored
425426
// CHECK-WARNING-DAG: the flag '-fno-slp-vectorize-aggressive' has been deprecated and will be ignored
427+
// CHECK-WARNING-DAG: argument '-forder-file-instrumentation' is deprecated, use '-mllvm -pgo-temporal-instrumentation' instead
426428

427429
// Test that we mute the warning on these
428430
// RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument \

0 commit comments

Comments
 (0)