diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst index 12c2ada062625..5745e4b38b826 100644 --- a/clang/docs/UsersManual.rst +++ b/clang/docs/UsersManual.rst @@ -2778,7 +2778,7 @@ usual build cycle when using sample profilers for optimization: > clang-cl /O2 -gdwarf -gline-tables-only ^ /clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^ - code.cc /Fe:code /fuse-ld=lld /link /debug:dwarf + code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf .. note:: @@ -2861,13 +2861,15 @@ usual build cycle when using sample profilers for optimization: that executes faster than the original one. Note that you are not required to build the code with the exact same arguments that you used in the first step. The only requirement is that you build the code - with the same debug info options and ``-fprofile-sample-use``. + with the same debug info options and ``-fprofile-sample-use``. ``-gdwarf`` + and ``-gline-tables-only`` can be omitted if you do not need debug info + in the final binary. On Linux: .. code-block:: console - $ clang++ -O2 -gline-tables-only \ + $ clang++ -O2 \ -fdebug-info-for-profiling -funique-internal-linkage-names \ -fprofile-sample-use=code.prof code.cc -o code @@ -2875,9 +2877,9 @@ usual build cycle when using sample profilers for optimization: .. code-block:: winbatch - > clang-cl /O2 -gdwarf -gline-tables-only ^ + > clang-cl /O2 ^ /clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^ - -fprofile-sample-use=code.prof code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf + -fprofile-sample-use=code.prof code.cc /Fe:code [OPTIONAL] Sampling-based profiles can have inaccuracies or missing block/ edge counters. The profile inference algorithm (profi) can be used to infer @@ -2886,7 +2888,7 @@ usual build cycle when using sample profilers for optimization: .. code-block:: console - $ clang++ -fsample-profile-use-profi -O2 -gline-tables-only \ + $ clang++ -fsample-profile-use-profi -O2 \ -fdebug-info-for-profiling -funique-internal-linkage-names \ -fprofile-sample-use=code.prof code.cc -o code @@ -2894,9 +2896,9 @@ usual build cycle when using sample profilers for optimization: .. code-block:: winbatch - > clang-cl /clang:-fsample-profile-use-profi /O2 -gdwarf -gline-tables-only ^ + > clang-cl /clang:-fsample-profile-use-profi /O2 ^ /clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^ - -fprofile-sample-use=code.prof code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf + -fprofile-sample-use=code.prof code.cc /Fe:code Sample Profile Formats """"""""""""""""""""""