130949 Commits

Author SHA1 Message Date
Nick Lewycky
a0613703b4 Fix typo in comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267354 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 17:55:57 +00:00
Nick Lewycky
7be7739e12 Remove emacs mode markers from .cpp files. NFC
.cpp files are unambiguously C++, you only need the mode markers on .h files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 17:55:41 +00:00
Simon Pilgrim
c4d2c7c24e [X86][InstCombine] Tidyup VPERMILVAR -> shufflevector conversion to helper function. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267352 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 17:23:46 +00:00
Simon Pilgrim
a3ce49106c [X86][InstCombine] Tidyup PSHUFB -> shufflevector conversion to helper function. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267351 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 17:00:34 +00:00
Simon Pilgrim
2bfa472698 [X86][SSE] getTargetShuffleMaskIndices - dropped (unused) UNDEF handling
We aren't currently making use of this in any successful mask decode and its actually incorrect as it inserts the wrong number of SM_SentinelUndef mask elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 16:49:53 +00:00
Simon Pilgrim
3b640cc9ab [X86][SSE] Use range loop. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 16:33:35 +00:00
Craig Topper
67c79eb14c [Lanai] Use EVT::getEVTString() to print a type as a string instead of an enum encoding value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267348 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 16:30:51 +00:00
Simon Pilgrim
8b9bfa9ca1 [X86][SSE] Added SSSE3/AVX/AVX2 BITREVERSE tests
Codegen is pretty bad at the moment but could use PSHUFB quite efficiently 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267347 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 15:45:06 +00:00
Simon Pilgrim
3f1ed3f5aa [X86][XOP] Fixed VPPERM permute op decoding (PR27472).
Fixed issue with VPPERM target shuffle mask decoding that was incorrectly masking off the 3-bit permute op with a 2-bit mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267346 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 15:05:04 +00:00
Duncan P. N. Exon Smith
f8838c9ca2 BitcodeReader: Delay metadata parsing until reading a function body
There's hardly any functionality change here.  Instead of calling
materializeMetadata on the first call to materialize(GlobalValue*), wait
until the first one that's actually going to do something.  Noticed by
inspection; I don't have a concrete case where this makes a difference.

Added an assertion in materializeMetadata to be sure this (or a future
change) doesn't delay materializeMetadata after function-level metadata.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 15:04:28 +00:00
Teresa Johnson
ff1d72888b [ThinLTO] Remove GlobalValueInfo class from index
Summary:
Remove the GlobalValueInfo and change the ModuleSummaryIndex to directly
reference summary objects. The info structure was there to support lazy
parsing of the combined index summary objects, which is no longer
needed and not supported.

Reviewers: joker.eph

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 14:57:11 +00:00
Simon Pilgrim
76e20279a3 [X86][SSE] Improved support for decoding target shuffle masks through bitcasts
Reused the ability to split constants of a type wider than the shuffle mask to work with masks generated from scalar constants transfered to xmm.

This fixes an issue preventing PSHUFB target shuffle masks decoding rematerialized scalar constants and also exposes the XOP VPPERM bug described in PR27472.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267343 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 14:53:54 +00:00
Duncan P. N. Exon Smith
311d89d774 ModuleSummaryIndex: Avoid enum bitfields for MSVC portability
Enum bitfields have crazy portability issues with MSVC.  Use unsigned
instead of LinkageTypes here in the ModuleSummaryIndex to address
Takumi's concerns from r267335.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 14:25:37 +00:00
Duncan P. N. Exon Smith
879fccddd3 Revert "Declare GlobalValue::LinkageTypes based on unsigned."
This reverts commit r267335.  The build has been broken for hours
because of it:

  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/23352/

The correct fix is avoid using any enum in a bitfield.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 14:13:17 +00:00
Marcin Koscielnicki
534be04157 [SystemZ] [SSP] Add support for LOAD_STACK_GUARD.
This fixes PR22248 on s390x.  The previous attempt at this was D19101,
which was before LOAD_STACK_GUARD existed.  Compared to the previous
version, this always emits a rather ugly block of 4 instructions, involving
a thread pointer load that can't be shared with other potential users.
However, this is necessary for SSP - spilling the guard value (or thread
pointer used to load it) is counter to the goal, since it could be
overwritten along with the frame it protects.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267340 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 13:57:49 +00:00
Simon Pilgrim
ff70139057 [X86][SSE] Demonstrate issue with decoding shuffle masks that have been lowered as rematerialized constants on scalar unit
Found whilst investigating PR27472


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 13:45:30 +00:00
Aaron Ballman
37c06ef983 Silence two C4806 warnings ('|': unsafe operation: no value of type 'bool' promoted to type 'const unsigned int' can equal the given constant). The fact that they trigger with this code seems like it may be a bug, but the warning itself is still generally useful enough to retain it for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 13:03:20 +00:00
NAKAMURA Takumi
67d948482b Declare GlobalValue::LinkageTypes based on unsigned.
Or, "LinkageTypes Linkage : 4;" might be sign-extended on msc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267335 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 10:11:45 +00:00
NAKAMURA Takumi
028b451b44 llvm/test/tools/gold/X86/thinlto.ll: Possible fix corresponding to r267318.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 08:02:00 +00:00
Duncan P. N. Exon Smith
a61a99b62e BitcodeReader: Fix some holes in upgrade from r267296
Add tests for some missing cases to bitcode upgrade in r267296.

  - DICompositeType with an 'elements:' field, which will cause it to be
    involved in a cycle after the upgrade.

  - A DIDerivedType that references a class in 'extraData:'.

I updated test/Bitcode/dityperefs-3.8.ll with the missing cases and
regenerated test/Bitcode/dityperefs-3.8.ll.bc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267332 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 06:52:01 +00:00
Craig Topper
c8d2e3b5cb [X86] Merge LowerCTLZ and LowerCTLZ_ZERO_UNDEF into a single function that branches internally for the one difference, allowing the rest of the code to be common. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 06:27:39 +00:00
Craig Topper
5a6c34b731 [X86] Node need to check if AVX512 is supported when lowering vector CTLZ. The CTLZ operation is only Custom for vectors if AVX512 is enabled so if a vector gets here AVX512 is implied. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 06:27:35 +00:00
Mehdi Amini
822155bcb5 Add "hasSection" flag in the Summary
Reviewers: tejohnson

Subscribers: llvm-commits

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 05:31:43 +00:00
Gerolf Hoflehner
3f71db1efb [MachineCombiner] Support for floating-point FMA on ARM64 (re-commit r267098)
The original patch caused crashes because it could derefence a null pointer
for SelectionDAGTargetInfo for targets that do not define it.

Evaluates fmul+fadd -> fmadd combines and similar code sequences in the
machine combiner. It adds support for float and double similar to the existing
integer implementation. The key features are:

- DAGCombiner checks whether it should combine greedily or let the machine
combiner do the evaluation. This is only supported on ARM64.
- It gives preference to throughput over latency: the heuristic used is
to combine always in loops. The targets decides whether the machine
combiner should optimize for throughput or latency.
- Supports for fmadd, f(n)msub, fmla, fmls patterns
- On by default at O3 ffast-math



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267328 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 05:14:01 +00:00
Craig Topper
f5542f610c [X86] Remove isel patterns for selecting tzcnt/lzcnt from cmove/ne+cttz/ctlz. These are folded by DAG combine now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 04:38:34 +00:00
Craig Topper
c0f92c94ab [CodeGen] Teach DAG combine to fold select_cc seteq X, 0, sizeof(X), ctlz_zero_undef(X) -> ctlz(X). InstCombine already does this for IR and X86 pattern matches this during isel.
A follow up commit will remove the X86 patterns to allow this to be tested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 04:38:32 +00:00
Craig Topper
e5dc889a2b Fix an assertion that can never fire because the condition ANDed with the string is just true or 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267324 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 04:38:29 +00:00
Adrian Prantl
08290fd4f3 Revert "Verifier: Verify that each inlinable callsite of a debug-info-bearing function"
This reverts commit r267320 while investigating an OpenMP buildbot failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267322 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 03:47:37 +00:00
Adrian Prantl
522b700b9b Verifier: Verify that each inlinable callsite of a debug-info-bearing function
in a debug-info-bearing function has a debug location attached to it. Failure to
do so causes an "!dbg attachment points at wrong subprogram for function"
assertion failure when the inliner sets up inline scope info.

rdar://problem/25878916

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 03:23:02 +00:00
Mehdi Amini
65562d6474 Reorganize GlobalValueSummary with a "Flags" bitfield.
Right now it only contains the LinkageType, but will be extended
with "hasSection", "isOptSize", "hasInlineAssembly", etc.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 03:18:18 +00:00
Mehdi Amini
3f53abc0a5 Add a version field in the bitcode for the summary
Differential Revision: http://reviews.llvm.org/D19456

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 03:18:11 +00:00
Mehdi Amini
bbf2e449fd Add an internalization step to the ThinLTOCodeGenerator
Keeping as much as possible internal/private is
known to help the optimizer. Let's try to benefit from
this in ThinLTO.
Note: this is early work, but is enough to build clang (and
all the LLVM tools). I still need to write some lit-tests...

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 03:18:01 +00:00
Craig Topper
2ea0a37593 Fix a couple assertions that can never fire because they just contained the text string which always evaluates to true. Add a ! so they'll evaluate to false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 02:01:25 +00:00
Craig Topper
51bf4a5e45 [X86] Fix patterns that turn cmove/cmovne+ctlz/cttz into lzcnt/tzcnt instructions. Only one of the conditions should be valid for each pattern, not both. Update tests accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267311 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 02:01:22 +00:00
Davide Italiano
b50e1f0066 [RuntimeDyldELF] Handle GOTPCRELX/REX_GOTPCRELX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 01:36:37 +00:00
Davide Italiano
e37fa30e4c [MC/ELF] Make the relaxation test more interesting.
Add a case where we can't relax.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267308 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 01:08:35 +00:00
Davide Italiano
3cabbfe89f [MC/ELF] Implement support for GOTPCRELX/REX_GOTPCRELX.
The option to control the emission of the new relocations
is -relax-relocations (blatantly copied from GNU as).
It can't be enabled by default because it breaks relatively
recent versions of ld.bfd/ld.gold (late 2015).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267307 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 01:03:57 +00:00
Mehdi Amini
678f885671 Relax test using CHECK-DAG instead of CHECK-NEXT
It seems we still have some ordering issue in the combined index
emission, but I can't figure out why right now.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267306 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 00:25:15 +00:00
Mehdi Amini
fed32f4e20 Fix test stability (was sensitive to the path)
This is a fixup for r267304.
The test was sensitive to the path in a subtle way:
the index in memory is sorted by GUID, which are hashes
that include the source filename for local globals.
Teresa recently added a directive at the IR level, so
we can specify it here to make the test independent of
the path.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267305 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-24 00:03:57 +00:00
Mehdi Amini
9ab3b37131 Store and emit original name in combined index
Summary:
As discussed in D18298, some local globals can't
be renamed/promoted (because they have a section, or because
they are referenced from inline assembly).
To be able to detect naming collision, we need to keep around
the "GUID" using their original name without taking the linkage
into account.

Reviewers: tejohnson

Subscribers: joker.eph, llvm-commits

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267304 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 23:38:17 +00:00
Mehdi Amini
aa73713b9a Always traverse GlobalVariable initializer when computing the export list
Summary:
We are always importing the initializer for a GlobalVariable.
So if a GlobalVariable is in the export-list, we pull in any
refs as well.

Reviewers: tejohnson

Subscribers: llvm-commits

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 23:29:24 +00:00
Duncan P. N. Exon Smith
1e7e2b2b55 DebugInfo: Change DIBuilder to make distinct DIGlobalVariables
A long overdue change to make DIGlobalVariable distinct.  Much like
DISubprogram definitions (changed in r246098), it isn't logical to
unique DIGlobalVariable definitions from two different compile units.

(Longer-term, we should also find a way to reverse the link between
GlobalVariable and DIGlobalVariable, and between DIGlobalVariable and
DICompileUnit, so that debug info to do with optimized-out globals
disappears.  Admittedly it's harder than with Function/DISubprogram,
since global variables may be constant-folded and the debug info should
still describe that somehow.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267301 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 22:29:09 +00:00
Davide Italiano
c24d780619 [MC/ELF] Pass Fixup to getRelocType64.
In preparation for other changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267300 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 22:26:31 +00:00
Duncan P. N. Exon Smith
6e9c743e87 BitcodeReader: Avoid std::vector with non-movable types from r267296
r267298 didn't quite fix the build errors.  Use SmallVector instead of
std::vector, the latter of which I think is trying to maintain a strong
exception safety guarantee.

http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/6228

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267299 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 21:36:59 +00:00
Duncan P. N. Exon Smith
e66594f0e9 BitcodeReader: Avoid non-moving std::piecewise_construct from r267296
Not exactly sure why the host tries to use a copy constructor here, but
it's easy enough to work around it.

http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/6227

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 21:23:41 +00:00
Duncan P. N. Exon Smith
de7484036b DebugInfo: Remove MDString-based type references
Eliminate DITypeIdentifierMap and make DITypeRef a thin wrapper around
DIType*.  It is no longer legal to refer to a DICompositeType by its
'identifier:', and DIBuilder no longer retains all types with an
'identifier:' automatically.

Aside from the bitcode upgrade, this is mainly removing logic to resolve
an MDString-based reference to an actualy DIType.  The commits leading
up to this have made the implicit type map in DICompileUnit's
'retainedTypes:' field superfluous.

This does not remove DITypeRef, DIScopeRef, DINodeRef, and
DITypeRefArray, or stop using them in DI-related metadata.  Although as
of this commit they aren't serving a useful purpose, there are patchces
under review to reuse them for CodeView support.

The tests in LLVM were updated with deref-typerefs.sh, which is attached
to the thread "[RFC] Lazy-loading of debug info metadata":

  http://lists.llvm.org/pipermail/llvm-dev/2016-April/098318.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 21:08:00 +00:00
Sanjay Patel
7ceecf02a1 replace duplicated static functions for profile metadata access with BranchInst member function; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267295 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 20:01:22 +00:00
Renato Golin
72b52a4e39 Revert "[AArch64] Fix optimizeCondBranch logic."
This reverts commit r267206, as it broke self-hosting on AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 19:30:52 +00:00
Sanjay Patel
e524aca898 improve documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267292 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 16:31:48 +00:00
Simon Pilgrim
91155b6344 [X86][XOP] Added VPPERM -> BLEND-WITH-ZERO Test
Currently failing due to poor blend matching, found whilst investigating PR27472

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 11:14:18 +00:00