Reapply r281276 with passing -emit-llvm in one of the tests
authorAdam Nemet <anemet@apple.com>
Tue, 13 Sep 2016 04:32:40 +0000 (04:32 +0000)
committerAdam Nemet <anemet@apple.com>
Tue, 13 Sep 2016 04:32:40 +0000 (04:32 +0000)
commit1eea3e577d2fce03d8b2d697786591a982f10d15
tree455e66fa3d5187d66a5fa450ed0367d1a763c732
parentd97d5a2cee684e6e03006bb87a58a9acefe36375
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

llvm-svn: 281293
clang/docs/UsersManual.rst
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/include/clang/Driver/Options.td
clang/include/clang/Frontend/CodeGenOptions.def
clang/lib/CodeGen/CodeGenAction.cpp
clang/lib/Driver/Tools.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/Frontend/Inputs/optimization-remark-with-hotness.proftext [new file with mode: 0644]
clang/test/Frontend/optimization-remark-with-hotness.c [new file with mode: 0644]