Commit Graph

682 Commits

Author SHA1 Message Date
Easwaran Raman
fa283c33ad Display detailed profile summary in llvm-profdata tool.
This adds a detailed profile summary in llvm-profdata. The summary is in the
form of one or more triples of the form (P, N, M) which is interpreted as if
we look at the Top-N counts in the profile, their sum accounts for P percentage
of the sum of all counts in the program and the minimum count in the Top-N is M.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257680 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 21:44:36 +00:00
Adrian Prantl
9a0e5532ac Relax testcase so it works on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257667 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 21:09:48 +00:00
Adrian Prantl
f6ffec95e3 dsymutil: Only warn about missing clang modules once.
rdar://problem/22269336

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257664 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 20:26:00 +00:00
Reid Kleckner
fb30f09c13 [readobj] Expand CodeView dumping functionality
This rewrites and expands the existing codeview dumping functionality in
llvm-readobj using techniques similar to those in lib/Object. This defines a
number of new records and enums useful for reading memory mapped codeview
sections in COFF objects.

The dumper is intended as a testing tool for LLVM as it grows more codeview
output capabilities.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 19:32:35 +00:00
Davide Italiano
13f61005b8 [llvm-objdump] Use report_error() and improve error coverage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 02:03:31 +00:00
David Majnemer
812af1efba [CodeView] Improve the line table dumper
This change has us print out fields we didn't previously understand.  To
improve readability, we now group column information with it's
respective line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257552 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 01:05:16 +00:00
Kevin Enderby
f3e6026b5b For llvm-objdump, add the option -private-header (without the trailing ’s’)
to only print the first private header.

Which for Mach-O files only prints the Mach header and not the subsequent load
commands.  Which is used by scripts to match what the darwin otool(1) with the
-h flag does without the -l flag.

For non-Mach-O files it has the same functionality as -private-headers (with
the trailing ’s’).

rdar://24158331


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 00:25:36 +00:00
Rafael Espindola
fe84f6bc6d Fix test on windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 14:58:40 +00:00
Rafael Espindola
102130d17c Add a missing error handling to llvm-lto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257395 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 22:08:22 +00:00
Mike Aizatsky
d9750d38e1 [llvm-symbolizer] -print-source-context-lines option to print source code around the line.
Differential Revision: http://reviews.llvm.org/D15909

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-09 00:14:35 +00:00
Xinliang David Li
36838feb74 [PGO] Ensure vp data in indexed profile always sorted
Done in  InstrProfWriter to eliminate the need for client
code to do the sorting. The operation is done once and reused 
many times so it is more efficient. Update unit test to remove
sorting. Also update expected output of affected tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08 05:45:21 +00:00
Mike Aizatsky
ba07fc7f19 [llvm-symbolizer] Print out non-address lines verbatim.
Differential Revision: http://reviews.llvm.org/D15876

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-07 23:57:41 +00:00
Dimitry Andric
e135ddf4bb Fix one file that I didn't convert properly in r256707.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 22:33:32 +00:00
Dimitry Andric
ac6a87b06e Fix several accidental DOS line endings in source files
Summary:
There are a number of files in the tree which have been accidentally checked in with DOS line endings.  Convert these to native line endings.

There are also a few files which have DOS line endings on purpose, and I have set the svn:eol-style property to 'CRLF' on those.

Reviewers: joerg, aaron.ballman

Subscribers: aaron.ballman, sanjoy, dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03 17:22:03 +00:00
James Y Knight
c1b271062b Fix gold test after r256465.
That commit added a new pass, and this test is sensitive to what the
first pass after verify is called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256532 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29 03:48:37 +00:00
Adrian Prantl
8eb4aa5936 llvm-dwarfdump: Add support for dumping .dSYM bundles.
This replicates the logic of Darwin dwarfdump for manually opening up
.dSYM bundles without introducing any new dependencies.
<rdar://problem/20491670>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256350 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-23 21:51:13 +00:00
Teresa Johnson
311da8d9a9 Handle empty Subprogram list when linking metadata.
Use an iterator that handles an empty subprogram list.

Fixes PR25915.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256224 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22 01:17:19 +00:00
Teresa Johnson
8c9c853ff4 Add testcase for r256161 (PR25907)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256174 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-21 18:24:35 +00:00
Xinliang David Li
5a75233380 Fix a bug in test case -- duplicate entries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256117 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-20 08:49:31 +00:00
Pete Cooper
11fd7a2269 Revert "Improve DWARFDebugFrame::parse to also handle __eh_frame."
This reverts commit r256008.

Its breaking multiple buildbots, although works for me locally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256013 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 19:45:38 +00:00
Pete Cooper
3c9c3bf291 Improve DWARFDebugFrame::parse to also handle __eh_frame.
LLVM MC has single methods which can handle the output of EH frame and DWARF CIE's and FDE's.

This code improves DWARFDebugFrame::parse to do the same for parsing.

This also allows llvm-objdump to support the --dwarf=frames option which objdump supports.  This
option dumps the .eh_frame section using the new code in DWARFDebugFrame::parse.

http://reviews.llvm.org/D15535

Reviewed by Rafael Espindola.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256008 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 18:51:08 +00:00
Teresa Johnson
e8df234a6e [ThinLTO/LTO] Don't link in unneeded metadata
Summary:
Third patch split out from http://reviews.llvm.org/D14752.

Only map in needed DISubroutine metadata (imported or otherwise linked
in functions and other DISubroutine referenced by inlined instructions).
This is supported for ThinLTO, LTO and llvm-link --only-needed, with
associated tests for each one.

Depends on D14838.

Reviewers: dexonsmith, joker.eph

Subscribers: davidxl, llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-18 17:51:37 +00:00
Rafael Espindola
5d2e46b5fa Pass -m elf_x84_64 to gold invocations.
Fixes pr25868.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255930 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-17 21:56:27 +00:00
Nathan Slingerland
fd56824d39 [PGO] Handle and report overflow during profile merge for all types of data
Summary: Surface counter overflow when merging profile data. Merging still occurs on overflow but counts saturate to the maximum representable value. Overflow is reported to the user.

Reviewers: davidxl, dnovillo, silvas

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255825 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 21:45:43 +00:00
Mike Aizatsky
bca907f5fb [sancov] blacklist support.
Summary:
Using the blacklist the user can filter own unwanted functions
from all outputs. By default blacklist contains "fun:__sancov*" line.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255732 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16 00:31:48 +00:00
Xinliang David Li
0c7a64a037 Test cleanup -- remove duplicate run lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255673 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 21:15:06 +00:00
Nathan Slingerland
824c3eccff [llvm-profdata] Add support for weighted merge of profile data (2nd try)
Summary:
This change adds support for specifying a weight when merging profile data with the llvm-profdata tool.
Weights are specified by using the --weighted-input=<weight>,<filename> option. Input files not specified
with this option (normal positional list after options) are given a default weight of 1.

Adding support for arbitrary weighting of input profile data allows for relative importance to be placed on the
input data from multiple training runs.

Both sampled and instrumented profiles are supported.

Reviewers: davidxl, dnovillo, bogner, silvas

Subscribers: silvas, davidxl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255659 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 17:37:09 +00:00
Reid Kleckner
f2829c933c [llvm-readobj] s/FunctionName/LinkageName/ for codeview dumping
The symbol being printed in this field comes from the main symbol table,
not 0xF1 subsection. Use LinkageName to make that a lot clearer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255596 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 01:23:55 +00:00
Pete Cooper
2d6ab4db1c Start implementing FDE dumping when printing the eh_frame.
This code adds some simple decoding of the FDE's in an eh_frame.

There's still more to be done in terms of error handling and verification.

Also, we need to be able to decode the CFI's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255550 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 21:49:49 +00:00
Pete Cooper
832d1103af Print the eh_frame section in MachoDump.
This is the start of work to dump the contents of the eh_frame section.

It currently emits CIE entries.  FDE entries will come later.

It also needs improved error checking which will follow soon.

http://reviews.llvm.org/D15502

Reviewed by Kevin Enderby and Lang Hames.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255546 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 21:39:27 +00:00
Xinliang David Li
ea0570fdaf [PGO] Value profiling text format reader/writer support
This patch adds the missing functionality in parsable
text format support for value profiling.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255523 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 18:44:01 +00:00
David Blaikie
cd49eb3fa1 [llvm-dwp] Deduplicate type units
It's O(N^2) because it does a simple walk through the existing types to
find duplicates, but that will be fixed in a follow-up commit to use a
mapping data structure of some kind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255482 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 07:42:00 +00:00
David Blaikie
ea8e65febc [llvm-dwp] Remove some unused test code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255481 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 07:41:56 +00:00
Xinliang David Li
d70808f6bb [PGO] Revert r255365: solution incomplete, not handling lambda yet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255369 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-11 20:23:22 +00:00
Xinliang David Li
b6b389aaac [PGO] Stop using invalid char in instr variable names.
Before the patch, -fprofile-instr-generate compile will fail
if no integrated-as is specified when the file contains
any static functions (the -S output is also invalid).

This patch fixed the issue. With the change, the index format
version will be bumped up by 1. Backward compatibility is 
preserved with this change.

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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255365 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-11 19:53:19 +00:00
Frederic Riss
ba16151251 [dsymutil] Ignore absolute symbols in the debug map
Quoting from the comment added to the code:

    // Objective-C on i386 uses artificial absolute symbols to
    // perform some link time checks. Those symbols have a fixed 0
    // address that might conflict with real symbols in the object
    // file. As I cannot see a way for absolute symbols to find
    // their way into the debug information, let's just ignore those.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255350 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-11 17:50:37 +00:00
Rafael Espindola
da5132018f Slit lib/Linker in two.
A linker normally has two stages: symbol resolution and "moving stuff".

In lib/Linker there is the complication of lazy linking some globals,
but it was still far more mixed than it needed to.

This splits the linker into a lower level IRMover and the linker proper.
The IRMover just takes a list of globals to move and a callback that
lets the user control what is lazy linked.

The main motivation is that now tools/gold (and soon lld) can use their
own symbol resolution to instruct IRMover what to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255254 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10 14:19:35 +00:00
David Blaikie
f8a6223dd0 [llvm-dwp] Restructure inputs for test case so they're all grouped together
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254922 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-07 18:46:41 +00:00
David Blaikie
2b76269756 [llvm-dwp] Add coverage for both the presence and absence of type units, and fix/remove the emission of a broken tu_index when no type units are present
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254833 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-05 03:41:53 +00:00
David Blaikie
28683ac9d5 [llvm-dwp] Fix the type_units.test since I renamed its inputs as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254830 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-05 03:11:17 +00:00
David Blaikie
eaf992ce08 [llvm-dwp] Rename the sufficiently-modified test to reflect it's non-simplicity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254829 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-05 03:10:05 +00:00
David Blaikie
543e02b438 [llvm-dwp] Support debug_tu_index
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254827 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-05 03:05:45 +00:00
David Blaikie
fca82775a2 [llvm-dwp] Remove some out of date comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254772 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 21:38:39 +00:00
David Blaikie
a2b2c5abb0 [llvm-dwp] Implement the required on-disk probed hash table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254770 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 21:30:23 +00:00
David Blaikie
19d1511e67 [llvm-dwp] Include the debug_line.dwo section
This probably shouldn't be generated in the .dwo file for CUs, only for
TUs, but it's in the sample .dwos (generated by clang) so dwp should
reflect that.

Arguably the DWP tool could be smart enough to know that the CUs
shouldn't need a debug_line.dwo section and skip that even when it's
legitimately generated for TUs, but that's a bit more off-book.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254767 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 21:16:42 +00:00
Mike Aizatsky
4d585624eb sancov -not-covered-functions.
Summary: The command prints out list of functions that were not entered.
To do this, addresses are first converted to function locations. Set
operations are used for function locations.

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

review

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254742 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 18:35:37 +00:00
David Blaikie
2a3cc32f71 [llvm-dwp] Retrieve the DWOID from the CU for the cu_index entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254731 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 17:20:04 +00:00
Nathan Slingerland
8061fe5c67 Revert "[llvm-profdata] Add support for weighted merge of profile data"
This reverts commit b7250858d9.

Reverting in order to investigate Windows test failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254687 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 02:13:58 +00:00
Nathan Slingerland
b7250858d9 [llvm-profdata] Add support for weighted merge of profile data
This change adds support for an optional weight when merging profile data with the llvm-profdata tool.
Weights are specified by adding an option ':<weight>' suffix to the input file names.

Adding support for arbitrary weighting of input profile data allows for relative importance to be placed on the
input data from multiple training runs.

Both sampled and instrumented profiles are supported.

Reviewers: dnovillo, bogner, davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 00:00:20 +00:00
Xinliang David Li
aeaec5e3f9 [PGO] Add v2 format compatibility test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254572 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 01:05:31 +00:00