124657 Commits

Author SHA1 Message Date
David Blaikie
cf0403d373 [llvm-dwp] Don't rely on implicit move assignment operator (MSVC won't synthesize one)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254492 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 07:09:26 +00:00
Akira Hatanaka
ec268660c8 [AttributeSet] Overload AttributeSet::addAttribute to reduce compile
time.

The new overloaded function is used when an attribute is added to a
large number of slots of an AttributeSet (for example, to function
parameters). This is much faster than calling AttributeSet::addAttribute
once per slot, because AttributeSet::getImpl (which calls
FoldingSet::FIndNodeOrInsertPos) is called only once per function
instead of once per slot.

With this commit, clang compiles a file which used to take over 22
minutes in just 13 seconds.

rdar://problem/23581000

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254491 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 06:58:49 +00:00
Craig Topper
1bd8c8c635 [X86] Change getZeroVector to take an MVT instead of EVT. One minor change needed to only try to perform 256-it shuffle combines on legal vector types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254490 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 06:39:19 +00:00
David Blaikie
5001b2a939 [llvm-dwp] Emit a rather fictional debug_cu_index
This is very rudimentary support for debug_cu_index, but it is enough to
allow llvm-dwarfdump to find the offsets for  contributions and
correctly dump debug_info.

It will need to actually find the real signature of the unit and build
the real hash table with the right number of buckets, as per the DWP
specification.

It will also need to be expanded to cover the tu_index as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254489 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 06:21:34 +00:00
David Blaikie
b9f437f759 DebugInfo\DWARF: Privatize some accidentally public members
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254488 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 06:21:28 +00:00
Craig Topper
d217d70095 [X86] Fix weird identation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254487 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 05:24:38 +00:00
Mehdi Amini
accfde3ad6 Change ModuleLinker to take a set of GlobalValues to import instead of a single one
For efficiency reason, when importing multiple functions for the same Module,
we can avoid reparsing it every time.

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254486 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 04:34:28 +00:00
Kostya Serebryany
569415a25b [libFuzzer] add a test that is built with -fsanitize-coverage=trace-bb
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254484 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 02:49:37 +00:00
Kostya Serebryany
0445c4d68b [sanitizer coverage] when adding a bb trace instrumentation, do it instead, not in addition to, regular coverage. Do the regular coverage in the run-time instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254482 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 02:37:13 +00:00
Quentin Colombet
653cbb792b [X86] Fix a think-o when checking if the eflags needs to be preserved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254480 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 02:07:00 +00:00
Mehdi Amini
f7d58f12fa Modify FunctionImport to take a callback to load modules
When linking static archive, there is no individual module files to
load. Instead they can be mmap'ed and could be initialized from a
buffer directly. The callback provide flexibility to override the
scheme for loading module from the summary.

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254479 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 02:00:29 +00:00
Quentin Colombet
3278230451 [X86] Make sure the prologue does not clobber EFLAGS when it lives accross it.
This is a superset of the fix done in r254448.

This fixes PR25607.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254478 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 01:22:54 +00:00
Tim Northover
6837bcf911 AArch64: fix 128-bit shifts
We mustn't introduce a shift of exactly 64-bits for any inputs, since that's an
UNDEF value (and worse, it's not what you want with the natural Arch64
implementation).

The generated code is pretty horrific, but I couldn't come up with an obviously
better alternative (if the amount is constant EXTR could help). Turns out
128-bit shifts are just nasty.

rdar://22491037

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254475 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-02 00:33:54 +00:00
Rafael Espindola
c322221121 Use default member initializers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254473 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 23:06:26 +00:00
Xinliang David Li
b0e1e32b73 Define member operator delete
For the struct with trailing objects, define
a member operator delete. Without this, the program
will fail when -fsized-deallocation option is used
where the wrong size will be passed to the global
delete operator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254471 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 23:05:27 +00:00
Matt Arsenault
465e0cdebb AMDGPU: Error on addrspacecasts that aren't actually implemented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254469 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 23:04:05 +00:00
Matt Arsenault
8f43193167 AMDGPU: Implement isNoopAddrSpaceCast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254468 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 23:04:00 +00:00
Rafael Espindola
97a345e35a Remove unnecessary getter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254466 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 23:01:51 +00:00
Rafael Espindola
427ad06f8e Pass down the dst GV to linkGlobalValueBody. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 22:40:40 +00:00
Cong Hou
d715c5a2cf Fix a bug in IfConversion.cpp.
The bug is introduced in r254377 which failed some tests on ARM, where a new
probability is assigned to a successor but the provided BB may not be a
successor.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254463 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 21:50:20 +00:00
Matthias Braun
a46d791b1d ARM: Change ArchCheck field to uint64_t
The values in this field are compared against getAvailableFeatures()
which returns an uint64_t. This was causing problems in an internal
branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254462 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 21:48:52 +00:00
Matt Arsenault
418d565e54 AMDGPU: Disallow flat_scr in SI assembler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254459 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 20:31:08 +00:00
Xinliang David Li
d89494bf03 [PGO] Add support for reading multiple versions of indexed profile format profile data
Profile readers using incompatible on-disk hash table format can now share the same 
implementation and interfaces. 

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254458 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 20:26:26 +00:00
Rafael Espindola
146c16ca4d Delete unused includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254457 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 20:23:19 +00:00
Justin Bogner
fc16153e10 IR: Clean up some duplicated code in ConstantDataSequential creation. NFC
ConstantDataArray::getImpl and ConstantDataVector::getImpl had a lot
of copy pasta in how they handled sequences of constants. Break that
out into a couple of simple functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254456 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 20:20:49 +00:00
Rafael Espindola
e6b26fa8ad clang-format LinkModules.cpp.
Most of the file has been changed recently and was already clang-format
clean.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254454 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 20:11:43 +00:00
Sanjay Patel
116b08e395 use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254453 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:57:43 +00:00
Matt Arsenault
dc53fde2a4 AMDGPU: Optimize VOP2 operand legalization
Don't use commuteInstruction, and don't commute if
doing so will not improve legality. Skip the more
complex checks for literal operands and constant bus restrictions,
which are not a concern for VOP2 instructions because src1
does not accept SGPRs or constants and few implicitly
read vcc.

This gets called quite a few times and the
attempts at commuting are a significant fraction
of the time spent in SIFixSGPRCopies, so it's
somewhat worthwhile to optimize. With this patch and others
leading up to it, this reduces the compile time of SIFixSGPRCopies
on some of the LuxMark 2 kernels from ~8ms to ~5ms on my system.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254452 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:57:17 +00:00
Rafael Espindola
76c60c37de Use references now that it is natural to do so.
The linker never takes ownership of a module or changes which module it
is refering to, making it natural to use references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254449 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:50:54 +00:00
Quentin Colombet
b0b27c5725 [X86] Make sure the prologue does not clobber EFLAGS when it lives accross it.
This fixes PR25629.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254448 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:49:31 +00:00
Xinliang David Li
67b32b2810 Use nullptr (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254447 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:47:32 +00:00
Sanjay Patel
936f2daba2 don't repeat function/variable names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254445 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:32:35 +00:00
Artyom Skrobov
8efaea8c45 Fix Thumb1 epilogue generation
Summary:
This had been broken for a very long time, but nobody noticed until
D14357 enabled shrink-wrapping by default.

Reviewers: jroelofs, qcolombet

Subscribers: tyomitch, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254444 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:25:11 +00:00
Sanjay Patel
bedc55e063 fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254442 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:19:18 +00:00
David Blaikie
8e31526513 [llvm-dwp] Deduplicate strings in the debug_str.dwo section
Also, ensure that references to those strings in debug_str_offsets.dwo
correctly refer to the deduplicated strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254441 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:17:58 +00:00
Weiming Zhao
6a07b97796 [AArch64] Fix a corner case in BitFeild select
Summary:
When not useful bits, BitWidth becomes 0 and APInt will not be happy.

See https://llvm.org/bugs/show_bug.cgi?id=25571

We can just mark the operand as IMPLICIT_DEF is none bits of it is used.

Reviewers: t.p.northover, jmolloy

Subscribers: gberry, jmolloy, mgrang, aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254440 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:17:49 +00:00
Matt Arsenault
2320de6adb AMDGPU: Report extractelement as free in cost model
The cost for scalarized operations is computed as N * (scalar operation
cost + 1 extractelement + 1 insertelement). This partially fixes
inflating the cost of scalarized operations since every operation is
scalarized and free. I don't think we want any cost asociated with
scalarization, but for now insertelement is still counted. I'm not sure
if we should pretend that insertelement is also free, or add a way
to compute a custom scalarization cost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254438 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:08:39 +00:00
Keno Fischer
6cb642d909 [Verifier] Improve error for cross-module refs
By including the module name in the error message.
This makes the error message much more useful and
saves a trip to the debugger.

Reviewers: dexonsmith

Subscribers: dexonsmith, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254437 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 19:06:36 +00:00
Rafael Espindola
c6cd4955cd Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254436 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 18:50:35 +00:00
Rafael Espindola
f0edaf8e00 Use a forwarding constructor instead of an init method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254435 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 18:46:19 +00:00
Rafael Espindola
1d06f0bf4e Delete the setModule method from the Linker.
It was only used from LTO for a debug feature, and LTO can just create
another linker.

It is pretty odd to have a method to reset the module in the middle of a
link. It would make IdentifiedStructTypes inconsistent with the Module
for example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254434 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 18:41:30 +00:00
David Blaikie
0fb89f7b82 [llvm-dwp] Correctly update debug_str_offsets.dwo when linking dwo files
This doesn't deduplicate strings in the debug_str section, nor does it
properly wire up the index so that debug_info can /find/ these strings,
but it does correct the str_offsets specifically.

Follow up patches to address those related/next issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254431 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 18:07:07 +00:00
Tom Stellard
76eb039568 AMDGPU/SI: Remove REGISTER_STORE/REGISTER_LOAD code which is now dead
Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254427 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 17:45:22 +00:00
Tom Stellard
368c76102b AMDGPU: Use the default strings for data emission directives
Summary:
This makes the assembly output look nicer and there is no reason to
have custom strings for these.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254426 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 17:45:17 +00:00
Sanjay Patel
40adef82a5 [x86] add a convenience method to check for FMA capability; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254425 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 17:27:55 +00:00
Rafael Espindola
2b3f97809d Make appending var linking less of a special case.
It has to be a bit special because:
* materializeInitFor is not really supposed to call replaceAllUsesWith.
  The caller has a plain variable with Dst and expects just the
  initializer to be set, not for it to be removed.
* Calling mutateType as we used to do before gets some type
  inconsistency which breaks the bitcode writer.
* If linkAppendingVarProto create a dest decl with the correct type to
  avoid the above problems, it needs to put the original dst init in
  some side table for materializeInitFor to use.

In the end the simplest solution seems to be to just have
linkAppendingVarProto do all the work and set ValueMap[SrcGV to avoid
recursion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254424 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 17:17:04 +00:00
Teresa Johnson
3c43768b63 [ThinLTO] Wrap dbgs() output in DEBUG macro
Missed in a couple places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254422 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 17:12:10 +00:00
Teresa Johnson
2b9196851c [ThinLTO] Remove stale comment (NFC)
Stale as of r254036 which added basic profitability check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254421 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 16:45:23 +00:00
Rafael Espindola
d0903bddbc Simplify test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254419 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 15:46:46 +00:00
Rafael Espindola
39e89e8fd8 Bring r254336 back:
The difference is that now we don't error on out-of-comdat access to
internal global values. We copy them instead. This seems to match the
expectation of COFF linkers (see pr25686).

Original message:

    Start deciding earlier what to link.

    A traditional linker is roughly split in symbol resolution and
"copying
    stuff".

    The two tasks are badly mixed in lib/Linker.

    This starts splitting them apart.

    With this patch there are no direct call to linkGlobalValueBody or
    linkGlobalValueProto. Everything is linked via WapValue.

    This also includes a few fixes:
    * A GV goes undefined if the comdat is dropped (comdat11.ll).
    * We error if an internal GV goes undefined (comdat13.ll).
    * We don't link an unused comdat.

    The first two match the behavior of an ELF linker. The second one is
    equivalent to running globaldce on the input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254418 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 15:19:48 +00:00