platform/upstream/llvm.git
6 years ago[PowerPC] support ZERO_EXTEND in tryBitPermutation
Hiroshi Inoue [Mon, 2 Oct 2017 09:24:00 +0000 (09:24 +0000)]
[PowerPC] support ZERO_EXTEND in tryBitPermutation

This patch add a support of ISD::ZERO_EXTEND in PPCDAGToDAGISel::tryBitPermutation to increase the opportunity to use rotate-and-mask by reordering ZEXT and ANDI.
Since tryBitPermutation stops analyzing nodes if it hits a ZEXT node while traversing SDNodes, we want to avoid ZEXT between two nodes that can be folded into a rotate-and-mask instruction.

For example, we allow these nodes

      t9: i32 = add t7, Constant:i32<1>
    t11: i32 = and t9, Constant:i32<255>
  t12: i64 = zero_extend t11
t14: i64 = shl t12, Constant:i64<2>

to be folded into a rotate-and-mask instruction.
Such case often happens in array accesses with logical AND operation in the index, e.g. array[i & 0xFF];

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

llvm-svn: 314655

6 years ago[ELF] - Stop removing sections in removeUnusedSyntheticSections().
George Rimar [Mon, 2 Oct 2017 09:11:13 +0000 (09:11 +0000)]
[ELF] - Stop removing sections in removeUnusedSyntheticSections().

That makes code a bit more consistent. Instead of removing sections there
we can just mark them as dead. So that removeEmptyCommands() will
handle the rest.

Differential revision: https://reviews.llvm.org/D38393

llvm-svn: 314654

6 years agoFix typo in comment. NFCI.
Simon Pilgrim [Mon, 2 Oct 2017 09:10:50 +0000 (09:10 +0000)]
Fix typo in comment. NFCI.

llvm-svn: 314653

6 years ago[X86] Cleanup uses of computeKnownBits by using MaskedValueIsZero helper instead...
Simon Pilgrim [Mon, 2 Oct 2017 09:08:45 +0000 (09:08 +0000)]
[X86] Cleanup uses of computeKnownBits by using MaskedValueIsZero helper instead. NFCI.

llvm-svn: 314652

6 years ago[X86][LLVM]Expanding Supports lowerInterleaved{store|load}() in X86InterleavedAccess...
Michael Zuckerman [Mon, 2 Oct 2017 07:35:25 +0000 (07:35 +0000)]
[X86][LLVM]Expanding Supports lowerInterleaved{store|load}() in X86InterleavedAccess (VF64 stride 3-4)
I continue to support different VF interleaved and in this pass for this patch,
I added the vf64 stride3 support for both load and store.
I also added support fot the stride4 store.

Reviewers:
1. zvi
2. dorit
3. igorb
4. guyblank

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

Change-Id: I3d238efedf217d1768b348d710de1efa2f19d27b
llvm-svn: 314651

6 years agoDependent Address Space Support Test File
Andrew Gozillon [Mon, 2 Oct 2017 06:31:25 +0000 (06:31 +0000)]
Dependent Address Space Support Test File

Adding regression test for Dependent Address Spaces in relation to
https://reviews.llvm.org/D33666 I forgot to svn add the test file
before commiting the prior changes. I appologies.

llvm-svn: 314650

6 years agoDependent Address Space Support
Andrew Gozillon [Mon, 2 Oct 2017 06:25:51 +0000 (06:25 +0000)]
Dependent Address Space Support

This patch relates to: https://reviews.llvm.org/D33666 This adds support
for template parameters to be passed to the address_space attribute.
The main goal is to add further flexibility to the attribute and allow
for it to be used easily with templates.

The main additions are a new type (DependentAddressSpaceType) alongside
its TypeLoc and its mangling. As well as the logic required to support
dependent address spaces which mainly resides in TreeTransform.h and
SemaType.cpp.

llvm-svn: 314649

6 years ago[X86] Fix copy pasto in X86FastISel::fastEmitInst_rrrr.
Craig Topper [Mon, 2 Oct 2017 05:46:53 +0000 (05:46 +0000)]
[X86] Fix copy pasto in X86FastISel::fastEmitInst_rrrr.

The 4th operand was not being constrained and the third operand was being constrained twice.

llvm-svn: 314648

6 years ago[X86] Use a bool flag instead of assigning an unsigned to two different values that...
Craig Topper [Mon, 2 Oct 2017 05:46:52 +0000 (05:46 +0000)]
[X86] Use a bool flag instead of assigning an unsigned to two different values that we only use in an equality comparison.

llvm-svn: 314647

6 years ago[cmake] Add a separate CMake var to control profile runtime
Michal Gorny [Mon, 2 Oct 2017 05:03:55 +0000 (05:03 +0000)]
[cmake] Add a separate CMake var to control profile runtime

Make it possible to control building profile runtime separately from
other options. Before r313549, the profile runtime building was
controlled along with sanitizers. However, since that commit it is built
unconditionally which results in multiple builds for people building
different runtimes separately.

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

llvm-svn: 314646

6 years agoUpdate for LLVM change.
Rui Ueyama [Mon, 2 Oct 2017 02:09:58 +0000 (02:09 +0000)]
Update for LLVM change.

r314639 ([X86] Change register&memory TEST instructions from MRMSrcMem
to MRMDstMem) broke the test.

llvm-svn: 314645

6 years ago[ICF] Include section contents in section hash values.
Rui Ueyama [Mon, 2 Oct 2017 01:21:07 +0000 (01:21 +0000)]
[ICF] Include section contents in section hash values.

Computing section content hashes early seems like a win in terms of
performance. It increases a chance that two different sections will get
different class IDs from the beginning.

Without threads, this patch improves Chromium link time by about 0.3
seconds. With threads, by 0.1 seconds. That's less than 1% time saving
but not bad for a small patch.

llvm-svn: 314644

6 years ago[X86] Use _NOREX MOVZX instructions for some patterns even in 32-bit mode.
Craig Topper [Mon, 2 Oct 2017 00:44:50 +0000 (00:44 +0000)]
[X86] Use _NOREX MOVZX instructions for some patterns even in 32-bit mode.

This unifies the patterns between both modes. This should be effectively NFC since all the available registers in 32-bit mode statisfy this constraint.

llvm-svn: 314643

6 years ago[Hexagon] Check vector elements for equivalence in the HexagonVectorLoopCarriedReuse...
Ron Lieberman [Mon, 2 Oct 2017 00:34:07 +0000 (00:34 +0000)]
[Hexagon] Check vector elements for equivalence in the HexagonVectorLoopCarriedReuse pass

    If the two instructions being compared for equivalence have corresponding operands
    that are integer constants, then check their values to determine equivalence.

    Patch by Suyog Sarda!

llvm-svn: 314642

6 years ago[Hexagon] Patch to Extract i1 element from vector of i1
Ron Lieberman [Mon, 2 Oct 2017 00:16:15 +0000 (00:16 +0000)]
[Hexagon] Patch to Extract i1 element from vector of i1

This patch extracts 1 element from vector consisting
of elements of size 1 bit at given index.

llvm-svn: 314641

6 years ago[InstCombine] Use APInt for all the math in foldICmpDivConstant
Craig Topper [Sun, 1 Oct 2017 23:53:54 +0000 (23:53 +0000)]
[InstCombine] Use APInt for all the math in foldICmpDivConstant

Summary: This currently uses ConstantExpr to do its math, but as noted in a TODO it can all be done directly on APInt.

Reviewers: spatel, majnemer

Reviewed By: majnemer

Subscribers: llvm-commits

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

llvm-svn: 314640

6 years ago[X86] Change register&memory TEST instructions from MRMSrcMem to MRMDstMem
Craig Topper [Sun, 1 Oct 2017 23:53:53 +0000 (23:53 +0000)]
[X86] Change register&memory TEST instructions from MRMSrcMem to MRMDstMem

Summary:
Intel documentation shows the memory operand as the first operand. But we currently treat it as the second operand. Conceptually the order doesn't matter since it doesn't write memory. We have aliases to parse with the operands in either order and the isel matching is commutable.

For the register&register form order does matter for the assembly parser. PR22995 was previously filed and fixed by changing the register&register form from MRMSrcReg to MRMDestReg to match gas. Ideally the memory form should match by using MRMDestMem.

I believe this supercedes D38025 which was trying to switch the register&register form back to pre-PR22995.

Reviewers: aymanmus, RKSimon, zvi

Reviewed By: aymanmus

Subscribers: llvm-commits

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

llvm-svn: 314639

6 years ago[X86] Remove a couple unnecessary COPY_TO_REGCLASS from some output patterns where...
Craig Topper [Sun, 1 Oct 2017 23:53:50 +0000 (23:53 +0000)]
[X86] Remove a couple unnecessary COPY_TO_REGCLASS from some output patterns where the instruction already produces the correct register class.

llvm-svn: 314638

6 years agoInline hot functions.
Rui Ueyama [Sun, 1 Oct 2017 23:46:31 +0000 (23:46 +0000)]
Inline hot functions.

llvm-svn: 314637

6 years ago[ScopDetect] Do not add loads out of the SCoP to required invariant loads.
Michael Kruse [Sun, 1 Oct 2017 22:19:28 +0000 (22:19 +0000)]
[ScopDetect] Do not add loads out of the SCoP to required invariant loads.

Loads before the SCoP are always invariant within the SCoP and
therefore are no "required invariant loads". An assertion failes in
ScopBuilder when it finds such an invariant load.

Fix by not adding such loads to the required invariant load list. This
likely will cause the region to be not considered a valid SCoP.
We may want to unconditionally accept instructions defined before
the region as valid invariant conditions instead of rejecting them.

This fixes a compilation crash of SPEC CPU2006 453.povray's
render.cpp.

llvm-svn: 314636

6 years agoSjLj: Fix building after SVN r314632
Martin Storsjo [Sun, 1 Oct 2017 20:22:40 +0000 (20:22 +0000)]
SjLj: Fix building after SVN r314632

The code moved from Unwind_AppleExtras.cpp to Unwind-sjlj.c needed
a few minor modifications to build as C instead of C++.

llvm-svn: 314635

6 years agoLet get_work_dim take exactly 0 arguments
Jeroen Ketema [Sun, 1 Oct 2017 20:11:46 +0000 (20:11 +0000)]
Let get_work_dim take exactly 0 arguments

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 314634

6 years agoDo no circularly define NULL
Jeroen Ketema [Sun, 1 Oct 2017 20:10:14 +0000 (20:10 +0000)]
Do no circularly define NULL

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 314633

6 years agoSjLj: make the SjLj implementation more portable
Saleem Abdulrasool [Sun, 1 Oct 2017 20:06:48 +0000 (20:06 +0000)]
SjLj: make the SjLj implementation more portable

This moves the definition of the internal helpers
`__Unwind_SjLj_GetTopOfFunctionStack` and
`__Unwind_SjLj_SetTopOfFunctionStack` into `Unwind-sjlj.c`.  These are
not extra functions specific to Apple, but rather are internal
implementation details of SjLj support in the LLVM libunwind
implementation.

This allows us to remove the internal header unwind_ext.h, as these
functions are not meant to be used as SPI either.  Because they are
static, they will be given implicit hidden visibility, but due to the
simplicity should get fully inlined into the actual use.

Use the C11 standard static TLS annotation (`_Thread_local`) if
possible, otherwise, use the Windows specific `__declspec(thread)` when
targeting Windows or the GNU `__thread` extension.  In theory, it should
be possible for this implementation to use a `pthread_setspecific` and
`pthread_getspecific` on platforms with pthreads or `SetFlsValue` and
`GetFlsValue` on Windows for non-static TLS.  However, static TLS tends
to be significantly faster, so we really should prefer that over the
dynamic TLS approach.  On Apple environments, when not building for the
loader (dyld), use the pre-allocated TLS slot in the loader rather than
the local static TLS variable.

Note that the un-threaded support of libunwind is still present as
before, however, it is unsafe to use in a threaded environment as the
cleanup stack may be mutated incorrectly due to lack of locking across
threads.  In the static TLS model, the lock is unneeded as each thread
of execution retains its own copy of the cleanup stack.

Take the opportunity to clean up the comment block, removing the iOS
specific note as the SjLj implementation can be used outside of the
context of iOS.  Convert the rest of the explanation to a doxygen style
comment block.

llvm-svn: 314632

6 years ago[X86][SSE] Add faux shuffle combining support for PACKUS
Simon Pilgrim [Sun, 1 Oct 2017 18:43:48 +0000 (18:43 +0000)]
[X86][SSE] Add faux shuffle combining support for PACKUS

llvm-svn: 314631

6 years ago[X86][AVX2] Simplify PACKUS combine test
Simon Pilgrim [Sun, 1 Oct 2017 18:17:39 +0000 (18:17 +0000)]
[X86][AVX2] Simplify PACKUS combine test

Trying to use a AND mask is tricky as after legalization its nigh impossible for computeKnownBits to do anything with it

llvm-svn: 314630

6 years ago[X86][SSE] Improve shuffle combining of PACKSS instructions.
Simon Pilgrim [Sun, 1 Oct 2017 17:54:55 +0000 (17:54 +0000)]
[X86][SSE] Improve shuffle combining of PACKSS instructions.

Support unary packing and fix the faux shuffle mask for vectors larger than 128 bits.

llvm-svn: 314629

6 years ago[X86][SSE] Add shuffle combining tests with PACKSS/PACKUS
Simon Pilgrim [Sun, 1 Oct 2017 17:30:44 +0000 (17:30 +0000)]
[X86][SSE] Add shuffle combining tests with PACKSS/PACKUS

llvm-svn: 314628

6 years ago[x86] formatting; NFC
Sanjay Patel [Sun, 1 Oct 2017 14:39:10 +0000 (14:39 +0000)]
[x86] formatting; NFC

llvm-svn: 314627

6 years agopre-commit adding test for broadcastm pattern
Jina Nahias [Sun, 1 Oct 2017 14:25:21 +0000 (14:25 +0000)]
pre-commit adding test for broadcastm pattern

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

Change-Id: Ifbc4189549f2f59995019a86f85f989c04e4d37d
llvm-svn: 314626

6 years agoAdd missing REQUIRES line
Tobias Grosser [Sun, 1 Oct 2017 13:14:40 +0000 (13:14 +0000)]
Add missing REQUIRES line

llvm-svn: 314625

6 years ago[GPGPU] Set Polly's RTC to false in case invariant load hoisting fails
Tobias Grosser [Sun, 1 Oct 2017 12:39:14 +0000 (12:39 +0000)]
[GPGPU] Set Polly's RTC to false in case invariant load hoisting fails

This matches the behavior we already have in lib/Codegen/CodeGeneration.cpp and
makes sure that we fall back to the original code. It seems when invariant load
hoisting was introduced to the GPGPU backend we missed to reset the RTC flag,
such that kernels where invariant load hoisting failed executed the 'optimized'
SCoP, which however is set to a simple 'unreachable'. Unsurprisingly, this
results in hard to debug issues that are a lot of fun to debug.

llvm-svn: 314624

6 years agoTest Commit.
Andrew Gozillon [Sun, 1 Oct 2017 12:16:24 +0000 (12:16 +0000)]
Test Commit.

llvm-svn: 314623

6 years agoRevert r314579: "Recommi r314561 after fixing over-debug assertion".
Daniel Jasper [Sun, 1 Oct 2017 09:53:53 +0000 (09:53 +0000)]
Revert r314579: "Recommi r314561 after fixing over-debug assertion".

And follow-up r314585.
Leads to segfaults. I'll forward reproduction instructions to the patch
author.

Also, for a recommit, still add the original patch description.
Otherwise, it becomes really tedious to find out what a patch actually
does. The fact that it is a recommit with a fix is somewhat secondary.

llvm-svn: 314622

6 years agoAdding test for interleved, case stride 4 vf64 store<NFC>.
Michael Zuckerman [Sun, 1 Oct 2017 09:37:38 +0000 (09:37 +0000)]
Adding test for interleved, case stride 4 vf64 store<NFC>.

Change-Id: I9ea62aac81b763c83d26613dca6fcd846997a017
llvm-svn: 314621

6 years ago[lit] Fix running lit tests in unconfigured source dir
Michal Gorny [Sun, 1 Oct 2017 07:13:25 +0000 (07:13 +0000)]
[lit] Fix running lit tests in unconfigured source dir

Fix llvm_tools_dir attribute access not to fail when the variable is not
present. This directory is not really necessary to run lit tests,
and the code already accounts for it being None.

The reference was added in r313407, and it breaks the stand-alone lit
package in Gentoo.

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

llvm-svn: 314620

6 years agoSeparate the logic when handling indirect calls in SamplePGO ThinLTO compile phase...
Dehao Chen [Sun, 1 Oct 2017 05:24:51 +0000 (05:24 +0000)]
Separate the logic when handling indirect calls in SamplePGO ThinLTO compile phase and other phases.

Summary: In SamplePGO ThinLTO compile phase, we will not invoke ICP as it may introduce confusion to the 2nd annotation. This patch extracted that logic and makes it clearer before profile annotation. In the mean time, we need to make function importing process both inlined callsites as well as not promoted indirect callsites.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, mehdi_amini, llvm-commits, inglorion

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

llvm-svn: 314619

6 years agoFix .rst formatting error.
Rui Ueyama [Sun, 1 Oct 2017 03:50:48 +0000 (03:50 +0000)]
Fix .rst formatting error.

llvm-svn: 314618

6 years agoUpdate benchmark numbers.
Rui Ueyama [Sun, 1 Oct 2017 03:47:02 +0000 (03:47 +0000)]
Update benchmark numbers.

llvm-svn: 314617

6 years agoRun writeTo() concurrently.
Rui Ueyama [Sun, 1 Oct 2017 02:25:34 +0000 (02:25 +0000)]
Run writeTo() concurrently.

I don't know why we didn't use parallelForEach to call writeTo,
but there should be no reason to not do that, as most writeTo
functions are safe to run concurrently.

llvm-svn: 314616

6 years agoFix typo. NFC
Xin Tong [Sun, 1 Oct 2017 00:10:52 +0000 (00:10 +0000)]
Fix typo. NFC

llvm-svn: 314615

6 years agoRevert "Fix typo [NFC]"
Xin Tong [Sun, 1 Oct 2017 00:09:53 +0000 (00:09 +0000)]
Revert "Fix typo [NFC]"

This reverts commit e60b5028619be1c81bd039d63a0627dac32d38f9.

Incorrectly include changes that are not typo fix.

llvm-svn: 314614

6 years agoFix typo [NFC]
Xin Tong [Sun, 1 Oct 2017 00:07:24 +0000 (00:07 +0000)]
Fix typo [NFC]

llvm-svn: 314613

6 years agoNewGVN: Fix PR 34473, by not using ExactlyEqualsExpression for finding
Daniel Berlin [Sat, 30 Sep 2017 23:51:55 +0000 (23:51 +0000)]
NewGVN: Fix PR 34473, by not using ExactlyEqualsExpression for finding
phi of ops users.

llvm-svn: 314612

6 years agoNewGVN: Evaluate phi of ops expressions before creating phi node
Daniel Berlin [Sat, 30 Sep 2017 23:51:54 +0000 (23:51 +0000)]
NewGVN: Evaluate phi of ops expressions before creating phi node

llvm-svn: 314611

6 years agoNewGVN: Allow dependent PHI of ops
Daniel Berlin [Sat, 30 Sep 2017 23:51:53 +0000 (23:51 +0000)]
NewGVN: Allow dependent PHI of ops

llvm-svn: 314610

6 years agoNewGVN: Make OpIsSafeForPhiOfOps non-recursive
Daniel Berlin [Sat, 30 Sep 2017 23:51:04 +0000 (23:51 +0000)]
NewGVN: Make OpIsSafeForPhiOfOps non-recursive

llvm-svn: 314609

6 years ago[test] Allow other implementations to strengthen noexcept on deque's move constructor
Casey Carter [Sat, 30 Sep 2017 23:15:22 +0000 (23:15 +0000)]
[test] Allow other implementations to strengthen noexcept on deque's move constructor

llvm-svn: 314608

6 years agoRegenerate mul combine tests to update broadcast comment.
Simon Pilgrim [Sat, 30 Sep 2017 22:27:46 +0000 (22:27 +0000)]
Regenerate mul combine tests to update broadcast comment.

llvm-svn: 314607

6 years ago[lldb-mi] Fix a thinko in my previous commit.
Davide Italiano [Sat, 30 Sep 2017 21:52:31 +0000 (21:52 +0000)]
[lldb-mi] Fix a thinko in my previous commit.

Hopefully this should unbreak the Android buildbot.

llvm-svn: 314606

6 years ago[Analysis] Remove unused makeLvalueToRValue variant.
Davide Italiano [Sat, 30 Sep 2017 21:49:15 +0000 (21:49 +0000)]
[Analysis] Remove unused makeLvalueToRValue variant.

llvm-svn: 314605

6 years ago[lldb-mi] Add a default case to placate GCC with -Werror.
Davide Italiano [Sat, 30 Sep 2017 21:30:41 +0000 (21:30 +0000)]
[lldb-mi] Add a default case to placate GCC with -Werror.

llvm-svn: 314604

6 years agoFix 32-bit buildbots.
Rui Ueyama [Sat, 30 Sep 2017 21:28:49 +0000 (21:28 +0000)]
Fix 32-bit buildbots.

The result of hash_value(StringRef) depends on sizeof(size_t).
That causes lld to create different mergeable table contents on
32-bit machines.

This patch is to use xxHash64 so that we get the same hash values
on 32-bit machines.

llvm-svn: 314603

6 years ago[ExpressionParser] Prefer isa<> to dyn_cast<>. NFCI.
Davide Italiano [Sat, 30 Sep 2017 21:16:56 +0000 (21:16 +0000)]
[ExpressionParser] Prefer isa<> to dyn_cast<>. NFCI.

The result type is unused anyway.

llvm-svn: 314602

6 years agoRefactor the SamplePGO profile annotation logic to extract inlineCallInstruction...
Dehao Chen [Sat, 30 Sep 2017 20:46:15 +0000 (20:46 +0000)]
Refactor the SamplePGO profile annotation logic to extract inlineCallInstruction. (NFC)

llvm-svn: 314601

6 years ago[NFC] Add assertion that we assume a valid macro argument index.
Faisal Vali [Sat, 30 Sep 2017 19:34:27 +0000 (19:34 +0000)]
[NFC] Add assertion that we assume a valid macro argument index.

llvm-svn: 314600

6 years ago[X86][SSE] Fold (VSRAI (VSHLI X, C1), C1) --> X iff NumSignBits(X) > C1
Simon Pilgrim [Sat, 30 Sep 2017 17:57:34 +0000 (17:57 +0000)]
[X86][SSE] Fold (VSRAI (VSHLI X, C1), C1) --> X iff NumSignBits(X) > C1

Remove sign extend in register style pattern if the sign is already extended enough

llvm-svn: 314599

6 years ago[AVX-512] Add patterns to make fp compare instructions commutable during isel.
Craig Topper [Sat, 30 Sep 2017 17:02:39 +0000 (17:02 +0000)]
[AVX-512] Add patterns to make fp compare instructions commutable during isel.

llvm-svn: 314598

6 years ago[X86][SSE] Add vector truncation cases inspired by PR34773
Simon Pilgrim [Sat, 30 Sep 2017 16:14:59 +0000 (16:14 +0000)]
[X86][SSE] Add vector truncation cases inspired by PR34773

We should be using PACKSS/PACKUS more aggressively when we know the state of the upper bits

llvm-svn: 314597

6 years agoCode refactoring for the interleaved code <NFC>
Michael Zuckerman [Sat, 30 Sep 2017 14:55:03 +0000 (14:55 +0000)]
Code refactoring for the interleaved code <NFC>

Change-Id: I7831c9febad8e14278a5bc87584a0053dc837be1
llvm-svn: 314596

6 years ago[NFC] Sync function call with changes to interface made in r314593.
Faisal Vali [Sat, 30 Sep 2017 14:36:00 +0000 (14:36 +0000)]
[NFC] Sync function call with changes to interface made in r314593.

llvm-svn: 314595

6 years ago[X86][SKX] Added codegen regression test for avx512 instructions scheduling.NFC.
Gadi Haber [Sat, 30 Sep 2017 14:30:23 +0000 (14:30 +0000)]
[X86][SKX] Added codegen regression test for avx512 instructions scheduling.NFC.

NFC.
 Added code gen regression tests for avx512 instructions scheduling called avx512-schedule.ll and
 avx512-shuffle-schedule.ll.
 This patch is in preparation of a larger patch of adding all SKX instruction scheduling and therefore
 the scheduling for the avx512 instructions are still missing.

Reviewers: zvi, delena, RKSimon, igorb
Differential Revision: https://reviews.llvm.org/D38035

Change-Id: I792762763127a921b9e13684b58af03646536533
llvm-svn: 314594

6 years ago[NFC] Remove superfluous parameter
Faisal Vali [Sat, 30 Sep 2017 13:58:38 +0000 (13:58 +0000)]
[NFC] Remove superfluous parameter
 - MacroArgs already knows the maximum number of arguments that can be supplied to the macro.  No need to pass MacroInfo (information about the macro definition) to the call to getPreExpArgument (which by the way might benefit from being called getExpandedArgument() ?) for it to compute the number of arguments.

llvm-svn: 314593

6 years agoSyntheticSections.cpp: Appease g++-4.8, s/const/constexpr/
NAKAMURA Takumi [Sat, 30 Sep 2017 13:40:22 +0000 (13:40 +0000)]
SyntheticSections.cpp: Appease g++-4.8, s/const/constexpr/

llvm-svn: 314592

6 years agoMake parameter lists of SymbolTable::add* functions more consistent. NFC.
Rui Ueyama [Sat, 30 Sep 2017 12:41:34 +0000 (12:41 +0000)]
Make parameter lists of SymbolTable::add* functions more consistent. NFC.

llvm-svn: 314591

6 years agoFix buildbots.
Rui Ueyama [Sat, 30 Sep 2017 12:19:08 +0000 (12:19 +0000)]
Fix buildbots.

llvm-svn: 314590

6 years agoRevert r314435: "[JumpThreading] Preserve DT and LVI across the pass"
Daniel Jasper [Sat, 30 Sep 2017 11:57:19 +0000 (11:57 +0000)]
Revert r314435: "[JumpThreading] Preserve DT and LVI across the pass"

Causes a segfault on a builtbot (and in our internal bootstrapping of
Clang). See Eli's response on the commit thread.

llvm-svn: 314589

6 years agoParallelize string merging.
Rui Ueyama [Sat, 30 Sep 2017 11:46:26 +0000 (11:46 +0000)]
Parallelize string merging.

String merging is one of the most time-consuming functions in lld.
This patch parallelize it to speed it up. On my 2-socket 20-core
40-threads Xeon E5-2680 @ 2.8 GHz machine, this patch shorten the
clang debug build link time from 7.11s to 5.16s. It's a 27%
improvement and actually pretty noticeable. In this test condition,
lld is now 4x faster than gold.

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

llvm-svn: 314588

6 years ago[clangd] simplify ClangdLSPServer by private-inheriting callback interfaces. NFC
Sam McCall [Sat, 30 Sep 2017 10:08:52 +0000 (10:08 +0000)]
[clangd] simplify ClangdLSPServer by private-inheriting callback interfaces. NFC

Summary:
There doesn't seem to be any real separation between the current three objects.
Feel free to reject this if you find the current style valuable, though.

(Mostly I'm just looking around for cleanups to help me understand the code).

Reviewers: ilya-biryukov

Subscribers: cfe-commits

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

llvm-svn: 314587

6 years agoclang/test/SemaCXX/ms-iunknown-template-function.cpp: Appease for targeting *-win32.
NAKAMURA Takumi [Sat, 30 Sep 2017 09:16:41 +0000 (09:16 +0000)]
clang/test/SemaCXX/ms-iunknown-template-function.cpp: Appease for targeting *-win32.

This expects the warning;

  File clang/test/SemaCXX/ms-iunknown-template-function.cpp Line 19: __declspec attribute 'novtable' is not supported

But for targeting *-win32, the warning is not seen.

  error: 'warning' diagnostics expected but not seen:
    File clang\test\SemaCXX\ms-iunknown-template-function.cpp Line 19 (directive at clang\test\SemaCXX\ms-iunknown-template-function.cpp:18): __declspec attribute 'novtable'

llvm-svn: 314586

6 years agoFix buildbot failure -- tighten type check for matching phi
Xinliang David Li [Sat, 30 Sep 2017 05:27:46 +0000 (05:27 +0000)]
Fix buildbot failure -- tighten type check for matching phi

llvm-svn: 314585

6 years ago[X86] Support v64i8 mulhu/mulhs
Craig Topper [Sat, 30 Sep 2017 04:21:46 +0000 (04:21 +0000)]
[X86] Support v64i8 mulhu/mulhs

Implemented by splitting into two v32i8 mulhu/mulhs and concatenating the results.

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

llvm-svn: 314584

6 years ago[ODRHash] Add base classes to hashing CXXRecordDecl.
Richard Trieu [Sat, 30 Sep 2017 02:19:17 +0000 (02:19 +0000)]
[ODRHash] Add base classes to hashing CXXRecordDecl.

llvm-svn: 314581

6 years ago[Analyzer] Add dummy implementation to call_once to avoid linkage warnings in tests.
George Karpenkov [Sat, 30 Sep 2017 01:15:35 +0000 (01:15 +0000)]
[Analyzer] Add dummy implementation to call_once to avoid linkage warnings in tests.

llvm-svn: 314580

6 years agoRecommi r314561 after fixing over-debug assertion
Xinliang David Li [Sat, 30 Sep 2017 00:46:32 +0000 (00:46 +0000)]
Recommi r314561 after fixing over-debug assertion

llvm-svn: 314579

6 years ago[llvm-rc] Serialize DIALOG(EX) to .res files (serialization, pt 4).
Marek Sokolowski [Sat, 30 Sep 2017 00:38:52 +0000 (00:38 +0000)]
[llvm-rc] Serialize DIALOG(EX) to .res files (serialization, pt 4).

This is now able to serialize DIALOG and DIALOGEX resources to .res
files. It still can't parse dialog-specific CAPTION, FONT, and STYLE
optional statement - these will be added in the following patch.

A limited set of controls is included. However, more can be easily added
by extending SupportedCtls map defined in ResourceScriptStmt.cpp.

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

llvm-svn: 314578

6 years agotypos
Adrian Prantl [Sat, 30 Sep 2017 00:31:15 +0000 (00:31 +0000)]
typos

llvm-svn: 314577

6 years agollvm-dwarfdump: implement the --name lookup option.
Adrian Prantl [Sat, 30 Sep 2017 00:22:25 +0000 (00:22 +0000)]
llvm-dwarfdump: implement the --name lookup option.

llvm-svn: 314576

6 years agoFix 80 column violations
Adrian Prantl [Sat, 30 Sep 2017 00:22:24 +0000 (00:22 +0000)]
Fix 80 column violations

llvm-svn: 314575

6 years agoAdd comments
Adrian Prantl [Sat, 30 Sep 2017 00:22:21 +0000 (00:22 +0000)]
Add comments

llvm-svn: 314574

6 years ago[Analyzer] Document a gotcha: for C++ -analyze-function requires parameters in functi...
George Karpenkov [Sat, 30 Sep 2017 00:07:22 +0000 (00:07 +0000)]
[Analyzer] Document a gotcha: for C++ -analyze-function requires parameters in function name

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

llvm-svn: 314573

6 years ago[Analyzer] Add nullability to the list of tested checkers in SATestBuild
George Karpenkov [Sat, 30 Sep 2017 00:05:24 +0000 (00:05 +0000)]
[Analyzer] Add nullability to the list of tested checkers in SATestBuild

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

llvm-svn: 314572

6 years ago[Analyzer] Synthesize function body for std::call_once
George Karpenkov [Sat, 30 Sep 2017 00:03:22 +0000 (00:03 +0000)]
[Analyzer] Synthesize function body for std::call_once

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

llvm-svn: 314571

6 years agoAdd a "vexing parse" warning for ambiguity between a variable declaration and a
Richard Smith [Fri, 29 Sep 2017 23:57:25 +0000 (23:57 +0000)]
Add a "vexing parse" warning for ambiguity between a variable declaration and a
function-style cast.

This fires for cases such as

  T(x);

... where 'x' was previously declared and T is a type. This construct declares
a variable named 'x' rather than the (probably expected) interpretation of a
function-style cast of 'x' to T.

llvm-svn: 314570

6 years ago[AMDGPU] Set fast-math flags on functions given the options
Stanislav Mekhanoshin [Fri, 29 Sep 2017 23:40:19 +0000 (23:40 +0000)]
[AMDGPU] Set fast-math flags on functions given the options

We have a single library build without relaxation options.
When inlined library functions remove fast math attributes
from the functions they are integrated into.

This patch sets relaxation attributes on the functions after
linking provided corresponding relaxation options are given.
Math instructions inside the inlined functions remain to have
no fast flags, but inlining does not prevent fast math
transformations of a surrounding caller code anymore.

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

llvm-svn: 314568

6 years agoCodeGen: Fix pointer info in expandUnalignedLoad/Store
Yaxun Liu [Fri, 29 Sep 2017 23:31:14 +0000 (23:31 +0000)]
CodeGen: Fix pointer info in expandUnalignedLoad/Store

Currently expandUnalignedLoad/Store uses place holder pointer info for temporary memory operand
in stack, which does not have correct address space. This causes unaligned private double16 load/store to be
lowered to flat_load instead of buffer_load for amdgcn target.

This fixes failures of OpenCL conformance test basic/vload_private/vstore_private on target amdgcn---amdgizcl.

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

llvm-svn: 314566

6 years agofix 80 column violation.
Adrian Prantl [Fri, 29 Sep 2017 22:46:22 +0000 (22:46 +0000)]
fix 80 column violation.

llvm-svn: 314564

6 years agoRevert 314561 due to debug build assertion failure
Xinliang David Li [Fri, 29 Sep 2017 22:30:34 +0000 (22:30 +0000)]
Revert 314561 due to debug build assertion failure

llvm-svn: 314563

6 years ago[llvm-rc] Serialize MENU resources to .res files (serialization, pt 3).
Marek Sokolowski [Fri, 29 Sep 2017 22:25:05 +0000 (22:25 +0000)]
[llvm-rc] Serialize MENU resources to .res files (serialization, pt 3).

This allows MENU resources to be serialized.

MENU resource statement doc:
msdn.microsoft.com/en-us/library/windows/desktop/aa381025.aspx
POPUP sub-statement doc:
msdn.microsoft.com/en-us/library/windows/desktop/aa381030.aspx
MENUITEM sub-statement doc:
msdn.microsoft.com/en-us/library/windows/desktop/aa381024.aspx
MENUHEADER structure:
msdn.microsoft.com/en-us/library/windows/desktop/ms648018.aspx (and
NORMALMENUITEM, POPUPMENUITEM structs).

Thanks for Nico Weber for his original work in this area.

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

llvm-svn: 314562

6 years agoEliminate PHI (int typed) which has only one use by intptr
Xinliang David Li [Fri, 29 Sep 2017 22:10:15 +0000 (22:10 +0000)]
Eliminate PHI (int typed) which has only one use by intptr

This patch will eliminate redundant intptr/ptrtoint that pessimizes
analyses such as SCEV, AA and will make optimization passes such
as auto-vectorization more powerful.

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

llvm-svn: 314561

6 years agoRevert "Use the basic cost if a GEP is not used as addressing mode"
Alex Shlyapnikov [Fri, 29 Sep 2017 22:04:45 +0000 (22:04 +0000)]
Revert "Use the basic cost if a GEP is not used as addressing mode"

This reverts commit r314517.

This commit crashes sanitizer bots, for example:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/4167

Stack snippet:
...
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Support/Casting.h:255:0
llvm::TargetTransformInfoImplCRTPBase<llvm::X86TTIImpl>::getGEPCost(llvm::GEPOperator const*, llvm::ArrayRef<llvm::Value const*>)
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:742:0
llvm::TargetTransformInfoImplCRTPBase<llvm::X86TTIImpl>::getUserCost(llvm::User const*, llvm::ArrayRef<llvm::Value const*>)
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:782:0
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/lib/Analysis/TargetTransformInfo.cpp:116:0
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/ADT/SmallVector.h:116:0
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/ADT/SmallVector.h:343:0
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/ADT/SmallVector.h:864:0
/mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/include/llvm/Analysis/TargetTransformInfo.h:285:0
...

llvm-svn: 314560

6 years ago[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Fri, 29 Sep 2017 21:55:49 +0000 (21:55 +0000)]
[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 314559

6 years ago[PS4] Tidy up some debug-tuning v. triple decision-making.
Paul Robinson [Fri, 29 Sep 2017 21:25:07 +0000 (21:25 +0000)]
[PS4] Tidy up some debug-tuning v. triple decision-making.

llvm-svn: 314558

6 years ago[Sema] Correct IUnknown to support Unknwnbase.h Header.
Erich Keane [Fri, 29 Sep 2017 21:06:00 +0000 (21:06 +0000)]
[Sema] Correct IUnknown to support Unknwnbase.h Header.

Apparently, the MSVC SDK has a strange implementation that
causes a number of implicit functions as well as a template member
function of the IUnknown type. This patch allows these as InterfaceLike
types as well.

Additionally, it corrects the behavior where extern-C++ wrapped around an
Interface-Like type would permit an interface-like type to exist in a namespace.

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

llvm-svn: 314557

6 years agoMove LoadedModule list to a NoCtor vector and initialize on demand.
Francis Ricci [Fri, 29 Sep 2017 20:55:06 +0000 (20:55 +0000)]
Move LoadedModule list to a NoCtor vector and initialize on demand.

Unreverting this patch because llvm-clang-lld-x86_64-debian-fast started
passing again before the revert hit. Must've been just a flake.

llvm-svn: 314556

6 years agoRevert "Move LoadedModule list to a NoCtor vector and initialize on demand."
Francis Ricci [Fri, 29 Sep 2017 20:04:29 +0000 (20:04 +0000)]
Revert "Move LoadedModule list to a NoCtor vector and initialize on demand."

I think this may have introduced a failure on
llvm-clang-lld-x86_64-debian-fast

This reverts commit r314533

llvm-svn: 314552

6 years agoRevert "[CMake] Remove `CMAKE_.*_OUTPUT_DIRECTORY` (NFCI)"
Brian Gesiak [Fri, 29 Sep 2017 19:50:41 +0000 (19:50 +0000)]
Revert "[CMake] Remove `CMAKE_.*_OUTPUT_DIRECTORY` (NFCI)"

Summary:
It appears polly makes use of the `CMAKE_RUNTIME_OUTPUT_DIRECTORY` variable
when configuring its lit test suite. Reverting this for now.

llvm-svn: 314551

6 years ago[CMake] Remove `CMAKE_.*_OUTPUT_DIRECTORY` (NFCI)
Brian Gesiak [Fri, 29 Sep 2017 19:34:57 +0000 (19:34 +0000)]
[CMake] Remove `CMAKE_.*_OUTPUT_DIRECTORY` (NFCI)

Summary:
Three `CMAKE_.*_OUTPUT_DIRECTORY` variables used to be set in CMake and
referenced in various other parts of the project. However, in r198205
chapuni added a note to "don't set them anymore", and any remaining
references to them were subsequently removed in r198316 and r199592.

Now that the variables are no longer used anywhere, remove them, along
with the comments advising against using them any longer.

Test Plan:
I ran `check-all` and confirmed the tests built and passed.

Reviewers: beanz, chapuni

Reviewed By: beanz

Subscribers: mgorny

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

llvm-svn: 314550

6 years ago[llvm-rc] Serialize ACCELERATORS to .res files (serialization, pt 2).
Marek Sokolowski [Fri, 29 Sep 2017 19:07:44 +0000 (19:07 +0000)]
[llvm-rc] Serialize ACCELERATORS to .res files (serialization, pt 2).

This allows llvm-rc to serialize ACCELERATORS resources.

Additionally, as this is the first type of resource to support basic
optional resource statements (LANGUAGE, CHARACTERISTICS, VERSION),

ACCELERATORS statement documentation:
msdn.microsoft.com/en-us/library/windows/desktop/aa380610.aspx
Accelerator table structure documentation:
msdn.microsoft.com/en-us/library/windows/desktop/ms648010.aspx
Optional resource statement fields are described in:
msdn.microsoft.com/en-us/library/windows/desktop/ms648027.aspx

Thanks for Nico Weber for his original work in this area.

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

llvm-svn: 314549

6 years agoFix amdgcn-amdhsa on llvm-3.9
Jan Vesely [Fri, 29 Sep 2017 19:06:52 +0000 (19:06 +0000)]
Fix amdgcn-amdhsa on llvm-3.9

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 314548