Commit Graph

165 Commits

Author SHA1 Message Date
Than McIntosh
002b63f0a3 [SampleFDO] add suffix elision control for fcn names
Summary:
Add hooks for determining the policy used to decide whether/how
to chop off symbol 'suffixes' when locating a given function
in a sample profile.

Prior to this change, any function symbols of the form "X.Y" were
elided/truncated into just "X" when looking up things in a sample
profile data file.

With this change, the policy on suffixes can be changed by adding a
new attribute "sample-profile-suffix-elision-policy" to the function:
this attribute can have the value "all" (the default), "selected", or
"none". A value of "all" preserves the previous behavior (chop off
everything after the first "." character, then treat that as the
symbol name). A value of "selected" chops off only the rightmost
".llvm.XXXX" suffix (where "XXX" is any string not containing a "."
char). A value of "none" indicates that names should be left as is.

Subscribers: jdoerfert, wmi, mtrofin, danielcdh, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58832

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356146 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-14 13:56:49 +00:00
Rong Xu
5af7fe31f4 [PGO] Context sensitive PGO (part 2)
Part 2 of CSPGO changes (mostly related to ProfileSummary).
Note that I use a default parameter in setProfileSummary() and getSummary().
This is to break the dependency in clang. I will make the parameter explicit
after changing clang in a separated patch.

Differential Revision: https://reviews.llvm.org/D54175


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355131 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-28 19:55:07 +00:00
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Simon Pilgrim
45e56bf063 Fix gcc7 -Wdangling-else warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349760 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-20 14:09:15 +00:00
Richard Smith
11acfd478b Fix use-after-free with profile remapping.
We need to keep the underlying profile reader alive as long as the
profile data, because the profile data may contain StringRefs referring
to strings in the reader's name table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349600 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-19 03:24:03 +00:00
Richard Smith
04af5ff3eb Support for remapping profile data when symbols change, for sample-based
profiling.

Reviewers: davidxl, tejohnson, dlj, erik.pilkington

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D51248

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344187 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-10 21:31:01 +00:00
Richard Smith
3b1e430b90 Support for remapping profile data when symbols change, for
instrumentation-based profiling.

Reviewers: davidxl, tejohnson, dlj, erik.pilkington

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D51247

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344184 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-10 21:09:37 +00:00
Alexander Kornienko
bb05e42b84 Use createTemporaryFile in SampleProfTest
Create a temporary file in the system temporary directory instead of creating a
file in the current directory, which may be not writable. (Fix for an issue
introduced in r342283.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342386 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-17 12:11:01 +00:00
Wei Mi
5455b4c499 Fix filesystem race issue in SampleProfTest introduced in rL342283.
Before this fix, multiple invocations of testRoundTrip will create multiple
writers which share the same file as output destination. That could introduce
filesystem race issue when multiple subtests are executed concurrently. This
patch assign writers with different files as their output destinations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342301 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-15 00:04:15 +00:00
Wei Mi
ec13dea9af [SampleFDO] Add FunctionOffsetTable in compact binary format profile.
The patch saves a function offset table which maps function name index to the
offset of its function profile to the start of the binary profile. By using
the function offset table, for those function profiles which will not be used
when compiling a module, the profile reader does't have to read them. For
profile size around 10~20M, it saves ~10% compile time.

Differential Revision: https://reviews.llvm.org/D51863



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342283 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-14 20:52:59 +00:00
Wei Mi
7253cd8580 [NFC] Change sample profile format enum name SPF_Raw_Binary to SPF_Binary.
Some out-of-tree targets depend on the enum name SPF_Binary. Keep the name
can avoid unnecessary churn to those targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334476 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12 05:53:49 +00:00
Wei Mi
93bc746824 [SampleFDO] Add a new compact binary format for sample profile.
Name table occupies a big chunk of size in current binary format sample profile.
In order to reduce its size, the patch changes the sample writer/reader to
save/restore MD5Hash of names in the name table. Sample annotation phase will
also use MD5Hash of name to query samples accordingly.

Experiment shows compact binary format can reduce the size of sample profile by
2/3 compared with binary format generally.

Differential Revision: https://reviews.llvm.org/D47955


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334447 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-11 22:40:43 +00:00
Max Moroz
c97ab8f1e3 [Coverage] Take filenames into account when loading function records.
Summary:
Don't skip functions with the same name but from different files.

That change makes it possible to generate code coverage reports from
different binaries compiled from different sources even if there are functions
with non-unique names. Without that change, code coverage for such functions is
missing except of the first function processed.

Reviewers: vsk, morehouse

Reviewed By: vsk

Subscribers: llvm-commits, kcc

Differential Revision: https://reviews.llvm.org/D46478

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331801 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-08 19:26:51 +00:00
Mandeep Singh Grang
77a1dcd15b [unittests] Change std::sort to llvm::sort in response to r327219
r327219 added wrappers to std::sort which randomly shuffle the container before
sorting.  This will help in uncovering non-determinism caused due to undefined
sorting order of objects having the same key.

To make use of that infrastructure we need to invoke llvm::sort instead of
std::sort.

Note: This patch is one of a series of patches to replace *all* std::sort to
llvm::sort.  Refer the comments section in D44363 for a list of all the
required patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329475 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-07 01:29:45 +00:00
Mircea Trofin
21d9c7a33c Revert "Revert "[InstrProf] Support for external functions in text format.""
Summary:
This reverts commit 364eb09576 and separates out
the portion that was fixing binary reader error propagation - turns out, there
are production cases where that causes a regression.

Will re-introduce the error propagation fix separately.

The fix to the text reader error propagation is still "in".

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D44807

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328244 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 21:26:52 +00:00
Benjamin Kramer
364eb09576 Revert "[InstrProf] Support for external functions in text format."
This reverts commit r328132. Breaks FDO selfhost. I'm seeing
error: /tmp/profraw: Invalid instrumentation profile data (bad magic)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328207 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 15:29:55 +00:00
Mircea Trofin
06b0783db1 [InstrProf] Encapsulates access to AddrToMD5Map.
Summary:
This fixes a unittest failure introduced by D44717

D44717 introduced lazy sorting of the internal data structures of the
symbol table. The AddrToMD5Map getter was potentially exposing
inconsistent (unsorted) state. We could sort in the accessor, however,
a client may store the pointer and thus bypass the internal state
management of the symbol table. The alternative in this CL blocks
direct access to the state, thus ensuring consistent
externally-observable state.

Reviewers: davidxl, xur, eraman

Reviewed By: xur

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D44757

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328163 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21 22:27:31 +00:00
Mircea Trofin
66677152d0 [InstrProf] Support for external functions in text format.
Summary:
External functions appearing as indirect call targets could not be
found in the SymTab, and the value:counter record was represented,
in the text format, using an empty string for the name. This would
then cause a silent parsing error when reading.

This CL:
- adds explicit support for such functions
- fixes the places where we would not propagate errors when reading
- addresses a performance issue due to eager resorting of the SymTab.

Reviewers: xur, eraman, davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D44717

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328132 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21 19:06:06 +00:00
Wei Mi
f53ccf3b4f [SampleFDO] Extend SampleProfReader to handle demangled names.
SampleProfReader assumes function names in the profile are all mangled names.
However, there are cases that few demangled names are somehow contained in
the profile (usually because of debug info problems), which may trigger parsing
error in SampleProfReader and cause the whole profile to be unusable. The patch
extends SampleProfReader to handle profiles with demangled names, so that those
profiles can still be useful.

Differential revision: https://reviews.llvm.org/D44161


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326905 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-07 16:45:33 +00:00
Michael Zolotukhin
16872e2b56 Remove redundant includes from unittests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320630 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 21:31:05 +00:00
Vedant Kumar
dea3d88348 [Coverage] Scan ahead for the most-recent completed count (PR35495)
This extends r319391. It teaches the segment builder to emit the right
completed segment when more than one region ends at the same location.

Fixes PR35495.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319990 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 00:01:15 +00:00
Shoaib Meenai
4a6bb5316a [CMake] Use PRIVATE in target_link_libraries for executables
We currently use target_link_libraries without an explicit scope
specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables.
Dependencies added in this way apply to both the target and its
dependencies, i.e. they become part of the executable's link interface
and are transitive.

Transitive dependencies generally don't make sense for executables,
since you wouldn't normally be linking against an executable. This also
causes issues for generating install export files when using
LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM
library dependencies, which are currently added as interface
dependencies. If clang is in the distribution components but the LLVM
libraries it depends on aren't (which is a perfectly legitimate use case
if the LLVM libraries are being built static and there are therefore no
run-time dependencies on them), CMake will complain about the LLVM
libraries not being in export set when attempting to generate the
install export file for clang. This is reasonable behavior on CMake's
part, and the right thing is for LLVM's build system to explicitly use
PRIVATE dependencies for executables.

Unfortunately, CMake doesn't allow you to mix and match the keyword and
non-keyword target_link_libraries signatures for a single target; i.e.,
if a single call to target_link_libraries for a particular target uses
one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must
also be updated to use those keywords. This means we must do this change
in a single shot. I also fully expect to have missed some instances; I
tested by enabling all the projects in the monorepo (except dragonegg),
and configuring both with and without shared libraries, on both Darwin
and Linux, but I'm planning to rely on the buildbots for other
configurations (since it should be pretty easy to fix those).

Even after this change, we still have a lot of target_link_libraries
calls that don't specify a scope keyword, mostly for shared libraries.
I'm thinking about addressing those in a follow-up, but that's a
separate change IMO.

Differential Revision: https://reviews.llvm.org/D40823



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 21:49:56 +00:00
Vedant Kumar
310bfccbbf [Coverage] Use the most-recent completed region count (PR35437)
This is a fix for the coverage segment builder.

If multiple regions must be popped off the active stack at once, and
more than one of them end at the same location, emit a segment using the
count from the most-recent completed region.

Fixes PR35437, rdar://35760630

Testing: invoked llvm-cov on a stage2 build of clang, additional unit
tests, check-profile

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319391 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 00:28:23 +00:00
Vedant Kumar
f361756cf3 [Coverage] Use the wrapped segment when a line has entry segments
We've worked around bugs in the frontend by ignoring the count from
wrapped segments when a line has at least one region entry segment.
Those frontend bugs are now fixed, so it's time to regenerate the
checked-in covmapping files and remove the workaround.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317761 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09 02:33:43 +00:00
Vedant Kumar
120c3be2ad [Coverage] Simplify r316141. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316147 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 06:16:23 +00:00
Vedant Kumar
2ce33a5dff [llvm-cov] Move LineCoverageIterator to libCoverage. NFC.
LineCoverageIterator makes it easy for clients of coverage data to
determine line execution counts for a file or function. The coverage
iteration logic is tricky enough that it really pays not to have
multiple copies of it. Hopefully having just one implementation in LLVM
will make the iteration logic easier to test, reuse, and update.

This commit is NFC but I've added a unit test to go along with it just
because it's easy to do now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316141 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 23:58:28 +00:00
NAKAMURA Takumi
23483f0a33 CoverageMappingTest.cpp: Suppress warnings. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312861 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-09 06:19:53 +00:00
Vedant Kumar
33671ba388 [Coverage] Build sorted and unique segments
A coverage segment contains a starting line and column, an execution
count, and some other metadata. Clients of the coverage library use
segments to prepare line-oriented reports.

Users of the coverage library depend on segments being unique and sorted
in source order. Currently this is not guaranteed (this is why the clang
change which introduced deferred regions was reverted).

This commit documents the "unique and sorted" condition and asserts that
it holds. It also fixes the SegmentBuilder so that it produces correct
output in some edge cases.

Testing: I've added unit tests for some edge cases. I've also checked
that the new SegmentBuilder implementation is fully covered. Apart from
running check-profile and the llvm-cov tests, I've successfully used a
stage1 llvm-cov to prepare a coverage report for an instrumented clang
binary.

Differential Revision: https://reviews.llvm.org/D36813

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312817 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 18:44:50 +00:00
Vedant Kumar
a8dfa81a14 [Coverage] Add an API to retrive all instantiations of a function (NFC)
The CoverageMapping::getInstantiations() API retrieved all function
records corresponding to functions with more than one instantiation (e.g
template functions with multiple specializations). However, there was no
simple way to determine *which* function a given record was an
instantiation of. This was an oversight, since it's useful to aggregate
coverage information over all instantiations of a function.

llvm-cov works around this by building a mapping of source locations to
instantiation sets, but this duplicates logic that libCoverage already
has (see FunctionInstantiationSetCollector).

This change adds a new API, CoverageMapping::getInstantiationGroups(),
which returns a list of InstantiationGroups. A group contains records
for each instantiation of some particular function, and also provides
utilities to get the total execution count within the group, the source
location of the common definition, etc.

This lets removes some hacky logic in llvm-cov by reusing
FunctionInstantiationSetCollector and makes the CoverageMapping API
friendlier for other clients.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 23:35:25 +00:00
Vedant Kumar
cdcc59f9d0 InstrProf: Fix unit test which accidentally used a duplicate name
This unit test constructed some profile records incorrectly. One of the
records had a duplicate name: adding that record into the writer caused
an error unrelated to what needed to be tested.

Reported by David Blaikie!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 21:44:43 +00:00
David Blaikie
cb16061ea7 llvm-profdata: Reduce memory usage by using Error callback rather than member
Reduces llvm-profdata memory usage on a large profile from 7.8GB to 5.1GB.

The ProfData API now supports reporting all the errors/warnings rather
than only the first, though llvm-profdata ignores everything after the
first for now to preserve existing behavior. (if there's a desire for
other behavior, happy to implement that - but might be as well left for
a separate patch)

Reviewers: davidxl

Differential Revision: https://reviews.llvm.org/D35149

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307516 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 03:04:59 +00:00
David Blaikie
8c2dc92bd4 ProfData: Fix some unchecked Errors in unit tests
The 'NoError' function was meant to be used as the input to
ASSERT/EXPECT_TRUE, but it is easy to forget this (it could be annotated
with nodiscard to help this) so many sites that look like they're checked
are not (& silently discard the failure). Only one site actually has an
Error sneaking out this way and I've replaced that one with a
FIXME+consumeError.

The rest of the code has been modified to use the EXPECT_THAT_ERROR
macros Zach introduced a while back. Between the options available this
seems OK/good/something to standardize on - though it's difficult to
build a matcher that could handle checking for a specific llvm::Error
result, so those remain using the custom ErrorEquals (& the nodiscard
added to ensure it is not misused as it was previous to this patch). It
could still be generalized a bit further (even not as far as a matcher,
but at least support multiple kinds of Error, etc) & added to the
general Error utility header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307440 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 21:02:59 +00:00
David Blaikie
450ef2ab9d Prototype: Reduce llvm-profdata merge memory usage further
The InstrProfWriter already stores the name and hash of the record in
the nested maps it uses for lookup while merging - this data is
duplicated in the value within the maps.

Refactor the InstrProfRecord to use a nested struct for the counters
themselves so that InstrProfWriter can use this nested struct alone
without the name or hash duplicated there.

This work is incomplete, but enough to demonstrate the value (around a
50% decrease in memory usage for a large test case (10GB -> 5GB)).
Though most of that decrease is probably from removing the
SoftInstrProfError as well, but I haven't implemented a replacement for
it yet. (it needs to go with the counters, because the operations on the
counters - merging, etc, are where the failures are - unlike the
name/hash which are totally unused by those counter-related operations
and thus easy to split out)

Ongoing discussion about removing SoftInstrProfError as a field of the
InstrProfRecord is happening on the thread that added it - including
the possibility of moving back towards an earlier version of that
proposed patch that passed SoftInstrProfError through the various APIs,
rather than as a member of InstrProfRecord.

Reviewers: davidxl

Differential Revision: https://reviews.llvm.org/D34838

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307298 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 19:00:12 +00:00
David Blaikie
e2f7bf8c93 Simplify InstrProfRecord tests, eliminating named temporaries in favor of braced init args
This will also simplify an API transition and class renaming coming
soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 05:19:17 +00:00
Vedant Kumar
461aeca073 Try to appease a buildbot.
The failure is:
C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\unittests\ProfileData\CoverageMappingTest.cpp(244):
error C2668: 'llvm::make_unique': ambiguous call to overloaded function

http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/3489/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306784 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 04:04:44 +00:00
Vedant Kumar
16264149cd [Coverage] Remove two overloads of CoverageMapping::load. NFC.
These overloads are essentially dead, and pose a maintenance cost
without adding any benefit. This is coming up now because I'd like to
experiment with changing the way we store coverage mapping data, and
would rather not have to fix up the old overloads while doing so.

Testing: check-{llvm,profile}, build clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306776 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 00:45:26 +00:00
Vedant Kumar
9f0d281d87 [Coverage] PR33517: Check for failure to load func records
With PR33517, it became apparent that symbol table creation can fail
when presented with malformed inputs. This patch makes that sort of
error detectable, so llvm-cov etc. can fail more gracefully.

Specifically, we now check that function records loaded from corrupted coverage
mapping data are rejected, e.g when the recorded function name is garbage.

Testing: check-{llvm,clang,profile}, some unit test updates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305767 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20 02:05:35 +00:00
Vedant Kumar
b9454635c0 [ProfileData] PR33517: Check for failure of symtab creation
With PR33517, it became apparent that symbol table creation can fail
when presented with malformed inputs. This patch makes that sort of
error detectable, so llvm-cov etc. can fail more gracefully.

Specifically, we now check that function names within the symbol table
aren't empty.

Testing: check-{llvm,clang,profile}, some unit test updates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305765 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20 01:38:56 +00:00
Chandler Carruth
3c0d60785c Re-sort #include lines for unittests. This uses a slightly modified
clang-format (https://reviews.llvm.org/D33932) to keep primary headers
at the top and handle new utility headers like 'gmock' consistently with
other utility headers.

No other change was made. I did no manual edits, all of this is
clang-format.

This should allow other changes to have more clear and focused diffs,
and is especially motivated by moving some headers into more focused
libraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304786 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 11:06:56 +00:00
Galina Kistanova
34d05a52b5 Fixed warning: must specify at least one argument for '...' parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304676 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-04 05:30:26 +00:00
Simon Pilgrim
892d11dc78 Fix signed/unsigned comparison warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297565 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-11 19:38:22 +00:00
Simon Pilgrim
84354d97d5 Fix spelling mistakes in Tools/Tests comments. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:31:13 +00:00
Vedant Kumar
20bdbbe5e9 [Coverage] Support loading multiple binaries into a CoverageMapping
Add support for loading multiple coverage readers into a single
CoverageMapping instance. This should make it easier to prepare a
unified coverage report for multiple binaries.

Differential Revision: https://reviews.llvm.org/D25535

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284251 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 17:16:53 +00:00
Vedant Kumar
87963ed606 [unittests] Remove a redundant test fixture (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13 17:22:44 +00:00
Vedant Kumar
7c9f5f9286 [unittests] Delete even more copy constructors (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284069 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 22:44:50 +00:00
Vedant Kumar
f466ec4545 [unittests] Delete some copy constructors (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 22:27:54 +00:00
Vedant Kumar
3d6253492a [unittest] Pass a reference instead of making a copy (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 22:27:52 +00:00
David Majnemer
b0353c6db2 Use the range variant of find_if instead of unpacking begin/end
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 00:18:03 +00:00
Benjamin Kramer
b11b3529ce Rename StringMap::emplace_second to try_emplace.
Coincidentally this function maps to the C++17 try_emplace. Rename it
for consistentcy with C++17 std::map. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276276 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 13:37:48 +00:00
Vedant Kumar
d91d378e3a Retry: [llvm-profdata] Speed up merging by using a thread pool
Add a "-j" option to llvm-profdata to control the number of threads used.
Auto-detect NumThreads when it isn't specified, and avoid spawning threads when
they wouldn't be beneficial.

I tested this patch using a raw profile produced by clang (147MB). Here is the
time taken to merge 4 copies together on my laptop:

  No thread pool: 112.87s user 5.92s system 97% cpu 2:01.08 total
  With 2 threads: 134.99s user 26.54s system 164% cpu 1:33.31 total

Changes since the initial commit:

  - When handling odd-length inputs, call ThreadPool::wait() before merging the
    last profile. Should fix a race/off-by-one (see r275937).

Differential Revision: https://reviews.llvm.org/D22438

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 01:17:20 +00:00