[clang] Improve documented sampling profiler steps to best known methods (PR #88438)
Tim Creech via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 27 14:15:41 PDT 2024
================
@@ -2547,22 +2547,40 @@ usual build cycle when using sample profilers for optimization:
used in the first step. The only requirement is that you build the code
with the same debug info options and ``-fprofile-sample-use``.
+ On Linux:
+
.. code-block:: console
$ clang++ -O2 -gline-tables-only \
-fdebug-info-for-profiling -funique-internal-linkage-names \
-fprofile-sample-use=code.prof code.cc -o code
- [OPTIONAL] Sampling-based profiles can have inaccuracies or missing block/
- edge counters. The profile inference algorithm (profi) can be used to infer
- missing blocks and edge counts, and improve the quality of profile data.
- Enable it with ``-fsample-profile-use-profi``.
+ On Windows:
- .. code-block:: console
+ .. code-block:: winbatch
+
+ > clang-cl -O2 -gdwarf -gline-tables-only ^
----------------
tcreech-intel wrote:
Good idea. I've updated the clang-cl examples to use cl-style forward-slash options when possible. There are still a few cases (`-gdwarf -gline-tables-only`) where only the hyphen version is understood, and also some cases (`/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names`) where the hyphen version is understood only with `/clang:`.
https://github.com/llvm/llvm-project/pull/88438
More information about the cfe-commits
mailing list