summaryrefslogtreecommitdiffstats
path: root/docs/UsersManual.rst
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2016-09-13 04:32:40 +0000
committerAdam Nemet <anemet@apple.com>2016-09-13 04:32:40 +0000
commit8a7af2f320b4136f51d211cfc47c785945abfb12 (patch)
treed7d9add7fb259f8ef7a5f553a305134fc8fc0cb2 /docs/UsersManual.rst
parente3a335ebd724f0ee206658bd19c571bdd5204c15 (diff)
Reapply r281276 with passing -emit-llvm in one of the tests
Original commit message: Add -fdiagnostics-show-hotness Summary: I've recently added the ability for optimization remarks to include the hotness of the corresponding code region. This uses PGO and allows filtering of the optimization remarks by relevance. The idea was first discussed here: http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334 The general goal is to produce a YAML file with the remarks. Then, an external tool could dynamically filter these by hotness and perhaps by other things. That said it makes sense to also expose this at the more basic level where we just include the hotness info with each optimization remark. For example, in D22694, the clang flag was pretty useful to measure the overhead of the additional analyses required to include hotness. (Without the flag we don't even run the analyses.) For the record, Hal has already expressed support for the idea of this patch on IRC. Differential Revision: https://reviews.llvm.org/D23284 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281293 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/UsersManual.rst')
-rw-r--r--docs/UsersManual.rst28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/UsersManual.rst b/docs/UsersManual.rst
index e9cc2d3868..1f1dd4fb7f 100644
--- a/docs/UsersManual.rst
+++ b/docs/UsersManual.rst
@@ -317,6 +317,28 @@ output format of the diagnostics that it generates.
by category, so it should be a high level category. We want dozens
of these, not hundreds or thousands of them.
+.. _opt_fdiagnostics-show-hotness:
+
+**-f[no-]diagnostics-show-hotness**
+ Enable profile hotness information in diagnostic line.
+
+ This option, which defaults to off, controls whether Clang prints the
+ profile hotness associated with a diagnostics in the presence of
+ profile-guided optimization information. This is currently supported with
+ optimization remarks (see :ref:`Options to Emit Optimization Reports
+ <rpass>`). The hotness information allows users to focus on the hot
+ optimization remarks that are likely to be more relevant for run-time
+ performance.
+
+ For example, in this output, the block containing the callsite of `foo` was
+ executed 3000 times according to the profile data:
+
+ ::
+
+ s.c:7:10: remark: foo inlined into bar (hotness: 3000) [-Rpass-analysis=inline]
+ sum += foo(x, x - 2);
+ ^
+
.. _opt_fdiagnostics-fixit-info:
**-f[no-]diagnostics-fixit-info**
@@ -535,6 +557,8 @@ control the crash diagnostics.
The -fno-crash-diagnostics flag can be helpful for speeding the process
of generating a delta reduced test case.
+.. _rpass:
+
Options to Emit Optimization Reports
------------------------------------
@@ -578,6 +602,10 @@ outside of the major transformations (e.g., inlining, vectorization,
loop optimizations) and not every optimization pass supports this
feature.
+Note that when using profile-guided optimization information, profile hotness
+information can be included in the remarks (see
+:ref:`-fdiagnostics-show-hotness <opt_fdiagnostics-show-hotness>`).
+
Current limitations
^^^^^^^^^^^^^^^^^^^