Commit Graph

7414 Commits

Author SHA1 Message Date
Vedant Kumar
139080743f [llvm-cov] Demangle names for hidden instantiation views
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 21:27:48 +00:00
Xinliang David Li
163ac62cd3 [Profile] dump ic value profile value/site-count histogram
Differential Revision: http://reviews.google.com/D24783




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 21:04:22 +00:00
Vedant Kumar
764028eefa [llvm-cov] Emit a link to some documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281883 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 02:15:59 +00:00
Vedant Kumar
1b70b5dcc9 [llvm-cov] Delete the NonCodeLines field, it was always dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 01:46:01 +00:00
Vedant Kumar
70b43c34b6 [llvm-cov] Teach the coverage exporter about instantiation coverage
While we're at it, re-use the logic from CoverageReport to compute
summaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:29 +00:00
Vedant Kumar
a830753405 [llvm-cov] Make a helper method static for re-use (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:25 +00:00
Vedant Kumar
e17f26f066 [llvm-cov] Track function and instantiation coverage separately
These are distinct statistics which are useful to look at separately.

Example: say you have a template function "foo" with 5 instantiations
and only 3 of them are covered. Then this contributes (1/1) to the total
function coverage and (3/5) to the total instantiation coverage. I.e,
the old "Function Coverage" column has been renamed to "Instantiation
Coverage", and the new "Function Coverage" aggregates information from
the various instantiations of a function.

One benefit of making this switch is that the Line and Region coverage
columns will start making sense. Let's continue the example and assume
that the 5 instantiations of "foo" cover {2, 4, 6, 8, 10} out of 10
lines respectively. The new line coverage for "foo" is (10/10), not
(30/50).  The old scenario got confusing because we'd report that there
were more lines in a file than what was actually possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:23 +00:00
Vedant Kumar
40817d86f0 [llvm-cov] Don't recompute the 'Covered' field from *CoverageInfo (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:18 +00:00
Vedant Kumar
6360ab9da4 [llvm-cov] Make 'adjustColumnWidths' do less work
This drops some redundant calls to get{UniqueSourceFiles,
CoveredFunctions}. We can figure out the right column widths without
re-doing this expensive work.

This isn't NFC, but I don't want to check in another binary *.covmapping
file with long filenames in it. I tested this locally on a project with
some long filenames (FileCheck).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:16 +00:00
Vedant Kumar
c063c43a4e [llvm-cov] Drop another redundant 'No.' suffix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-19 00:38:14 +00:00
Davide Italiano
4b868ad9b9 [llvm-objump] Simplify the code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281844 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-18 04:39:15 +00:00
Mehdi Amini
d1e3c5aaec Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC)
The ValueSymbolTable is used to detect name conflict and rename
instructions automatically. This is not needed when the value
names are automatically discarded by the LLVMContext.
No functional change intended, just saving a little bit of memory.

This is a recommit of r281806 after fixing the accessor to return
a pointer instead of a reference and updating all the call-sites.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 06:00:02 +00:00
Davide Italiano
463cfe4e60 [LTO] Add ability to parse AA pipelines.
This is supposed to be a drop in replacement for what lld
provides via --lto-newpm-aa-pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 21:03:21 +00:00
Zachary Turner
5fa3c5202b [pdb] Write the IPI stream.
The IPI stream is structurally identical to the TPI stream, but it
contains different record types.  So we just re-use the TPI writing
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281638 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 18:22:31 +00:00
Vedant Kumar
4cb35092d0 [llvm-cov] Move some layout logic to the right spot (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281590 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 06:49:13 +00:00
Vedant Kumar
61f5694c30 [llvm-cov] Hide instantiation views for unexecuted functions
Copying in the full text of the function doesn't help at all when we
already know that it's never executed. Just say that it's unexecuted --
the relevant source text has already been printed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281589 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 06:44:51 +00:00
Vedant Kumar
2fcbfcf470 [llvm-cov] Don't create 'jump to ...' links in nested views
Doing so is pointless, since the whole view is usually visible in a
small amount of space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 06:44:48 +00:00
Vedant Kumar
7551d48f2f [llvm-cov] Make a method name more accurate (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281581 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 04:45:59 +00:00
Vedant Kumar
90562cd08a [llvm-cov] Don't print a verbose title when looking at one file
Having the same title, timestamp, etc. occur repeatedly creates an
unnecessary distraction when paging through a report.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281579 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15 04:41:39 +00:00
Zachary Turner
b5689e754e [pdb] Get rid of Data and RawData in CVType.
The `CVType` had two redundant fields which were confusing and
error-prone to fill out.  By treating member records as a distinct
type from leaf records, we are able to simplify this quite a bit.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24432

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281556 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 23:00:16 +00:00
Zachary Turner
a9d16c9445 [pdb] Write TPI hash values to the TPI stream.
This completes being able to write all the interesting
values of a PDB TPI stream.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24370

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281555 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 23:00:02 +00:00
Mehdi Amini
a364825f51 Fix auto-upgrade of TBAA tags in Bitcode Reader
If TBAA is on an intrinsic and it gets upgraded, it'll delete the call
instruction that we collected in a vector. Even if we were to use
WeakVH, it'll drop the TBAA and we'll hit the assert on the upgrade
path.

r263673 gave a shot to make sure the TBAA upgrade happens before
intrinsics upgrade, but failed to account for all cases.

Instead of collecting instructions in a vector, this patch makes it
just upgrade the TBAA on the fly, because metadata are always
already loaded at this point.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 22:29:59 +00:00
Mehdi Amini
e0384663d6 [ThinLTO] Add an option to llvm-lto to print some basic statistics for the index
Differential Revision: https://reviews.llvm.org/D24290

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281537 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 21:04:59 +00:00
Sanjoy Das
9becdeed48 [Stackmap] Added callsite counts to emitted function information.
Summary:
It was previously not possible for tools to use solely the stackmap
information emitted to reconstruct the return addresses of callsites in
the map, which is necessary to use the information to walk a stack. This
patch adds per-function callsite counts when emitting the stackmap
section in order to resolve the problem. Note that this slightly alters
the stackmap format, so external tools parsing these maps will need to
be updated.

**Problem Details:**
Records only store their offset from the beginning of the function they
belong to. While these records and the functions are output in program
order, it is not possible to determine where the end of one function's
records are without the callsite count when processing the records to
compute return addresses.

Patch by Kavon Farvardin!

Reviewers: atrick, ributzka, sanjoy

Subscribers: nemanjai

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281532 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 20:22:03 +00:00
Tobias Grosser
e6c628ff62 Ensure Polly linking works without BUILD_SHARED_LIBS
This change ensures all necessary symbols are resolved correctly. Before this
change on some systems, the linker may have eliminated some symbols not directly
used in bugpoint, but used in Polly.

Suggested-by: Michael Kruse <lvm@meinersbur.de>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281438 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 03:09:48 +00:00
Peter Collingbourne
6f025c10c1 gold: Simplify. Do not unnecessarily enumerate Obj's symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 02:55:16 +00:00
Vedant Kumar
e7f7e18127 [llvm-cov] Just emit the version number in the index file
Having the version information in every view is distracting, especially
if there are several sub-views.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281414 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 23:00:13 +00:00
Ying Yi
503f4620ba [llvm-cov] - Included footer "Generated by llvm-cov -- llvm version <version number>" in the coverage report.
The llvm-cov version information will be useful to the user when comparing the code coverage across different versions of llvm-cov. This patch provides the llvm-cov version information in the generated coverage report.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 11:28:31 +00:00
Hemant Kulkarni
7ee831747c llvm-size: Add --totals option
Differential Revision: https://reviews.llvm.org/D24308

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 17:08:28 +00:00
Hemant Kulkarni
11981cd22e llvm-objdump: Add --start-address and --stop-address options
Differential Revision: https://reviews.llvm.org/D24160

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 17:08:22 +00:00
Lang Hames
ce85c7eb57 [ORC] Rename RPCChannel to RPCByteChannel. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-11 18:41:05 +00:00
Vedant Kumar
a8edd76b0e [llvm-cov] Move the 'jump to first unexecuted line' link
Having it in the same row as the source name is jarring. Move it next to
the "Source" column label.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 19:37:26 +00:00
Vedant Kumar
ce19c1cc95 [llvm-cov] Minor visual tweaks for html reports
- Change the location of the 'Region Coverage' column.
  - Use less css and text for some labels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-10 19:37:20 +00:00
Zachary Turner
6ad7067c1a [pdb] Print out some more info when dumping a raw stream.
We have various command line options that print the type of a
stream, the size of a stream, etc but nowhere that it can all be
viewed together.

Since a previous patch introduced the ability to dump the bytes
of a stream, this seems like a good place to present a full view
of the stream's properties including its size, what kind of data
it represents, and the blocks it occupies.  So I added the
ability to print that information to the -stream-data command
line option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281077 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 19:00:49 +00:00
Vedant Kumar
07e4072b5d [llvm-cov] Remove some asserts in the html renderer (NFC)
These asserts are making tests fragile. The renderer does not enter an
invalid state when they fail, however, it may spit out a garbled
coverage report because the source text no longer matches the provided
coverage mapping.

Another follow-up to r281072.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281076 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 18:44:40 +00:00
Zachary Turner
892ff5d6d9 [pdb] Add command line options for dumping individual streams and blocks
I ran into a situation where I wanted to print out the contents of
page 6 of a PDB as a binary blob, and there was no straightforward
way to do that.

In addition to adding that, this patch also adds the ability to dump
a stream by index as a binary blob, and it will stitch together all
the blocks and dump the whole thing as one seemingly contiguous
sequence of bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 18:17:52 +00:00
Zachary Turner
27d122cd8e [pdb] Pass CVRecord's through the visitor as non-const references.
This simplifies a lot of code, and will actually be necessary for
an upcoming patch to serialize TPI record hash values.

The idea before was that visitors should be examining records, not
modifying them.  But this is no longer true with a visitor that
constructs a CVRecord from Yaml.  To handle this until now, we
were doing some fixups on CVRecord objects at a higher level, but
the code is really awkward, and it makes sense to just have the
visitor write the bytes into the CVRecord.  In doing so I uncovered
a few bugs related to `Data` and `RawData` and fixed those.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24362

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281067 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 18:03:39 +00:00
Zachary Turner
be73fbca1c [pdb] Write PDB TPI Stream from Yaml.
This writes the full sequence of type records described in
Yaml to the TPI stream of the PDB file.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D24316

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 17:46:17 +00:00
Vedant Kumar
3beac7c40e [llvm-cov] Handle native paths correctly in the text index
Treat filenames the same way in the text index as we do in the html
index. This is a follow-up to r281008 (an attempt to unbreak the
native_separators.c test on Windows).

Patch by Maggie Yi!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281062 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 17:37:11 +00:00
Vedant Kumar
84dc7510c9 [llvm-cov] Emit a summary in the report directory's index
llvm-cov writes out an index file in '-output-dir' mode, albeit not a
very informative one. Try to fix that by using the CoverageReport API to
include some basic summary information in the index file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:32:55 +00:00
Vedant Kumar
85e096da4e [llvm-cov] Constify some methods (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281010 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:32:51 +00:00
Vedant Kumar
006e320c47 [llvm-cov] Add an API to prepare file reports (NFC)
It would be nice to prepare file reports (using the CoverageReport API)
without actually rendering them to the console. I plan on using this to
flesh out the 'index' files in the coverage views.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:32:49 +00:00
Saleem Abdulrasool
8aad2917ed llvm-objdump: add missing ) in help output, NFC
Add a missing ')' in the help output.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 23:17:34 +00:00
Vedant Kumar
111f4fbf9a [llvm-cov] Fix issues with segment highlighting in the html view
The text and html coverage views take different approaches to emitting
highlighted regions. That's because this problem is easier in the text
view: there's no need to worry about escaping text or adding tooltip
content to a highlighted snippet.

Unfortunately, the html view didn't get region highlighting quite right.

This patch fixes the situation, bringing parity between the two views.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 19:18:23 +00:00
Zachary Turner
3d9234aa0a [pdb] Make YamlTypeDumperCallbacks reuse *this.
Previously we were making new instances of YamlTypeDumperCallbacks
in order to recurse down and serialize / deserialize nested
records such as field lists.  This meant you could not pass
context from a higher operation to a lower operation because
it would be using a new instance of the visitor callback
delegate.

YAMLIO library was updated to support context-sensitive mappings,
so now we can reuse the same instance of the visitor callback
delegate even for nested operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 18:36:55 +00:00
Vedant Kumar
d2e36ca513 [llvm-cov] Use less space to describe source names
In r279628, we made SourceCoverageView list the binary associated with a
view and started adding labels (e.g "Source: foo" or "Function: bar") to
everything. Condense this information a bit to unclutter reports.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 00:56:48 +00:00
Vedant Kumar
a57be10507 [llvm-cov] Drop the longest common filename prefix from summaries
Remove the longest common prefix from filenames when printing coverage
summaries. This makes them easier to compare.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 00:56:43 +00:00
Davide Italiano
fab897dd11 [lib/LTO] Add a way to run a custom pipeline
Differential Revision:  https://reviews.llvm.org/D24095

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 17:46:16 +00:00
Davide Italiano
19c8b5e70c [opt] Remove an unused argument to runPassPipeline().
I have plans to use this API also in libLTO (and maybe lld).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 00:48:47 +00:00
Zachary Turner
8eddc0f657 Re-add "Make FieldList records print as a YAML sequence"
This was originally submitted in r280549, and reverted in r280577
due to breaking one MSVC buildbot.  The issue is that MSVC 2013
doesn't synthesize move constructors.  So even though i was
writing std::move(A) it was copying it, leading to a bogus ArrayRef.
The solution here is to simply remove the std::vector<> from the
type, since it is unused and unnecessary.  This way the ArrayRef
continues to point into the original memory backing the CVType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-06 23:45:47 +00:00