[clang] [clang][doc] Simplify Sampling-PGO use example (PR #162588)
Haohai Wen via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 9 18:10:22 PDT 2025
================
@@ -2861,21 +2861,23 @@ 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
On Windows:
.. 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
----------------
HaohaiWen wrote:
Good caught.
https://github.com/llvm/llvm-project/pull/162588
More information about the cfe-commits
mailing list