OSDN Git Service

android-x86/external-llvm.git
6 years ago[ARM GlobalISel] Bail out for byval
Diana Picus [Thu, 30 Nov 2017 12:23:44 +0000 (12:23 +0000)]
[ARM GlobalISel] Bail out for byval

Fallback if we have a byval parameter or argument since we don't support
them yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319428 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeGen] Print "%vreg0" as "%0" in both MIR and debug output
Francis Visoiu Mistrih [Thu, 30 Nov 2017 12:12:19 +0000 (12:12 +0000)]
[CodeGen] Print "%vreg0" as "%0" in both MIR and debug output

As part of the unification of the debug format and the MIR format, avoid
printing "vreg" for virtual registers (which is one of the current MIR
possibilities).

Basically:

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E "s/%vreg([0-9]+)/%\1/g"
* grep -nr '%vreg' . and fix if needed
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E "s/ vreg([0-9]+)/ %\1/g"
* grep -nr 'vreg[0-9]\+' . and fix if needed

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319427 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX512] Tag binop/rounding/sae instructions scheduler classes
Simon Pilgrim [Thu, 30 Nov 2017 12:01:52 +0000 (12:01 +0000)]
[X86][AVX512] Tag binop/rounding/sae instructions scheduler classes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319424 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MC] Function stack size section.
Sean Eveson [Thu, 30 Nov 2017 12:01:16 +0000 (12:01 +0000)]
[MC] Function stack size section.

Summary:
Original RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-August/117028.html

I wasn't sure who to put as reviewers, so please add/remove people as appropriate.

This change adds a '.stack-size' section containing metadata on function stack sizes to output ELF files behind the new -stack-size-section flag. The section contains pairs of function symbol references (8 byte) and stack sizes (unsigned LEB128).

The contents of this section can be used to measure changes to stack sizes between different versions of the compiler or a source base. The advantage of having a section is that we can extract this information when examining binaries that we didn't build, and it allows users and tools easy access to that information just by referencing the binary.

There is a follow up change to add an option to clang.

Thanks.

Reviewers: hfinkel, MatzeB

Reviewed By: MatzeB

Subscribers: thegameg, asb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319423 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombine] Refactor ReduceLoadWidth
Sam Parker [Thu, 30 Nov 2017 11:49:11 +0000 (11:49 +0000)]
[DAGCombine] Refactor ReduceLoadWidth

visitAND attempts to narrow the width of extending loads that are
then masked off. ReduceLoadWidth already exists for a similar purpose
and handles shifts, so I've moved the code to handle AND nodes there.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319421 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSupport generic lowering of vector bswap
Serge Guelton [Thu, 30 Nov 2017 11:06:22 +0000 (11:06 +0000)]
Support generic lowering of vector bswap

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319419 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes
Simon Pilgrim [Thu, 30 Nov 2017 10:48:47 +0000 (10:48 +0000)]
[X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319418 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[dsymutil] Exclude namespace from ifdef in CFBundle
Jonas Devlieghere [Thu, 30 Nov 2017 10:41:31 +0000 (10:41 +0000)]
[dsymutil] Exclude namespace from ifdef in CFBundle

Should fix build failure introduced by r319416 on non-darwin hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319417 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[dsymutil] Upstream getBundleInfo implementation
Jonas Devlieghere [Thu, 30 Nov 2017 10:25:28 +0000 (10:25 +0000)]
[dsymutil] Upstream getBundleInfo implementation

This patch implements `getBundleInfo`, which uses CoreFoundation to
obtain information about the CFBundle. This information is needed to
populate the Plist in the dSYM bundle.

This change only applies to darwin and is an NFC as far as other
platforms are concerned.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319416 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert rL319407: [SROA] enable splitting for non-whole-alloca loads and stores
Hiroshi Inoue [Thu, 30 Nov 2017 08:29:51 +0000 (08:29 +0000)]
Revert rL319407: [SROA] enable splitting for non-whole-alloca loads and stores

This reverts commit rL319407 due to failures in some buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319410 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SystemZ] Bugfix in adjustSubwordCmp.
Jonas Paulsson [Thu, 30 Nov 2017 08:18:50 +0000 (08:18 +0000)]
[SystemZ]  Bugfix in adjustSubwordCmp.

Csmith generated a program where a store after load to the same address did
not get chained after the new load created during DAG legalizing, and so
performed an illegal overwrite of the expected value.

When the new zero-extending load is created, the chain users of the original
load must be updated, which was not done previously.

A similar case was also found and handled in lowerBITCAST.

Review: Ulrich Weigand
https://reviews.llvm.org/D40542

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319409 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SROA] enable splitting for non-whole-alloca loads and stores
Hiroshi Inoue [Thu, 30 Nov 2017 07:44:46 +0000 (07:44 +0000)]
[SROA] enable splitting for non-whole-alloca loads and stores

Currently, SROA splits loads and stores only when they are accessing the whole alloca.
This patch relaxes this limitation to allow splitting a load/store if all other loads and stores to the alloca are disjoint to or fully included in the current load/store. If there is no other load or store that crosses the boundary of the current load/store, the current splitting implementation works as is.
The whole-alloca loads and stores meet this new condition and so they are still splittable.

Here is a simplified motivating example.

struct record {
    long long a;
    int b;
    int c;
};

int func(struct record r) {
    for (int i = 0; i < r.c; i++)
        r.b++;
    return r.b;
}

When updating r.b (or r.c as well), LLVM generates redundant instructions on some platforms (such as x86_64, ppc64); here, r.b and r.c are packed into one 64-bit GPR when the struct is passed as a method argument.

With this patch, the above example is compiled into only few instructions without loop.
Without the patch, unnecessary loop-carried dependency is introduced by SROA and the loop cannot be eliminated by the later optimizers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319407 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Optimize avx2 vgatherqps for v2f32 with v2i64 index type.
Craig Topper [Thu, 30 Nov 2017 07:01:40 +0000 (07:01 +0000)]
[X86] Optimize avx2 vgatherqps for v2f32 with v2i64 index type.

Normal type legalization will widen everything. This requires forcing 0s into the mask register. We can instead choose the form that only reads 2 elements without zeroing the mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319406 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Make sure we don't remove sign extends of masks with AVX2 masked gathers.
Craig Topper [Thu, 30 Nov 2017 06:31:31 +0000 (06:31 +0000)]
[X86] Make sure we don't remove sign extends of masks with AVX2 masked gathers.

We don't use k-registers and instead use the MSB so we need to make sure we sign extend the mask to the msb.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319405 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[XRay][docs] Update documentation on new default for xray_naive_log=
Dean Michael Berris [Thu, 30 Nov 2017 05:35:51 +0000 (05:35 +0000)]
[XRay][docs] Update documentation on new default for xray_naive_log=

We've recently changed the default for `xray_naive_log=` to be `false`
instead of `true` to make it more consistent with the FDR mode logging
implementation. This means we will now ask users to explicitly choose
which version of the XRay logging is being used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319400 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago- Removed unused lamba (IsReturnBlock) causing build bots to fail for r319398
Graham Yiu [Thu, 30 Nov 2017 03:36:57 +0000 (03:36 +0000)]
- Removed unused lamba (IsReturnBlock) causing build bots to fail for r319398
- Added lit testcases that were supposed to be part of r319398

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319399 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoWith PGO information, we can do more aggressive outlining of cold regions in the...
Graham Yiu [Thu, 30 Nov 2017 02:41:36 +0000 (02:41 +0000)]
With PGO information, we can do more aggressive outlining of cold regions in the inline candidate function. This contrasts with the scheme of keeping only the 'early return' portion of the inline candidate and outlining the rest of the function as a single function call.

Support for outlining multiple regions of each function is added, as well as some basic heuristics to determine which regions are good to outline. Outline candidates limited to regions that are single-entry & single-exit. We also avoid outlining regions that produce live-exit variables, which may inhibit some forms of code motion (like commoning).

Fallback to the regular partial inlining scheme is retained when either i) no regions are identified for outlining in the function, or ii) the outlined function could not be inlined in any of its callers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319398 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[libFuzzer] mention one more trophie in the Linux Kernel
Kostya Serebryany [Thu, 30 Nov 2017 02:26:47 +0000 (02:26 +0000)]
[libFuzzer] mention one more trophie in the Linux Kernel

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319397 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Allow negative MUBUF vaddr for gfx9
Matt Arsenault [Thu, 30 Nov 2017 00:52:40 +0000 (00:52 +0000)]
AMDGPU: Allow negative MUBUF vaddr for gfx9

GFX9 does not enable bounds checking for the resource descriptors
used for private access, so it should be OK to use vaddr with
a potentially negative value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319393 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCheck alignment in getSectionContentsAsArray.
Rafael Espindola [Thu, 30 Nov 2017 00:44:22 +0000 (00:44 +0000)]
Check alignment in getSectionContentsAsArray.

While the ArrayRef can technically have unaligned data, it would be
extremely surprising if iterating over it caused undefined behavior
when a reference to the underlying type was bound.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319392 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Coverage] Use the most-recent completed region count (PR35437)
Vedant Kumar [Thu, 30 Nov 2017 00:28:23 +0000 (00:28 +0000)]
[Coverage] Use the most-recent completed region count (PR35437)

This is a fix for the coverage segment builder.

If multiple regions must be popped off the active stack at once, and
more than one of them end at the same location, emit a segment using the
count from the most-recent completed region.

Fixes PR35437, rdar://35760630

Testing: invoked llvm-cov on a stage2 build of clang, additional unit
tests, check-profile

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319391 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoLowerTypeTests: Deduplicate code. NFC.
Peter Collingbourne [Thu, 30 Nov 2017 00:27:08 +0000 (00:27 +0000)]
LowerTypeTests: Deduplicate code. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319390 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoLowerTypeTests: Remove unnecessary cast. NFC.
Peter Collingbourne [Thu, 30 Nov 2017 00:02:55 +0000 (00:02 +0000)]
LowerTypeTests: Remove unnecessary cast. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319387 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove some questionable looking code that seems to be looking through a VZEXT...
Craig Topper [Wed, 29 Nov 2017 23:08:25 +0000 (23:08 +0000)]
[X86] Remove some questionable looking code that seems to be looking through a VZEXT to create a larger VSEXT.

If the input the vzext was signed this would do the wrong thing.

Not sure how to test this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319382 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFirst step towards more human-friendly PPC assembler output:
Joerg Sonnenberger [Wed, 29 Nov 2017 23:05:56 +0000 (23:05 +0000)]
First step towards more human-friendly PPC assembler output:
- add -ppc-reg-with-percent-prefix option to use %r3 etc as register
  names
- split off logic for Darwinish verbose conditional codes into a helper
  function
- be explicit about Darwin vs AIX vs GNUish assembler flavors

Based on the patch from Alexandre Yukio Yamashita

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319381 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Update test expectations for gcc torture tests
Sam Clegg [Wed, 29 Nov 2017 23:05:50 +0000 (23:05 +0000)]
[WebAssembly] Update test expectations for gcc torture tests

I believe these were recently fixed by:
https://reviews.llvm.org/rL319186

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319380 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeView] Factor some code out of TypeTableBuilder.
Zachary Turner [Wed, 29 Nov 2017 22:41:56 +0000 (22:41 +0000)]
[CodeView] Factor some code out of TypeTableBuilder.

This class had some code that would automatically remap type
indices before hashing and serializing.  The only caller of
this method was the TypeStreamMerger anyway, and the method
doesn't make general sense, and prevents making certain future
improvements to the class.  So, factoring this up one level
into the TypeStreamMerger where it belongs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319377 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG][X86] Teach promotion legalization for fp_to_sint/fp_to_uint to insert...
Craig Topper [Wed, 29 Nov 2017 22:15:43 +0000 (22:15 +0000)]
[SelectionDAG][X86] Teach promotion legalization for fp_to_sint/fp_to_uint to insert an assertsext/assertzext based on the original type

If we put in an assertsext/zext here, we're able to generate better truncate code using pack on pre-avx512 targets.

Similar is already done during type legalization. This is the equivalent for op legalization

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319368 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Fix fptoui lowering bounds
Dan Gohman [Wed, 29 Nov 2017 20:20:11 +0000 (20:20 +0000)]
[WebAssembly] Fix fptoui lowering bounds

To fully avoid trapping on wasm, fptoui needs a second check to ensure that
the operand isn't below the supported range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319354 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd libstd++-4.8 exceptions to ubsan_blacklist.txt
Sam Clegg [Wed, 29 Nov 2017 20:10:14 +0000 (20:10 +0000)]
Add libstd++-4.8 exceptions to ubsan_blacklist.txt

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319353 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Remove HexagonISD::PACKHL
Krzysztof Parzyszek [Wed, 29 Nov 2017 19:59:29 +0000 (19:59 +0000)]
[Hexagon] Remove HexagonISD::PACKHL

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319352 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Create helpers extractVector and insertVector in lowering
Krzysztof Parzyszek [Wed, 29 Nov 2017 19:58:10 +0000 (19:58 +0000)]
[Hexagon] Create helpers extractVector and insertVector in lowering

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319351 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes (REVERSION)
Simon Pilgrim [Wed, 29 Nov 2017 19:37:38 +0000 (19:37 +0000)]
[X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes (REVERSION)

Accidental commit of incomplete patch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319346 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMake TypeTableBuilder inherit from TypeCollection.
Zachary Turner [Wed, 29 Nov 2017 19:35:21 +0000 (19:35 +0000)]
Make TypeTableBuilder inherit from TypeCollection.

A couple of places in LLD were passing references to
TypeTableCollections around, which makes it hard to change the
implementation at runtime.  However, these cases only needed to
iterate over the types in the collection, and TypeCollection
already provides a handy abstract interface for this purpose.

By implementing this interface, we can get rid of the need to
pass TypeTableBuilder references around, which should allow us
to swap the implementation at runtime in subsequent patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319345 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix line endings in llvm-pdbutil.cpp
Zachary Turner [Wed, 29 Nov 2017 19:29:25 +0000 (19:29 +0000)]
Fix line endings in llvm-pdbutil.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319340 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes
Simon Pilgrim [Wed, 29 Nov 2017 19:19:59 +0000 (19:19 +0000)]
[X86][AVX512] Tag RCP/RSQRT/GETEXP instructions scheduler classes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319338 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX512] Tag 3OP (shuffles, double-shifts and GFNI) instructions scheduler classes
Simon Pilgrim [Wed, 29 Nov 2017 18:52:20 +0000 (18:52 +0000)]
[X86][AVX512] Tag 3OP (shuffles, double-shifts and GFNI) instructions scheduler classes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319337 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM][DAG] Revert Disable post-legalization store merge for ARM
Nirav Dave [Wed, 29 Nov 2017 18:06:13 +0000 (18:06 +0000)]
[ARM][DAG] Revert Disable post-legalization store merge for ARM

Partially reverting enabling of post-legalization store merge
(r319036) for just ARM backend as it is causing incorrect code
in some Thumb2 cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319331 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[cmake] Replace -Wall with /W4 in clang-cl options now that -Wall aliases -Weverything
Greg Bedwell [Wed, 29 Nov 2017 18:05:32 +0000 (18:05 +0000)]
[cmake] Replace -Wall with /W4 in clang-cl options now that -Wall aliases -Weverything

Instead, reuse the code-path for cl.exe that adds /W4 , which for clang-cl
aliases clang's "-Wall -Wextra" which matches what clang-cl's /Wall
previously aliased.

This should restore the verbosity of a Windows selfhost build back to
its previous levels.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319330 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMake check-lit tests respect LLVM_LIT_TOOLS_DIR
Greg Bedwell [Wed, 29 Nov 2017 18:05:26 +0000 (18:05 +0000)]
Make check-lit tests respect LLVM_LIT_TOOLS_DIR

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319329 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Power9] add more tests for D38287; NFC
Zaara Syeda [Wed, 29 Nov 2017 17:26:20 +0000 (17:26 +0000)]
[Power9] add more tests for D38287; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319328 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add tests for select-of-constants; NFC
Sanjay Patel [Wed, 29 Nov 2017 17:21:39 +0000 (17:21 +0000)]
[InstCombine] add tests for select-of-constants; NFC

These are variants of a test that was originally added in:
https://reviews.llvm.org/rL75531
...but removed with:
https://reviews.llvm.org/rL159230

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319327 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX512] Add itinerary argument to all AVX512_maskable_* wrappers. NFCI
Simon Pilgrim [Wed, 29 Nov 2017 17:21:15 +0000 (17:21 +0000)]
[X86][AVX512] Add itinerary argument to all AVX512_maskable_* wrappers. NFCI

All default to NoItinerary

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319326 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd opt-viewer testing
Adam Nemet [Wed, 29 Nov 2017 17:07:41 +0000 (17:07 +0000)]
Add opt-viewer testing

Detects whether we have the Python modules (pygments, yaml) required by
opt-viewer and hooks this up to REQUIRES.

This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer
testing).

It's also related to https://github.com/apple/swift/pull/12938 and the idea is
to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake.

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

Fixes since the first commit:
1. Disable syntax highlighting as different versions of pygments generate
different HTML
2. Use llvm-cxxfilt from the build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319324 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoReverted r319315 because of unused functions (due to PPR not yet being
Sander de Smalen [Wed, 29 Nov 2017 15:14:39 +0000 (15:14 +0000)]
Reverted r319315 because of unused functions (due to PPR not yet being
used by any instructions).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319321 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX512] Tag VPERMILV instruction scheduler class
Simon Pilgrim [Wed, 29 Nov 2017 14:58:34 +0000 (14:58 +0000)]
[X86][AVX512] Tag VPERMILV instruction scheduler class

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319316 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64][SVE] Asm: Add SVE predicate register definitions and parsing support
Sander de Smalen [Wed, 29 Nov 2017 14:34:18 +0000 (14:34 +0000)]
[AArch64][SVE] Asm: Add SVE predicate register definitions and parsing support

Summary: Patch [1/4] in a series to add parsing of predicates and properly parse SVE ZIP1/ZIP2 instructions.

Reviewers: rengolin, kristof.beyls, fhahn, mcrosier, evandro, echristo, efriedma

Reviewed By: fhahn

Subscribers: aemerson, javed.absar, llvm-commits, tschuett

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319315 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM GlobalISel] Fix selecting G_BRCOND
Diana Picus [Wed, 29 Nov 2017 14:20:06 +0000 (14:20 +0000)]
[ARM GlobalISel] Fix selecting G_BRCOND

When lowering a G_BRCOND, we generate a TSTri of the condition against
1, which sets the flags, and then a Bcc which branches based on the
value of the flags.

Unfortunately, we were using the wrong condition code to check whether
we need to branch (EQ instead of NE), which caused all our branches to
do the opposite of what they were intended to do. This patch fixes the
issue by using the correct condition code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319313 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX512] Setup unary (PABS/VPLZCNT/VPOPCNT/VPCONFLICT/VMOV*DUP) instruction...
Simon Pilgrim [Wed, 29 Nov 2017 13:49:51 +0000 (13:49 +0000)]
[X86][AVX512] Setup unary (PABS/VPLZCNT/VPOPCNT/VPCONFLICT/VMOV*DUP) instruction scheduler classes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319312 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU][MC][GFX9] Corrected mapping of GFX9 v_add/sub/subrev_u32
Dmitry Preobrazhensky [Wed, 29 Nov 2017 13:33:40 +0000 (13:33 +0000)]
[AMDGPU][MC][GFX9] Corrected mapping of GFX9 v_add/sub/subrev_u32

When translating pseudo to MC, v_add/sub/subrev_u32 shall be mapped via a separate table as GFX8 has opcodes with the same names.
These instructions shall also be labelled as renamed for pseudoToMCOpcode to handle them correctly.

Reviewers: arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319311 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Merged sse2_unpack and sse2_unpack PUNPCK instruction templates. NFCI.
Simon Pilgrim [Wed, 29 Nov 2017 12:12:27 +0000 (12:12 +0000)]
[X86][SSE] Merged sse2_unpack and sse2_unpack PUNPCK instruction templates. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319310 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Merged sse2_pack and sse2_pack_y PACKSS/PACKUS instruction templates....
Simon Pilgrim [Wed, 29 Nov 2017 11:35:45 +0000 (11:35 +0000)]
[X86][SSE] Merged sse2_pack and sse2_pack_y PACKSS/PACKUS instruction templates. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319308 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SCEV][NFC] Break from loop after we found first non-Phi in getAddRecExprPHILiterally
Max Kazantsev [Wed, 29 Nov 2017 10:54:16 +0000 (10:54 +0000)]
[SCEV][NFC] Break from loop after we found first non-Phi in getAddRecExprPHILiterally

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319306 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ARM] Add support for armv7e-m to the .arch directive
Oliver Stannard [Wed, 29 Nov 2017 10:12:15 +0000 (10:12 +0000)]
[ARM] Add support for armv7e-m to the .arch directive

This will allow compilation of assembly files targeting armv7e-m without having
to specify the Tag_CPU_arch attribute as a workaround.

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

Patch by Ian Tessier!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319303 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CGP] Enable complex addr mode
Serguei Katkov [Wed, 29 Nov 2017 09:48:50 +0000 (09:48 +0000)]
[CGP] Enable complex addr mode

Enable complex addr modes after two critical fixes: rL319109 and rL319292

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319302 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoComment fix in SelectionDAG.h
Jonas Paulsson [Wed, 29 Nov 2017 09:16:37 +0000 (09:16 +0000)]
Comment fix in SelectionDAG.h

   /// Replace any uses of From with To, leaving
-  /// uses of other values produced by From.Val alone.
+  /// uses of other values produced by From.getNode() alone.
   void ReplaceAllUsesOfValueWith(SDValue From, SDValue To);

(this is what it says in the .cpp file above this method)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319301 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove setOperationAction Promote for ISD::SINT_TO_FP MVT::v8i16/v16i8/v16i16.
Craig Topper [Wed, 29 Nov 2017 08:19:36 +0000 (08:19 +0000)]
[X86] Remove setOperationAction Promote for ISD::SINT_TO_FP MVT::v8i16/v16i8/v16i16.

A DAG combine ensures these ops are always promoted to vXi32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319298 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SCEV][NFC] Remove condition that can never happen due to check few lines above
Max Kazantsev [Wed, 29 Nov 2017 06:10:36 +0000 (06:10 +0000)]
[SCEV][NFC] Remove condition that can never happen due to check few lines above

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319293 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CGP] Fix common type handling in optimizeMemoryInst
Serguei Katkov [Wed, 29 Nov 2017 05:51:26 +0000 (05:51 +0000)]
[CGP] Fix common type handling in optimizeMemoryInst

If common type is different we should bail out due to we will not be
able to create a select or Phi of these values.

Basically it is done in ExtAddrMode::compare however it does not work
if we handle the null first and then two values of different types.
so add a check in initializeMap as well. The check in ExtAddrMode::compare
is used as earlier bail out.

Reviewers: reames, john.brawn
Reviewed By: john.brawn
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D40479

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319292 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] Relax the checking on AND/AND8 in isSignOrZeroExtended.
Sean Fertile [Wed, 29 Nov 2017 04:09:29 +0000 (04:09 +0000)]
[PowerPC] Relax the checking on AND/AND8 in isSignOrZeroExtended.

Separate the handling of AND/AND8 out from PHI/OR/ISEL checking. The reasoning
is the others need all their operands to be sign/zero extended for their output
to also be sign/zero extended. This is true for AND and sign-extension, but for
zero-extension we only need at least one of the input operands to be zero
extended for the result to also be zero extended.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319289 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Use stricter regexes for add instructions
Matt Arsenault [Wed, 29 Nov 2017 02:25:14 +0000 (02:25 +0000)]
AMDGPU: Use stricter regexes for add instructions

Match the entire _co as one optional piece rather than
a set of characters to match multiple times.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319275 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Modules] Add textual headers for recently added .def files
Bruno Cardoso Lopes [Wed, 29 Nov 2017 01:53:49 +0000 (01:53 +0000)]
[Modules] Add textual headers for recently added .def files

Keep module.modulemap up to date and get rid of -Wincomplete-umbrella warnings

rdar://problem/35711925

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319273 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDAG: Add nuw when splitting loads and stores
Matt Arsenault [Wed, 29 Nov 2017 01:25:12 +0000 (01:25 +0000)]
DAG: Add nuw when splitting loads and stores

The object can't straddle the address space
wrap around, so I think it's OK to assume any
offsets added to the base object pointer can't
overflow. Similar logic already appears to be
applied in SelectionDAGBuilder when lowering
aggregate returns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319272 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agollvm-dwarfdump: honor the --show-children option when dumping a specific DIE.
Adrian Prantl [Wed, 29 Nov 2017 01:12:22 +0000 (01:12 +0000)]
llvm-dwarfdump: honor the --show-children option when dumping a specific DIE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319271 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Select DS insts without m0 initialization
Matt Arsenault [Wed, 29 Nov 2017 00:55:57 +0000 (00:55 +0000)]
AMDGPU: Select DS insts without m0 initialization

GFX9 stopped using m0 for most DS instructions. Select
a different instruction without the use. I think this will
be less error prone than trying to manually maintain m0
uses as needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319270 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRollback r319176.
Don Hinton [Wed, 29 Nov 2017 00:47:16 +0000 (00:47 +0000)]
Rollback r319176.

The ';' separators in LLVM_TARGETS_TO_BUILD disappear when list
variables are evaluated in custom commands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319268 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Promote fp_to_sint v16f32->v16i16/v16i8 to avoid scalarization.
Craig Topper [Wed, 29 Nov 2017 00:32:09 +0000 (00:32 +0000)]
[X86] Promote fp_to_sint v16f32->v16i16/v16i8 to avoid scalarization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319266 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix a warning.
Zachary Turner [Wed, 29 Nov 2017 00:13:44 +0000 (00:13 +0000)]
Fix a warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319263 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "Add opt-viewer testing"
Adam Nemet [Wed, 29 Nov 2017 00:10:48 +0000 (00:10 +0000)]
Revert "Add opt-viewer testing"

This reverts commit r319188.

Breaks when c++filt is not available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319262 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add test cases for fptosi v16f32->v16i8/v16i16 to show scalarization.
Craig Topper [Wed, 29 Nov 2017 00:02:22 +0000 (00:02 +0000)]
[X86] Add test cases for fptosi v16f32->v16i8/v16i16 to show scalarization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319261 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Minor cleanups in CodeView TypeTableBuilder.
Zachary Turner [Tue, 28 Nov 2017 23:57:13 +0000 (23:57 +0000)]
[NFC] Minor cleanups in CodeView TypeTableBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319260 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Mark ISD::FP_TO_UINT v16i8/v16i16 as Promote under AVX512 instead of legal...
Craig Topper [Tue, 28 Nov 2017 23:56:02 +0000 (23:56 +0000)]
[X86] Mark ISD::FP_TO_UINT v16i8/v16i16 as Promote under AVX512 instead of legal. Fix infinite loop in op legalization when promotion requires 2 steps.

Previously we had an isel pattern to add the truncate. Instead use Promote to add the truncate to the DAG before isel.

The Promote legalization code had to be updated to prevent an infinite loop if promotion took multiple steps because it wasn't remembering the previously tried value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319259 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Regenerate avx512-schedule test.
Craig Topper [Tue, 28 Nov 2017 23:55:59 +0000 (23:55 +0000)]
[X86] Regenerate avx512-schedule test.

For some reason some sqrt instructions were missing the scheduling comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319258 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Enable IPRA
Matt Arsenault [Tue, 28 Nov 2017 23:40:12 +0000 (23:40 +0000)]
AMDGPU: Enable IPRA

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319256 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Tag CLFLUSHOPT with same scheduling behaviour as CLFLUSH
Simon Pilgrim [Tue, 28 Nov 2017 23:25:42 +0000 (23:25 +0000)]
[X86] Tag CLFLUSHOPT with same scheduling behaviour as CLFLUSH

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319253 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[globalisel][tablegen] Fix PR35375 by sign-extending the table value to match getCons...
Daniel Sanders [Tue, 28 Nov 2017 23:18:54 +0000 (23:18 +0000)]
[globalisel][tablegen] Fix PR35375 by sign-extending the table value to match getConstantVRegVal()

Summary:
From the bug report:
> The problem is that it fails when trying to compare -65536 (or 4294901760) to 0xFFFF,0000. This is because the
> constant in the instruction is sign extended to 64 bits (0xFFFF,FFFF,FFFF,0000) and then compared to the non
> extended 64 bit version expected by TableGen.
>
> In contrast, the DAGISelEmitter generates special code for AND immediates (OPC_CheckAndImm), which does not
> sign extend.

This patch doesn't introduce the special case for AND (and OR) immediates since the majority of it is related to handling known bits that have no effect on the result and GlobalISel doesn't detect known-bits at this time. Instead this patch just ensures that the immediate is extended consistently on both sides of the check.

Thanks to Diana Picus for the detailed bug report.

Reviewers: rovka

Reviewed By: rovka

Subscribers: kristof.beyls, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319252 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add CLFLUSHOPT schedule tests
Simon Pilgrim [Tue, 28 Nov 2017 23:12:12 +0000 (23:12 +0000)]
[X86] Add CLFLUSHOPT schedule tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319250 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add SSE_SHUFP OpndItins
Simon Pilgrim [Tue, 28 Nov 2017 23:09:18 +0000 (23:09 +0000)]
[X86][SSE] Add SSE_SHUFP OpndItins

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

Will be reused in the AVX512 equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319249 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Test clflushopt intrinsic on 32 and 64-bit targets
Simon Pilgrim [Tue, 28 Nov 2017 23:04:42 +0000 (23:04 +0000)]
[X86] Test clflushopt intrinsic on 32 and 64-bit targets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319247 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add SSE_UNPCK/SSE_PUNPCK OpndItins
Simon Pilgrim [Tue, 28 Nov 2017 22:55:08 +0000 (22:55 +0000)]
[X86][SSE] Add SSE_UNPCK/SSE_PUNPCK OpndItins

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

Will be reused in the AVX512 equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319245 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Use SSE_PACK OpndItins in PACKSS/PACKUS instruction definitions
Simon Pilgrim [Tue, 28 Nov 2017 22:47:45 +0000 (22:47 +0000)]
[X86][SSE] Use SSE_PACK OpndItins in PACKSS/PACKUS instruction definitions

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

SSE_PACK will be reused in the AVX512 equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319243 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRemove this test
Adam Nemet [Tue, 28 Nov 2017 22:39:38 +0000 (22:39 +0000)]
Remove this test

After r319235, we no longer generate this remark.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319242 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix VS2017 narrowing conversion warning. NFCI
Simon Pilgrim [Tue, 28 Nov 2017 22:32:43 +0000 (22:32 +0000)]
Fix VS2017 narrowing conversion warning. NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319240 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove unused variable.
Craig Topper [Tue, 28 Nov 2017 22:28:23 +0000 (22:28 +0000)]
[X86] Remove unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319239 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDemote this opt remark to DEBUG.
Adam Nemet [Tue, 28 Nov 2017 22:11:00 +0000 (22:11 +0000)]
Demote this opt remark to DEBUG.

From a random opt-stat output:

Top 10 remarks:
  tailcallelim/tailcall          53%
  inline/AlwaysInline            13%
  gvn/LoadClobbered              13%
  inline/Inlined                  8%
  inline/TooCostly                2%
  inline/NoDefinition             2%
  licm/LoadWithLoopInvariantAddressInvalidated  2%
  licm/Hoisted                    1%
  asm-printer/InstructionCount    1%
  prologepilog/StackSize          1%

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319235 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove code from combineUIntToFP that tried to favor UINT_TO_FP if legal when...
Craig Topper [Tue, 28 Nov 2017 22:08:51 +0000 (22:08 +0000)]
[X86] Remove code from combineUIntToFP that tried to favor UINT_TO_FP if legal when zero extending from vXi8/vX816.

The UINT_TO_FP is immediately converted to SINT_TO_FP when the node is re-evaluated because we'll detect that the sign bit is zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319234 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove custom lowering for uint_to_fp from vXi8/vXi16.
Craig Topper [Tue, 28 Nov 2017 22:08:48 +0000 (22:08 +0000)]
[X86] Remove custom lowering for uint_to_fp from vXi8/vXi16.

We have a DAG combine that uses a zero extend that should prevent this from ever occurring now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319233 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[globalisel][tablegen] Add support for importing G_ATOMIC_CMPXCHG, G_ATOMICRMW_*...
Daniel Sanders [Tue, 28 Nov 2017 22:07:05 +0000 (22:07 +0000)]
[globalisel][tablegen] Add support for importing G_ATOMIC_CMPXCHG, G_ATOMICRMW_* rules from SelectionDAG.

GIM_CheckNonAtomic has been replaced by GIM_CheckAtomicOrdering to allow it to support a wider
range of orderings. This has then been used to import patterns using nodes such
as atomic_cmp_swap, atomic_swap, and atomic_load_*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319232 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSROA: Don't create variable fragments that are outside of the variable.
Adrian Prantl [Tue, 28 Nov 2017 21:30:38 +0000 (21:30 +0000)]
SROA: Don't create variable fragments that are outside of the variable.

An alloca may be larger than a variable that is described to be stored
there. Don't create a dbg.value for fragments that are outside of the
variable.

This fixes PR35447.
https://bugs.llvm.org/show_bug.cgi?id=35447

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319230 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[cmake] Pass LLVM_USE_LINKER flag when building host tools, e.g.,
Don Hinton [Tue, 28 Nov 2017 21:23:30 +0000 (21:23 +0000)]
[cmake] Pass LLVM_USE_LINKER flag when building host tools, e.g.,
LLVM_OPTIMIZED_TABLEGEN=ON, and not crosscompiling.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319228 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SLP] Additional test for PR35354, NFC.
Alexey Bataev [Tue, 28 Nov 2017 20:48:24 +0000 (20:48 +0000)]
[SLP] Additional test for PR35354, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319224 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Use stable sort for HexagonShuffler to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 28 Nov 2017 20:48:10 +0000 (20:48 +0000)]
[Hexagon] Use stable sort for HexagonShuffler to remove non-deterministic ordering

Summary:
This fixes failures in the following tests uncovered by D39245:
        LLVM :: CodeGen/Hexagon/args.ll
        LLVM :: CodeGen/Hexagon/constp-extract.ll
        LLVM :: CodeGen/Hexagon/expand-condsets-basic.ll
        LLVM :: CodeGen/Hexagon/gp-rel.ll
        LLVM :: CodeGen/Hexagon/packetize_cond_inst.ll
        LLVM :: CodeGen/Hexagon/simple_addend.ll
        LLVM :: CodeGen/Hexagon/swp-stages4.ll
        LLVM :: CodeGen/Hexagon/swp-vmult.ll
        LLVM :: CodeGen/Hexagon/swp-vsum.ll
        LLVM :: MC/Hexagon/align.s
        LLVM :: MC/Hexagon/asmMap.s
        LLVM :: MC/Hexagon/dis-duplex-p0.s
        LLVM :: MC/Hexagon/double-vector-producer.s
        LLVM :: MC/Hexagon/inst_select.ll
        LLVM :: MC/Hexagon/instructions/j.s

Reviewers: colinl, kparzysz, adasgupt, slarin

Reviewed By: kparzysz

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319223 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[aarch64][globalisel] Add missing tests from r319216
Daniel Sanders [Tue, 28 Nov 2017 20:27:59 +0000 (20:27 +0000)]
[aarch64][globalisel] Add missing tests from r319216

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319220 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] Allow tail calls of fastcc functions from C CallingConv functions.
Sean Fertile [Tue, 28 Nov 2017 20:25:58 +0000 (20:25 +0000)]
[PowerPC] Allow tail calls of fastcc functions from C CallingConv functions.

Allow fastcc callees to be tail-called from ccc callers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319218 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[aarch64][globalisel] Define G_ATOMIC_CMPXCHG and G_ATOMICRMW_* and make them legal
Daniel Sanders [Tue, 28 Nov 2017 20:21:15 +0000 (20:21 +0000)]
[aarch64][globalisel] Define G_ATOMIC_CMPXCHG and G_ATOMICRMW_* and make them legal

The IRTranslator cannot generate these instructions at the moment so there's no
issue with not having implemented ISel for them yet. D40092 will add
G_ATOMIC_CMPXCHG_WITH_SUCCESS and G_ATOMICRMW_* to the IRTranslator and a
further patch will add support for lowering G_ATOMIC_CMPXCHG_WITH_SUCCESS into
G_ATOMIC_CMPXCHG with an external success check via the `Lower` action.

The separation of G_ATOMIC_CMPXCHG_WITH_SUCCESS and G_ATOMIC_CMPXCHG is
to import SelectionDAG rules while still supporting targets that prefer to
custom lower the original LLVM-IR-like operation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319216 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 28 Nov 2017 19:55:54 +0000 (19:55 +0000)]
[SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering

Summary:
Recommitting this with the correct sorting predicate. The Low field of Clusters is a ConstantInt and
cannot be directly compared. So we needed to invoke slt (signed less than) to compare correctly.

This fixes failures in the following tests uncovered by D39245:

LLVM :: CodeGen/ARM/ifcvt3.ll
LLVM :: CodeGen/ARM/switch-minsize.ll
LLVM :: CodeGen/X86/switch.ll
LLVM :: CodeGen/X86/switch-bt.ll
LLVM :: CodeGen/X86/switch-density.ll

Reviewers: hans, fhahn

Reviewed By: hans

Subscribers: aemerson, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319210 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add SSE_HADDSUB/SSE_PABS/SSE_PALIGN OpndItins
Simon Pilgrim [Tue, 28 Nov 2017 19:39:47 +0000 (19:39 +0000)]
[X86][SSE] Add SSE_HADDSUB/SSE_PABS/SSE_PALIGN OpndItins

Update multi-classes to take the scheduling OpndItins instead of hard coding it.

Will be reused in the AVX512 equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319209 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] In lowerVectorShuffleAsElementInsertion, if were able to find a scalar i8 or...
Craig Topper [Tue, 28 Nov 2017 19:25:45 +0000 (19:25 +0000)]
[X86] In lowerVectorShuffleAsElementInsertion, if were able to find a scalar i8 or i16 and need to zero extend it, make sure we use a vXi32 type of the full vector width.

Previously, this was hardcoded to v4i32, but if the input type is 256 bits we need to use v8i32.

Fixes PR35443

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319208 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeGen] Fix doxygen \file comment style
Francis Visoiu Mistrih [Tue, 28 Nov 2017 19:23:39 +0000 (19:23 +0000)]
[CodeGen] Fix doxygen \file comment style

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319207 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeGen] Fix doxygen
Francis Visoiu Mistrih [Tue, 28 Nov 2017 19:15:46 +0000 (19:15 +0000)]
[CodeGen] Fix doxygen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319206 91177308-0d34-0410-b5e6-96231b3b80d8