Skip to content

Commit 80f603d

Browse files
committed
rename flag again
1 parent c71ba78 commit 80f603d

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

clang/docs/UsersManual.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3035,7 +3035,7 @@ indexed format, regardeless whether it is produced by frontend or the IR pass.
30353035
overhead. ``prefer-atomic`` will be transformed to ``atomic`` when supported
30363036
by the target, or ``single`` otherwise.
30373037

3038-
.. option:: -fprofile-generate-temporal
3038+
.. option:: -ftemporal-profile
30393039

30403040
Enables the temporal profiling extension for IRPGO to improve startup time by
30413041
reducing ``.text`` section page faults. To do this, we instrument function
@@ -3046,23 +3046,23 @@ indexed format, regardeless whether it is produced by frontend or the IR pass.
30463046

30473047
.. code-block:: console
30483048
3049-
$ clang++ -O2 -fprofile-generate -fprofile-generate-temporal code.cc -o code
3049+
$ clang++ -O2 -fprofile-generate -ftemporal-profile code.cc -o code
30503050
$ ./code
30513051
$ llvm-profdata merge -o code.profdata yyy/zzz
30523052
3053-
Using the resulting profile, we can either generate a function order to pass
3054-
to the linker.
3053+
Using the resulting profile, we can generate a function order to pass to the
3054+
linker via `--symbol-ordering-file` for ELF or `-order_file` for Mach-O.
30553055

30563056
.. code-block:: console
30573057
30583058
$ llvm-profdata order code.profdata -o code.orderfile
30593059
$ clang++ -O2 -Wl,--symbol-ordering-file=code.orderfile code.cc -o code
30603060
3061-
Or it can be passed to the linker directly.
3061+
Or the profile can be passed to LLD directly.
30623062

30633063
.. code-block:: console
30643064
3065-
$ clang++ -O2 -Wl,--irpgo-profile=code.profdata,--bp-startup-sort=function code.cc -o code
3065+
$ clang++ -O2 -fuse-ld=lld -Wl,--irpgo-profile=code.profdata,--bp-startup-sort=function code.cc -o code
30663066
30673067
For more information, please read the RFC:
30683068
https://discourse.llvm.org/t/rfc-temporal-profiling-extension-for-irpgo/68068

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,7 +1796,7 @@ def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-co
17961796
def fprofile_generate_cold_function_coverage_EQ : Joined<["-"], "fprofile-generate-cold-function-coverage=">,
17971797
Group<f_Group>, Visibility<[ClangOption, CLOption]>, MetaVarName<"<directory>">,
17981798
HelpText<"Generate instrumented code to collect coverage info for cold functions into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1799-
def fprofile_generate_temporal : Flag<["-"], "fprofile-generate-temporal">,
1799+
def ftemporal_profile : Flag<["-"], "ftemporal-profile">,
18001800
Group<f_Group>, Visibility<[ClangOption, CLOption]>,
18011801
HelpText<"Generate instrumented code to collect temporal information">;
18021802
def fprofile_instr_generate : Flag<["-"], "fprofile-instr-generate">,
@@ -1894,7 +1894,7 @@ defm pseudo_probe_for_profiling : BoolFOption<"pseudo-probe-for-profiling",
18941894
" pseudo probes for sample profiling">>;
18951895
def forder_file_instrumentation : Flag<["-"], "forder-file-instrumentation">,
18961896
Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
1897-
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 -fprofile-generate-temporal">;
1897+
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 -ftemporal-profile">;
18981898
def fprofile_list_EQ : Joined<["-"], "fprofile-list=">,
18991899
Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
19001900
HelpText<"Filename defining the list of functions/files to instrument. "

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C,
662662
CmdArgs.push_back("--pgo-function-entry-coverage");
663663
}
664664

665-
if (auto *A = Args.getLastArg(options::OPT_fprofile_generate_temporal)) {
665+
if (auto *A = Args.getLastArg(options::OPT_ftemporal_profile)) {
666666
if (!PGOGenerateArg && !CSPGOGenerateArg)
667667
D.Diag(clang::diag::err_drv_argument_only_allowed_with)
668668
<< A->getSpelling() << "-fprofile-generate or -fcs-profile-generate";
@@ -8058,7 +8058,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
80588058
Args.getLastArg(options::OPT_forder_file_instrumentation)) {
80598059
D.Diag(diag::warn_drv_deprecated_arg)
80608060
<< A->getAsString(Args) << /*hasReplacement=*/true
8061-
<< "-fprofile-generate-temporal";
8061+
<< "-ftemporal-profile";
80628062
CmdArgs.push_back("-forder-file-instrumentation");
80638063
// Enable order file instrumentation when ThinLTO is not on. When ThinLTO is
80648064
// on, we need to pass these flags as linker flags and that will be handled

clang/test/Driver/clang_f_opts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@
424424
// CHECK-WARNING-DAG: optimization flag '-fno-devirtualize-speculatively' is not supported
425425
// CHECK-WARNING-DAG: the flag '-fslp-vectorize-aggressive' has been deprecated and will be ignored
426426
// 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 '-fprofile-generate-temporal' instead
427+
// CHECK-WARNING-DAG: argument '-forder-file-instrumentation' is deprecated, use '-ftemporal-profile' instead
428428

429429
// Test that we mute the warning on these
430430
// RUN: %clang -### -finline-limit=1000 -Wno-invalid-command-line-argument \
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %clang -### -c -fprofile-generate -fprofile-generate-temporal %s 2>&1 | FileCheck %s
2-
// RUN: %clang -### -c -fcs-profile-generate -fprofile-generate-temporal %s 2>&1 | FileCheck %s
3-
// RUN: not %clang -### -c -fprofile-generate-temporal %s 2>&1 | FileCheck %s --check-prefix=ERR
1+
// RUN: %clang -### -c -fprofile-generate -ftemporal-profile %s 2>&1 | FileCheck %s
2+
// RUN: %clang -### -c -fcs-profile-generate -ftemporal-profile %s 2>&1 | FileCheck %s
3+
// RUN: not %clang -### -c -ftemporal-profile %s 2>&1 | FileCheck %s --check-prefix=ERR
44

55
// CHECK: "-mllvm" "--pgo-temporal-instrumentation"
66

7-
// ERR: '-fprofile-generate-temporal' only allowed with '-fprofile-generate or -fcs-profile-generate'
7+
// ERR: error: invalid argument '-ftemporal-profile' only allowed with '-fprofile-generate or -fcs-profile-generate'

0 commit comments

Comments
 (0)