diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-10-02 16:04:03 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-10-02 16:04:03 +0000 |
commit | d6a9e4b3bea625545cebdcd6247e78a922211a9d (patch) | |
tree | f04b0fc4b9b2f70a81ec03a2f0869dcbc04cb6d0 /clang/lib/CodeGen/CoverageMappingGen.cpp | |
parent | 51d1c74d78913adc409fb0727341d1f7637428bf (diff) | |
download | bcm5719-llvm-d6a9e4b3bea625545cebdcd6247e78a922211a9d.tar.gz bcm5719-llvm-d6a9e4b3bea625545cebdcd6247e78a922211a9d.zip |
InstrProf: Don't keep a large sparse list around just to zero it
The Terms vector here represented a polynomial of of all possible
counters, and is used to simplify expressions when generating coverage
mapping. There are a few problems with this:
1. Keeping the vector as a member is wasteful, since we clear it every
time we use it.
2. Most expressions refer to a subset of the counters, so we end up
iterating over a large number of zeros doing nothing a lot of the
time.
This updates the user of the vector to store the terms locally, and
uses a sort and combine approach so that we only operate on counters
that are actually used in a given expression. For small cases this
makes very little difference, but in cases with a very large number of
counted regions this is a significant performance fix.
llvm-svn: 218879
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.cpp')
0 files changed, 0 insertions, 0 deletions