Commit Graph

8 Commits

Author SHA1 Message Date
Zequan Wu 9caa3fbe03 [Coverage] Add empty line regions to SkippedRegions
Differential Revision: https://reviews.llvm.org/D84988
2020-09-21 12:42:53 -07:00
Rong Xu 9837ef56b4 [PGO] cc1 option name change for profile instrumentation
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
2016-02-04 18:39:09 +00:00
Justin Bogner bf42cfd75f InstrProf: Rewrite most of coverage mapping generation in a simpler way
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
2015-02-18 21:24:51 +00:00
Justin Bogner 4da909b2b2 InstrProf: Remove CoverageMapping::HasCodeBefore, it isn't used
llvm-svn: 228035
2015-02-03 21:35:49 +00:00
Justin Bogner f59329b083 InstrProf: Avoid repeated linear searches in a hot path
When generating coverage regions, we were doing a linear search
through the existing regions in order to try to merge related ones.
Most of the time this would find what it was looking for in a small
number of steps and it wasn't a big deal, but in cases with many
regions and few mergeable ones this leads to an absurd compile time
regression.

This changes the coverage mapping logic to do a single sort and then
merge as we go, which is a bit simpler and about 100 times faster.
I've also added FIXMEs on a couple of behaviours that seem a little
suspect, while keeping them behaving as they were - I'll look into
these soon.

The test changes here are mostly tedious reorganization, because the
ordering of regions we output has become slightly (but not completely)
more consistent from the almost completely arbitrary ordering we got
before.

llvm-svn: 218738
2014-10-01 03:33:52 +00:00
Alex Lorenz 34ac9b5e25 Add tests for coverage mapping generation.
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
2014-08-19 17:32:30 +00:00
Justin Bogner 6f147a0966 Revert a failing test from r215261
The (new) CoverageMapping/macroparams.c test is failing on a number of
buildbots. Reverting it until Alex can investigate and fix the test.

llvm-svn: 215274
2014-08-09 01:40:59 +00:00
Alex Lorenz c4ea74a719 Add tests for coverage mapping generation.
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
2014-08-08 23:49:58 +00:00