Commit Graph

762 Commits

Author SHA1 Message Date
Teresa Johnson
2209e677a1 [ThinLTO] Launch importing backends in parallel threads from gold plugin
Summary:
Launch ThinLTO backends (LTO and codegen pipelines with importing) in
parallel using a ThreadPool, after creating the combined index.
The number of threads is controlled by the existing -jobs gold plugin
option, or the hardware concurrency if not specified.

The old behavior of exiting after creating the combined index can be
invoked via a new thinlto-index-only plugin option.

This commit involves just the ThinLTO-specific pieces of D15390, the NFC
and other restructuring pieces were committed independently:
  r262677: Add hardware_concurrency interface to llvm::thread (NFC)
  r262719: Change split code gen to use ThreadPool
  r262721: Refactor gold-plugin codegen to prepare for ThinLTO threads (NFC)

Reviewers: pcc, joker.eph, rafael

Subscribers: rafael, davidxl, llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262724 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 17:06:02 +00:00
Jacques Pienaar
e0accec873 [lanai] Add ELF enum value and relocations.
Add ELF enum value and relocations for Lanai backed.

General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262394 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 21:21:42 +00:00
Simon Atanasyan
b9c447406c [DebugInfo] Dump CIE augmentation data as a list of hex bytes
CIE augmentation data might contain non-printable characters.
The patch prints the data as a list of hex bytes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262361 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 18:38:05 +00:00
Petr Pavlu
3a3e8ddebb [LTO] Fix error reporting from lto_module_create_in_local_context()
Function lto_module_create_in_local_context() would previously
rely on the default LLVMContext being created for it by
LTOModule::makeLTOModule(). This context exits the program on
error and is not arranged to update sLastStringError in
tools/lto/lto.cpp.

Function lto_module_create_in_local_context() now creates an
LLVMContext by itself, sets it up correctly to its needs and then
passes it to LTOModule::createInLocalContext() which takes
ownership of the context and keeps it present for the lifetime of
the returned LTOModule.

Function LTOModule::makeLTOModule() is modified to take a
reference to LLVMContext (instead of a pointer) and no longer
creates a default context when nullptr is passed to it. Method
LTOModule::createInContext() that takes a pointer to LLVMContext
is removed because it allows to pass a nullptr to it. Instead
LTOModule::createFromBuffer() (that takes a reference to
LLVMContext) should be used.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 13:13:49 +00:00
Mike Aizatsky
4470c2730c [sancov] print_coverage_points command.
Differential Revision: http://reviews.llvm.org/D17670

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262104 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-27 02:21:44 +00:00
Paul Robinson
45648a4496 Fix tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.
FileCheck actually doesn't support combo suffixes.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262054 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26 19:40:34 +00:00
David Blaikie
6802c0801c llvm-dwp: provide diagnostics for duplicate DWO IDs
These diagnostics aren't perfect - in the case of merging several dwos
into dwps and those dwps into more dwps - just getting the message about
the original source file name might not be much help (since it's the
same in both dwos, by definition - but doesn't tell you which chain of
dwps to backtrack)

It might be worth adding the DW_AT_dwo_id to the split debug info to
improve the diagnostic experience - might help track down the duplicates
better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26 07:30:15 +00:00
David Blaikie
132af4d0cd llvm-dwp: Support empty .dwo files
Though a bit odd, this is handy for a few reasons - for example, in a
build system that wants consistent input/output of build steps, but
where split-dwarf might be overriden/disabled by the user on a per-file
basis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26 07:04:58 +00:00
Hemant Kulkarni
70c478d920 Reverts change r261907 and r261918
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25 20:47:07 +00:00
Hemant Kulkarni
ce1dab33de [llvm-readobj] Enable GNU style sections and relocations printing
http://reviews.llvm.org/D17523

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25 18:02:00 +00:00
NAKAMURA Takumi
35023ef3d4 Revert r260064, "Disable llvm/test/tools/llvm-profdata/value-prof.proftext on win32 for now. Investigating."
It seems unreproducible any more for me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25 08:50:26 +00:00
David Blaikie
8e4a86a83f llvm-dwp: Don't test compression when zlib isn't available
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 02:03:45 +00:00
David Blaikie
fb07a71142 llvm-dwp: Support compressed input
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 01:51:44 +00:00
David Blaikie
11dc371299 llvm-dwp: Support for type units when merging DWPs into larger DWPs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 07:00:24 +00:00
Adam Nemet
6782c499e7 Fix test from r261013
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261027 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 22:50:19 +00:00
Adam Nemet
6df4a6f175 [LTO] Support Statistics
Summary:
I thought -Xlinker -mllvm -Xlinker -stats worked at some point but maybe
it never did.

For clang, I believe that stats are printed from cc1_main.  This patch
also prints them for LTO, specifically right after codegen happens.

I only looked at the C API for LTO briefly to see if this is a good
place.  Probably there are still cases where this wouldn't be printed
but it seems to be working for the common case.  I also experimented
putting this in the LTOCodeGenerator destructor but that didn't trigger
for me because ld64 does not destroy the LTOCodeGenerator.

Reviewers: dexonsmith, joker.eph

Subscribers: rafael, joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 21:41:51 +00:00
Rafael Espindola
ed783357b0 This reverts commit r260488 and r260489.
Original messages:
    Revert "[readobj] Handle ELF files with no section table or with no program headers."
    Revert "[readobj] Dump DT_JMPREL relocations when outputting dynamic relocations."

r260489 depends on r260488 and among other issues r260488 deleted error
handling code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 14:17:48 +00:00
NAKAMURA Takumi
a8f262c12e Make llvm/test/tools/llvm-symbolizer/pdb/pdb.test Py3-compatible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260887 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 13:19:13 +00:00
Davide Italiano
2ad5a3cea4 [llvm-size] Make error handling uniform.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 01:38:16 +00:00
Mike Aizatsky
4c8093a71a [sancov] improved object files handling.
Multi-dso programs result in multiple coverage files dumped of the form
'<module_name>.<pid>.sancov'. When analyzing these coverage files it is
important to use correct corresponding object file.

This change removes the "-obj" sancov flag and lets user specify object
file names alongside coverage files. Sancov tool would match them using
<module_name> part of coverage file and short file name of the object
file.

Corresponding changes:
- compiler-rt: http://reviews.llvm.org/D17171
- docs: http://reviews.llvm.org/D17175

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260628 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 00:29:07 +00:00
Michael J. Spencer
9be04e4c36 [readobj] Dump DT_JMPREL relocations when outputting dynamic relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 04:59:53 +00:00
Michael J. Spencer
f8cdb803c2 [readobj] Handle ELF files with no section table or with no program headers.
This adds support for finding the dynamic table and dynamic symbol table via
the section table or the program header table. If there's no section table an
attempt is made to figure out the length of the dynamic symbol table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 04:59:45 +00:00
Hemant Kulkarni
156817cf0a Make llvm-nm test consistent with other tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260464 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 23:28:43 +00:00
Xinliang David Li
7e57e07d4e Fix buildbot failure (hosts without zlib)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 22:05:41 +00:00
Teresa Johnson
0060160bcf Restore "[ThinLTO] Use MD5 hash in function index." with fix
This restores commit r260408, along with a fix for a bot failure.

The bot failure was caused by dereferencing a unique_ptr in the same
call instruction parameter list where it was passed via std::move.
Apparently due to luck this was not exposed when I built the compiler
with clang, only with gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260442 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 21:55:02 +00:00
Hemant Kulkarni
54f4d3a066 [llvm-readobj] Option to emit readelf like output
New option --elf-output-style=LLVM or GNU
Enables -file-headers in readelf style when elf-output-style=GNU

Differential revision: http://reviews.llvm.org/D14128

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:40:55 +00:00
Xinliang David Li
feb624a121 [Coverage] add covmap v2 binary format regression test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260428 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:14:04 +00:00
Teresa Johnson
bc947a0d8d Revert "[ThinLTO] Use MD5 hash in function index." due to bot failure
This reverts commit r260408. Bot failure that I need to investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:11:15 +00:00
Teresa Johnson
f38049c501 [ThinLTO] Use MD5 hash in function index.
Summary:
This patch uses the lower 64-bits of the MD5 hash of a function name as
a GUID in the function index, instead of storing function names. Any
local functions are first given a global name by prepending the original
source file name. This is the same naming scheme and GUID used by PGO in
the indexed profile format.

This change has a couple of benefits. The primary benefit is size
reduction in the combined index file, for example 483.xalancbmk's
combined index file was reduced by around 70%. It should also result in
memory savings for the index file in memory, as the in-memory map is
also indexed by the hash instead of the string.

Second, this enables integration with indirect call promotion, since the
indirect call profile targets are recorded using the same global naming
convention and hash. This will enable the function importer to easily
locate function summaries for indirect call profile targets to enable
their import and subsequent promotion.

The original source file name is recorded in the bitcode in a new
module-level record for use in the ThinLTO backend pipeline.

Reviewers: davidxl, joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:57:54 +00:00
Hemant Kulkarni
dc8e8f2ccc Revert "[llvm-readobj] Option to emit readelf like output"
This reverts commit a58765909660a7195b32e0cc8c7476168b913750.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260397 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:21:01 +00:00
Hemant Kulkarni
d712968e30 [llvm-nm] Add -radix option
Differential Revision: http://reviews.llvm.org/D16822

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260392 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:51:39 +00:00
Hemant Kulkarni
fce97aeb2d [llvm-readobj] Option to emit readelf like output
New option --elf-output-style=LLVM or GNU
Enables -file-headers in readelf style when elf-output-style=GNU

Differential revision: http://reviews.llvm.org/D14128

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:51:28 +00:00
Ehsan Akhgari
e5aba2bcf6 Disable all llvm-config tests for now, will investigate later
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:29:50 +00:00
Peter Collingbourne
40cd497a24 WholeProgramDevirt: introduce.
This pass implements whole program optimization of virtual calls in cases
where we know (via bitset information) that the list of callees is fixed. This
includes the following:

- Single implementation devirtualization: if a virtual call has a single
  possible callee, replace all calls with a direct call to that callee.

- Virtual constant propagation: if the virtual function's return type is an
  integer <=64 bits and all possible callees are readnone, for each class and
  each list of constant arguments: evaluate the function, store the return
  value alongside the virtual table, and rewrite each virtual call as a load
  from the virtual table.

- Uniform return value optimization: if the conditions for virtual constant
  propagation hold and each function returns the same constant value, replace
  each virtual call with that constant.

- Unique return value optimization for i1 return values: if the conditions
  for virtual constant propagation hold and a single vtable's function
  returns 0, or a single vtable's function returns 1, replace each virtual
  call with a comparison of the vptr against that vtable's address.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 22:50:34 +00:00
Rafael Espindola
1cacc098fe This brings back commit r259578.
But now it follows the llvm style, uses an early return and doesn't
include a file named 1.o.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 21:39:49 +00:00
Rafael Espindola
5a372befed Revert "Correct size calculations for ELF files"
This reverts commit r259578.

There are enough issues with this small patch that it is better to
revert and then commit a fixed version (will be committed shortly).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 21:30:10 +00:00
Ehsan Akhgari
f0f8b1c60d Remove system-libs.test for now
This test fails in the ninja-x64-msvc-RA-centos6 builder, so the
UNSUPPORTED: system-windows condition is insufficient.  Removing it
for now; I will investigate how this can be fixed later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 21:17:58 +00:00
Ehsan Akhgari
4f20943c31 Fix a test added in r260263
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260280 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 21:10:22 +00:00
Ehsan Akhgari
5152245647 Fix a typo in r260263
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 20:02:35 +00:00
Ehsan Akhgari
a20946b352 llvm-config: Add preliminary Windows support
Summary:
This patch adds Windows support for a few of the llvm-config commands,
including cflags, ldflags, libs, and system-libs.

Currently llvm-config is untested, so this patch adds tests for the
commands that it fixes as well.

Reviewers: rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 19:41:14 +00:00
Simon Atanasyan
30b32053a4 [llvm-readobj][ELF] Show MIPS GOT content when there is another zero-sized section at the same address
It is possible to have .got section and one or more zero-sized section
at the same address. This patch first checks that GOT (or GOT PLT)
section should have non-zero size using corresponding dynamic tags. Then
it looks up not empty section at the specified address.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260245 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 18:45:35 +00:00
Kevin Enderby
f3ca5b4320 Fix a formatting problems with llvm-size and the -m option.
It was using format() with a string for 64-bit types but was
passed a 32-bit type in places when printing values for
32-bit Mach-O files.

rdar://24542509


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 18:33:15 +00:00
Justin Bogner
eb833bab8d llvm-cov: Fix reading gcov data that does not have function names
In order for recent gcov versions to read the coverage data, you have
to use UseCfgChecksum=true and FunctionNamesInData=false options for
coverage profiling pass. This is because gcov is expecting the
function section in .gcda to be exactly 3 words in size, containing
ident and two checksums.

While llvm-cov is compatible with UseCfgChecksum=true, it always
expects a function name in .gcda function sections (it's not
compatible with FunctionNamesInData=false). Thus it's currently
impossible to generate one set of coverage files that works with both
gcov and llvm-cov.

This change fixes the reading of coverage information to only read the
function name if it's present.

Patch by Arseny Kapoulkine. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-08 22:49:40 +00:00
Xinliang David Li
307f4d07de Fix build bot failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-08 20:08:21 +00:00
Xinliang David Li
04638a608b [PGO] Enable compression in pgo instrumentation
This reduces sizes of instrumented object files, final binaries,
process images, and raw profile data.

The format of the indexed profile data remain the same.

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





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260117 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-08 18:13:49 +00:00
NAKAMURA Takumi
5b9f36bf1a Disable llvm/test/tools/llvm-profdata/value-prof.proftext on win32 for now. Investigating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260064 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-07 23:03:38 +00:00
David Blaikie
2060375d7c [llvm-dwp] Merge cu_index from DWPs
This is almost feature complete - just missing tu_index merging now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259971 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-06 01:15:26 +00:00
Xinliang David Li
78fb7d3772 Add a compatibility test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259632 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 06:27:38 +00:00
Hemant Kulkarni
b99b60dd85 Correct size calculations for ELF files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259578 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 21:41:49 +00:00
Frederic Riss
f768b25cef [dsymutil] Support scattered relocs.
Although it seems like clang will never emit scattered relocations in
the debug information (at least I couldn't find a way), we have too
support them for the benefit of other compilers.
As clang doesn't generate them, the included testcase was produced
from hacked up assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 03:44:22 +00:00