mbenfield created this revision.
mbenfield added reviewers: rsmith, wmi.
Herald added a subscriber: wenlei.
mbenfield requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This option is necessary for effective AutoFDO, and it also seems that
the `create_llvm_prof` converter won't work if the binary is compiled
without it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101937

Files:
  clang/docs/UsersManual.rst


Index: clang/docs/UsersManual.rst
===================================================================
--- clang/docs/UsersManual.rst
+++ clang/docs/UsersManual.rst
@@ -1911,14 +1911,16 @@
 usual build cycle when using sample profilers for optimization:
 
 1. Build the code with source line table information. You can use all the
-   usual build flags that you always build your application with. The only
-   requirement is that you add ``-gline-tables-only`` or ``-g`` to the
-   command line. This is important for the profiler to be able to map
-   instructions back to source line locations.
+   usual build flags that you always build your application with. There are two
+   flags you must use. The first is ``-gline-tables-only`` or ``-g``. This is
+   important for the profiler to be able to map instructions back to source 
line
+   locations. The second is ``-fdebug-info-for-profiling``. This will add
+   discriminators so that different expressions on the same source line can be
+   distinguished, as well as some other changes making profiling more 
effective.
 
    .. code-block:: console
 
-     $ clang++ -O2 -gline-tables-only code.cc -o code
+     $ clang++ -O2 -fdebug-info-for-profiling -gline-tables-only code.cc -o 
code
 
 2. Run the executable under a sampling profiler. The specific profiler
    you use does not really matter, as long as its output can be converted


Index: clang/docs/UsersManual.rst
===================================================================
--- clang/docs/UsersManual.rst
+++ clang/docs/UsersManual.rst
@@ -1911,14 +1911,16 @@
 usual build cycle when using sample profilers for optimization:
 
 1. Build the code with source line table information. You can use all the
-   usual build flags that you always build your application with. The only
-   requirement is that you add ``-gline-tables-only`` or ``-g`` to the
-   command line. This is important for the profiler to be able to map
-   instructions back to source line locations.
+   usual build flags that you always build your application with. There are two
+   flags you must use. The first is ``-gline-tables-only`` or ``-g``. This is
+   important for the profiler to be able to map instructions back to source line
+   locations. The second is ``-fdebug-info-for-profiling``. This will add
+   discriminators so that different expressions on the same source line can be
+   distinguished, as well as some other changes making profiling more effective.
 
    .. code-block:: console
 
-     $ clang++ -O2 -gline-tables-only code.cc -o code
+     $ clang++ -O2 -fdebug-info-for-profiling -gline-tables-only code.cc -o code
 
 2. Run the executable under a sampling profiler. The specific profiler
    you use does not really matter, as long as its output can be converted
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to