Commit Graph

10 Commits

Author SHA1 Message Date
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 1d45c5bc26 Coverage Mapping: store function's hash in coverage function records.
The profile data format was recently updated and the new indexing api
requires the code coverage tool to know the function's hash as well
as the function's name to get the execution counts for a function.

Differential Revision: http://reviews.llvm.org/D4995

llvm-svn: 216208
2014-08-21 19:25:27 +00:00
Alex Lorenz e3b04a9f3b Test: CoverageMapping: use "RUN: FileCheck" command instead of "RUN: cat | Filecheck".
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
2014-08-20 17:29:47 +00:00
Alex Lorenz fdd769e847 Coverage mapping: fix mapping for objective-c for statement
llvm-svn: 216082
2014-08-20 17:11:53 +00:00
Alex Lorenz 01a0d062aa Coverage mapping: fix mapping for objective-c message expression
llvm-svn: 216081
2014-08-20 17:10:56 +00:00
Alex Lorenz b5f3a844a7 Test: Coverage Mapping: add missing RUN commands
Add the llvm-lit RUN commands for the two coverage mapping tests
that filecheck a temporary file.

llvm-svn: 216020
2014-08-19 20:51:54 +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 a0101074fd Revert "Add tests for coverage mapping generation."
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
2014-08-09 03:55:09 +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