Add an option to emit limited coverage info for unused decls. It's just a
cl::opt for now to allow us to experiment quickly.
When building llc, this results in an 84% size reduction in the llvm_covmap
section, and a similar size reduction in the llvm_prf_names section. In
practice I expect the size reduction to be roughly quadratic with the size of
the program.
The downside is that coverage for headers will no longer be complete. This will
make the line/function/region coverage metrics incorrect, since they will be
artificially high. One mitigation would be to somehow disable those metrics
when using limited-coverage=true.
This is related to: llvm.org/PR34533 (make SourceBasedCodeCoverage scale)
Differential Revision: https://reviews.llvm.org/D38107
llvm-svn: 314002
This patch changes cc1 option -fprofile-instr-generate to an enum option
-fprofile-instrument={clang|none}. It also changes cc1 options
-fprofile-instr-generate= to -fprofile-instrument-path=.
The driver level option -fprofile-instr-generate and -fprofile-instr-generate=
remain intact. This change will pave the way to integrate new PGO
instrumentation in IR level.
Review: http://reviews.llvm.org/D16730
llvm-svn: 259811
The coverage mapping generation code previously generated a large
number of redundant coverage regions and then tried to merge similar
ones back together. This then relied on some awkward heuristics to
prevent combining of regions that were importantly different but
happened to have the same count. The end result was inefficient and
hard to follow.
Now, we more carefully create the regions we actually want. This makes
it much easier to create regions at precise locations as well as
making the basic approach quite a bit easier to follow. There's still
a fair bit of complexity here dealing with included code and macro
expansions, but that's pretty hard to avoid without significantly
reducing the quality of data we provide.
I had to modify quite a few tests where the source ranges became more
precise or the old ranges seemed to be wrong anyways, and I've added
quite a few new tests since a large number of constructs didn't seem
to be tested before.
llvm-svn: 229748
Change the lit RUN commands for 3 tests to use the following pattern
"FileCheck -input-file ..." instead of "cat ... | FileCheck ..." as
suggested by Justin Bogner.
llvm-svn: 216085
This patch adds the tests for the coverage mapping generation.
Most of the tests check the mapping regions produced by
the generator, and one checks the llvm IR.
Differential Revision: http://reviews.llvm.org/D4847
llvm-svn: 215995
I reverted one of the added tests from r215261 in r215274, since it
was failing on quite a few bots. It looks like this wasn't sufficient,
as we're still getting failures on windows, like the following:
http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/5378
I'm reverting this entire commit so the bots aren't blocked on these
failures.
This reverts commit r215261.
llvm-svn: 215278
This patch adds the tests for the coverage mapping generation.
Most of the tests check the mapping regions produced by
the generator, and one checks the llvm IR.
Differential Revision: http://reviews.llvm.org/D4793
llvm-svn: 215261