platform/upstream/llvm.git
4 years ago[Loads] Handle simple cases with same base pointer with constant offsets in FindAvail...
Hiroshi Yamauchi [Tue, 10 Dec 2019 22:41:30 +0000 (14:41 -0800)]
[Loads] Handle simple cases with same base pointer with constant offsets in FindAvailableLoadedValue when AA is null.

Summary:
This will help with devirtualization (store forwarding with vtable pointers in
the presence of other stores into members in the constructor.) During inlining,
we don't have AA.

Reviewers: davidxl

Subscribers: mgorny, Prazek, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[NFCI][AArch64][SVE] Set default DestructiveInstType in AArch64Inst class
Cameron McInally [Wed, 29 Jan 2020 20:44:04 +0000 (14:44 -0600)]
[NFCI][AArch64][SVE] Set default DestructiveInstType in AArch64Inst class

Some housekeeping for the DestructiveInstType enum before a larger set of patches to support prefixing destructive oeprations with MOVPRFX.

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

4 years ago[PowerPC][Future] Add prefixed loads and stores for future CPU
Victor Huang [Wed, 29 Jan 2020 20:32:13 +0000 (14:32 -0600)]
[PowerPC][Future] Add prefixed loads and stores for future CPU

A previous patch should have added pld and pstd and any support code in
the backend that is required for prefixed load and store type operations.
This patch adds a number of additional prefixed load and store type
instructions for the future CPU.

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

4 years agoRewrite test not to rely on StrEq with StringRef
Benjamin Kramer [Wed, 29 Jan 2020 20:40:19 +0000 (21:40 +0100)]
Rewrite test not to rely on StrEq with StringRef

StrEq has some magic inside that should do the explicit conversion from
StringRef to std::string, but apparently this doesn't work with GCC 5.

Just use EXPECT_EQ, it does the same thing with less magic.

4 years ago[InstCombine] add splat binop tests; NFC
Sanjay Patel [Wed, 29 Jan 2020 20:00:11 +0000 (15:00 -0500)]
[InstCombine] add splat binop tests; NFC

4 years ago[libcxx] [Windows] Store the lconv struct returned from localeconv in locale_t
Martin Storsjö [Mon, 28 Oct 2019 08:39:44 +0000 (10:39 +0200)]
[libcxx] [Windows] Store the lconv struct returned from localeconv in locale_t

This fixes using non-default locales, which currently can crash when
e.g. formatting numbers.

Within the localeconv_l function, the per-thread locale is temporarily
changed with __libcpp_locale_guard, then localeconv() is called,
returning an lconv * struct pointer.

When localeconv_l returns, the __libcpp_locale_guard dtor restores
the per-thread locale back to the original. This invalidates the
contents of the earlier returned lconv struct, and all C strings
that are pointed to within it are also invalidated.

Thus, to have an actually working localeconv_l function, the
function needs to allocate some sort of storage for the returned
contents, that stays valid for as long as the caller needs to use
the returned struct.

Extend the libcxx/win32 specific locale_t class with storage for
a deep copy of a lconv struct, and change localeconv_l to take
a reference to the locale_t, to allow it to store the returned
lconv struct there.

This works fine for libcxx itself, but wouldn't necessarily be right
for a caller that uses libcxx's localeconv_l function.

This fixes around 11 of libcxx's currently failing tests on windows.

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

4 years agoAMDGPU/GlobalISel: Fix tests in release build
Matt Arsenault [Wed, 29 Jan 2020 20:26:13 +0000 (12:26 -0800)]
AMDGPU/GlobalISel: Fix tests in release build

Irritatingly the failure output is different in release vs. debug
because of the legality check is removed without asserts, so a register
ends up constrained only in release builds.

4 years agoAdd IntegerAttr::verifyConstructionInvariants.
Sean Silva [Wed, 29 Jan 2020 00:58:34 +0000 (16:58 -0800)]
Add IntegerAttr::verifyConstructionInvariants.

Summary:
This will help catch improper use of the MLIR API's. In particular, this
catches an error that was manifesting as nondeterministic assertion
failures (the nondeterminism was due to the failure happening only when the
StorageUniquer's DenseMap's probing happened to compare two specific
keys).

No test. The fact that all the existing tests pass with this additional
invariant gives confidence that it is correct/useful.

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

4 years agoPrint discriminators when printing .debug_line in GNU style.
Sterling Augustine [Fri, 24 Jan 2020 01:51:33 +0000 (17:51 -0800)]
Print discriminators when printing .debug_line in GNU style.

Summary:
gnu addr2line prints DWARF line table discriminators like so:

<file>:<line> (discriminator <Number>)

This matches that behavior.

Document how and when --output-style=GNU prints discriminators

Add test for new GNU-style discriminator printing.

Reviewers: rupprecht, labath, jhenderson

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[build] Fix runtimes build after 2e745ba6b0ba
Shoaib Meenai [Wed, 29 Jan 2020 20:16:40 +0000 (12:16 -0800)]
[build] Fix runtimes build after 2e745ba6b0ba

I missed the NOT in the condition; this part is actually responsible for
passing LLVM_ENABLE_RUNTIMES to the per-target runtime configures, which
in turn makes them actually build.

I'll put up a more general solution for review, but restore this in the
meantime to fix the runtimes build.

4 years ago[InstCombine] Support non-splat vectors in icmp eq + add/sub fold
Nikita Popov [Wed, 29 Jan 2020 17:58:48 +0000 (18:58 +0100)]
[InstCombine] Support non-splat vectors in icmp eq + add/sub fold

For the

    icmp eq (add X, C1), C2 => icmp eq X, C2-C1
    icmp eq (sub C1, X), C2 => icmp eq X, C1-C2

folds, this allows C1 to be non-splat and contain undefs.
C2 is still splat, due to the structure of the code.

This is to address the remaining part of the regression in D73411,
where demanded element analysis replaces some elements with undef.

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

4 years ago[InstCombine] Add undef/non-splat tests for add/sub + icmp eq; NFC
Nikita Popov [Wed, 29 Jan 2020 17:57:56 +0000 (18:57 +0100)]
[InstCombine] Add undef/non-splat tests for add/sub + icmp eq; NFC

4 years ago[GlobalISel][IRTranslator] Follow convention and put constant offset of getelementptr...
Amara Emerson [Wed, 29 Jan 2020 17:34:33 +0000 (09:34 -0800)]
[GlobalISel][IRTranslator] Follow convention and put constant offset of getelementptr arithmetic on RHS.

We were needlessly putting known constant values on the LHS of a G_MUL, which
is suboptimal.

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

4 years agoattempt to fix symbolize-paths.s everywhere after cd68f4
Nico Weber [Wed, 29 Jan 2020 19:26:50 +0000 (14:26 -0500)]
attempt to fix symbolize-paths.s everywhere after cd68f4

4 years agoattempt to fix symbolize-paths.s on windows
Nico Weber [Wed, 29 Jan 2020 19:23:00 +0000 (14:23 -0500)]
attempt to fix symbolize-paths.s on windows

4 years agoRevert "[AArch64] Fix data race on RegisterBank initialization."
Huihui Zhang [Wed, 29 Jan 2020 19:17:19 +0000 (11:17 -0800)]
Revert "[AArch64] Fix data race on RegisterBank initialization."

Buildbot failure, revert first while looking at the issue.

This reverts commit a5a4a47d691459afffc552bd3be7abfc86a49793.

4 years agoRevert "[AMDGPU] Fix data race on RegisterBank initialization."
Huihui Zhang [Wed, 29 Jan 2020 19:16:27 +0000 (11:16 -0800)]
Revert "[AMDGPU] Fix data race on RegisterBank initialization."

There looks to be buildbot failure related.

This reverts commit 8bb6c8a22af845618cfd6c27853dca1b48d30ce0.

4 years agoRevert "[ARM] Fix data race on RegisterBank initialization."
Huihui Zhang [Wed, 29 Jan 2020 19:15:07 +0000 (11:15 -0800)]
Revert "[ARM] Fix data race on RegisterBank initialization."

There looks to be buildbot failure related.

This reverts commit 91618d940ea3009d7e1489df4c8ca12017a0f612.

4 years ago[AsmPrinter][ELF] Define local aliases (.Lfoo$local) for GlobalObjects
Fangrui Song [Wed, 22 Jan 2020 20:26:04 +0000 (12:26 -0800)]
[AsmPrinter][ELF] Define local aliases (.Lfoo$local) for GlobalObjects

For `MC_GlobalAddress` operands referencing **certain** GlobalObjects,
we can lower them to STB_LOCAL aliases to avoid costs brought by
assembler/linker's conservative decisions about symbol interposition:

* An assembler conservatively assumes a global default visibility symbol interposable (ELF
  semantics). So relocations in object files are needed even if the code generator assumed
  the definition exact and non-interposable.
* The relocations can cause the creation of PLT entries on some targets for -shared links.
  A linker conservatively assumes a global default visibility symbol interposable (if not
  otherwise constrained by -Bsymbolic/--dynamic-list/VER_NDX_LOCAL/etc).

"certain" refers to GlobalObjects in the intersection of
`hasExactDefinition() and !isInterposable()`: `external`, `appending`, `internal`, `private`.
Local linkages (`internal` and `private`) cannot be interposed. `appending` is for very
few objects LLVM interpret specially.  So the set just includes `external`.

This patch emits STB_LOCAL aliases (.Lfoo$local) for such GlobalObjects, so that targets can lower
MC_GlobalAddress operands to STB_LOCAL aliases if applicable.
We may extend the scope and include GlobalAlias in the future.

LLVM's existing -fno-semantic-interposition behaviors give us license to do such optimizations:

* Various optimizations (ipconstprop, inliner, sccp, sroa, etc) treat normal ExternalLinkage
  GlobalObjects as non-interposable.
* Before D72197, MC resolved a PC-relative VK_None fixup to a non-local symbol at assembly time (no
  outstanding relocation), if the target is defined in the same section. Put it simply, even if IR
  optimizations failed to optimize and allowed interposition for the function call in
  `void foo() {} void bar() { foo(); }`, the assembler would disallow it.

This patch sets up AsmPrinter infrastructure to make -fno-semantic-interposition more so.
With and without the patch, the object file output should be identical:
`.Lfoo$local` does not take a symbol table entry.

Reviewed By: sfertile

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

4 years agoHandle non-absolute include dirs properly for both dwarf4 and dwarf5.
Sterling Augustine [Tue, 28 Jan 2020 22:17:20 +0000 (14:17 -0800)]
Handle non-absolute include dirs properly for both dwarf4 and dwarf5.

Summary:
Add test case for the same. This test case will also serve as a
starting point for later symbolizer tests.

Reviewers: dblaikie, jdoerfert

Subscribers: hiraditya, llvm-commits, jhenderson

Tags: #llvm

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

4 years ago[DAGCombiner] ISD::SHL/SRA/SRL - use general SelectionDAG::FoldConstantArithmetic
Simon Pilgrim [Wed, 29 Jan 2020 18:48:55 +0000 (18:48 +0000)]
[DAGCombiner] ISD::SHL/SRA/SRL - use general SelectionDAG::FoldConstantArithmetic

This handles all the constant splat / opaque testing for us.

4 years ago[ConstantFold][SVE] Fix constant folding for scalable vector binary operations.
Huihui Zhang [Wed, 29 Jan 2020 18:48:57 +0000 (10:48 -0800)]
[ConstantFold][SVE] Fix constant folding for scalable vector binary operations.

Summary:
Scalable vector should not be evaluated element by element.
Add support to handle scalable vector UndefValue.

Reviewers: sdesmalen, huntergr, spatel, lebedev.ri, apazos, efriedma, willlovett

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[clangd] Don't mmap source files on all platforms --> don't crash on git checkout
Sam McCall [Wed, 29 Jan 2020 11:22:03 +0000 (12:22 +0100)]
[clangd] Don't mmap source files on all platforms --> don't crash on git checkout

Summary:
Previously we mmapped on unix and not on windows: on windows mmap takes
an exclusive lock on the file and prevents the user saving changes!

The failure mode on linux is a bit more subtle: if the file is changed on disk
but the SourceManager sticks around, then subsequent operations on the
SourceManager will fail as invariants are violated (e.g. null-termination).

This commonly manifests as crashes after switching git branches with many files
open in clangd.

Nominally mmap is for performance here, and we should be willing to give some
up to stop crashing. Measurements on my system (linux+desktop+SSD) at least
show no measurable regression on an a fairly IO-heavy workload: drop disk caches,
open SemaOverload.cpp, wait for first diagnostics.

for i in `seq 100`; do
  for variant in mmap volatile; do
    echo 3 | sudo tee /proc/sys/vm/drop_caches
    /usr/bin/time --append --quiet -o ~/timings -f "%C %E" \
    bin/clangd.$variant -sync -background-index=0 < /tmp/mirror > /dev/null
  done
done

bin/clangd.mmap -sync -background-index=0 0:07.60
bin/clangd.volatile -sync -background-index=0 0:07.89
bin/clangd.mmap -sync -background-index=0 0:07.44
bin/clangd.volatile -sync -background-index=0 0:07.89
bin/clangd.mmap -sync -background-index=0 0:07.42
bin/clangd.volatile -sync -background-index=0 0:07.50
bin/clangd.mmap -sync -background-index=0 0:07.90
bin/clangd.volatile -sync -background-index=0 0:07.53
bin/clangd.mmap -sync -background-index=0 0:07.64
bin/clangd.volatile -sync -background-index=0 0:07.55
bin/clangd.mmap -sync -background-index=0 0:07.75
bin/clangd.volatile -sync -background-index=0 0:07.47
bin/clangd.mmap -sync -background-index=0 0:07.90
bin/clangd.volatile -sync -background-index=0 0:07.50
bin/clangd.mmap -sync -background-index=0 0:07.81
bin/clangd.volatile -sync -background-index=0 0:07.95
bin/clangd.mmap -sync -background-index=0 0:07.55
bin/clangd.volatile -sync -background-index=0 0:07.65
bin/clangd.mmap -sync -background-index=0 0:08.15
bin/clangd.volatile -sync -background-index=0 0:07.54
bin/clangd.mmap -sync -background-index=0 0:07.78
bin/clangd.volatile -sync -background-index=0 0:07.61
bin/clangd.mmap -sync -background-index=0 0:07.78
bin/clangd.volatile -sync -background-index=0 0:07.55
bin/clangd.mmap -sync -background-index=0 0:07.41
bin/clangd.volatile -sync -background-index=0 0:07.40
bin/clangd.mmap -sync -background-index=0 0:07.54
bin/clangd.volatile -sync -background-index=0 0:07.42
bin/clangd.mmap -sync -background-index=0 0:07.45
bin/clangd.volatile -sync -background-index=0 0:07.49
bin/clangd.mmap -sync -background-index=0 0:07.95
bin/clangd.volatile -sync -background-index=0 0:07.66
bin/clangd.mmap -sync -background-index=0 0:08.04

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[AMDGPU][GlobalISel] Select 8-byte LDS Ops with 4-byte alignment
Austin Kerbow [Tue, 7 Jan 2020 21:13:05 +0000 (13:13 -0800)]
[AMDGPU][GlobalISel] Select 8-byte LDS Ops with 4-byte alignment

Reviewers: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

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

4 years ago[lldb/Host] Fix implicit StringRef to std::string conversion
Jonas Devlieghere [Wed, 29 Jan 2020 18:35:34 +0000 (10:35 -0800)]
[lldb/Host] Fix implicit StringRef to std::string conversion

lldb\source\Host\windows\Host.cpp(228): error C2440: 'initializing':
cannot convert from 'llvm::StringRef' to
'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'

4 years agoRun clang-format on DwarfExpression (NFC)
Adrian Prantl [Wed, 29 Jan 2020 18:22:15 +0000 (10:22 -0800)]
Run clang-format on DwarfExpression (NFC)

4 years agoDwarfExpression: Factor out getOrCreateBaseType() (NFC)
Adrian Prantl [Wed, 29 Jan 2020 18:08:57 +0000 (10:08 -0800)]
DwarfExpression: Factor out getOrCreateBaseType() (NFC)

4 years ago[SmallString] Add explicit conversion to std::string
Jonas Devlieghere [Wed, 29 Jan 2020 17:39:46 +0000 (09:39 -0800)]
[SmallString] Add explicit conversion to std::string

With the conversion between StringRef and std::string now being
explicit, converting SmallStrings becomes more tedious. This patch adds
an explicit operator so you can write std::string(Str) instead of
Str.str().str().

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

4 years ago[ARM] Fix data race on RegisterBank initialization.
Huihui Zhang [Wed, 29 Jan 2020 18:15:26 +0000 (10:15 -0800)]
[ARM] Fix data race on RegisterBank initialization.

Summary:
The initialization of RegisterBank needs to be done only once. The
logic of AlreadyInit has data race, use llvm::call_once instead.

This is continuing work of D73587.

Reviewers: arsenm, rovka, dsanders, t.p.northover, efriedma, apazos

Reviewed By: arsenm

Subscribers: wdng, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[AMDGPU] Fix data race on RegisterBank initialization.
Huihui Zhang [Wed, 29 Jan 2020 18:14:30 +0000 (10:14 -0800)]
[AMDGPU] Fix data race on RegisterBank initialization.

Summary:
The initialization of RegisterBank needs to be done only once. The
logic of AlreadyInit has data race, use llvm::call_once instead.

This is continuing work of D73587.

Reviewers: arsenm, tstellar, ronlieb, efriedma, apazos, nhaehnle

Reviewed By: nhaehnle

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[AArch64] Fix data race on RegisterBank initialization.
Huihui Zhang [Wed, 29 Jan 2020 18:12:21 +0000 (10:12 -0800)]
[AArch64] Fix data race on RegisterBank initialization.

Summary:
The initialization of RegisterBank needs to be done only once. The
logic of AlreadyInit has a data race, use llvm::call_once instead.

This issue was identified through thread sanitizer.

Reviewers: efriedma, apazos, qcolombet, dsanders

Reviewed By: efriedma

Subscribers: arsenm, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[libcxx] Add a std::string_view pretty printer for libcxx.
Eric Fiselier [Wed, 29 Jan 2020 17:51:31 +0000 (12:51 -0500)]
[libcxx] Add a std::string_view pretty printer for libcxx.

This adds a std::string_view pretty printer for libcxx and updates the gdb
pretty printer test.

Patch by Ali Tamur (tamur@google.com)
Reviewed as https://reviews.llvm.org/D73514

4 years agoAdd dwarfdump support for DW_OP_regval_type.
Adrian Prantl [Wed, 29 Jan 2020 01:25:15 +0000 (17:25 -0800)]
Add dwarfdump support for DW_OP_regval_type.

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

4 years ago[ELF] Mention symbol name in reportRangeError()
Fangrui Song [Tue, 28 Jan 2020 01:35:06 +0000 (17:35 -0800)]
[ELF] Mention symbol name in reportRangeError()

For an out-of-range relocation referencing a non-local symbol, report the symbol name and the object file that defines the symbol. As an example:
```
t.o:(function func: .text.func+0x3): relocation R_X86_64_32S out of range: -281474974609120 is not in [-21474836482147483647]
```
=>
```
t.o:(function func: .text.func+0x3): relocation R_X86_64_32S out of range: -281474974609120 is not in [-21474836482147483647]; references func
>>> defined in t1.o
```

Reviewed By: grimar

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

4 years ago[DAGCombiner] ISD::MUL - use general SelectionDAG::FoldConstantArithmetic
Simon Pilgrim [Wed, 29 Jan 2020 17:25:44 +0000 (17:25 +0000)]
[DAGCombiner] ISD::MUL - use general SelectionDAG::FoldConstantArithmetic

This handles all the constant splat / opaque testing for us.

4 years agoFix switch covers all cases static analyzer warning. NFCI.
Simon Pilgrim [Wed, 29 Jan 2020 17:12:41 +0000 (17:12 +0000)]
Fix switch covers all cases static analyzer warning. NFCI.

4 years ago[InstCombine] Regenerate test checks; NFC
Nikita Popov [Sat, 25 Jan 2020 10:05:59 +0000 (11:05 +0100)]
[InstCombine] Regenerate test checks; NFC

4 years ago[scudo] Skip building scudo standalone if sys/auxv.h can't be found
Bjorn Pettersson [Wed, 29 Jan 2020 16:19:26 +0000 (17:19 +0100)]
[scudo] Skip building scudo standalone if sys/auxv.h can't be found

Summary:
Since commit c299d1981deaf822dfaa06c791f3158bd6801e20 scudo
standalone can't be built without including sys/auxv.h.
I do not have that file on my system, and my builds have failed
when trying to simply build "all" runtimes. Assuming that "all"
means "all possible given the current environment" we need to
guard the setting of COMPILER_RT_HAS_SCUDO_STANDALONE=TRUE by
first checking if sys/auxv.h can be found.

Reviewers: pcc, cryptoad

Reviewed By: pcc

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[lldb/Reproducers] Add logging to the string template specialization
Jonas Devlieghere [Wed, 29 Jan 2020 17:15:13 +0000 (09:15 -0800)]
[lldb/Reproducers] Add logging to the string template specialization

Only the templated function had logging for deserialization. The string
deserializer is implemented as a specialization and now prints to the
log as well.

4 years ago[X86] Custom lower ISD::FROUND with SSE4.1 to avoid a libcall.
Craig Topper [Wed, 29 Jan 2020 17:00:33 +0000 (09:00 -0800)]
[X86] Custom lower ISD::FROUND with SSE4.1 to avoid a libcall.

ISD::FROUND is defined to round to nearest with ties rounding
away from 0. This mode isn't supported in hardware on X86.

But as long as we aren't compiling with trapping math, we can
emulate this with floor(X + copysign(nextafter(0.5, 0.0), X)).

We have to use nextafter to avoid some corner cases that adding
0.5 would have. For example, if X is nextafter(0.5, 0.0) it should
round to 0.0, but adding 0.5 would need one extra bit of mantissa
than can be stored so it rounds to 1.0. Adding nextafter(0.5, 0.0)
instead will just increase the exponent by 1 and leave the mantissa
as all 1s. This would be nextafter(1.0, 0.0) which will floor to 0.0.

Techically this requires -fno-trapping-math which isn't our default.
But if we care about exceptions we should be using constrained
intrinsics. Constrained intrinsics would use STRICT_FROUND which
won't go through this code.

Fixes PR42195.

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

4 years ago[llvm][docs] LangRef for IR attribute `vector-function-abi-variant`.
Francesco Petrogalli [Wed, 15 Jan 2020 19:50:44 +0000 (19:50 +0000)]
[llvm][docs] LangRef for IR attribute `vector-function-abi-variant`.

Reviewers: jdoerfert, andwar, simoll, rengolin, hfinkel, xtian

Reviewed By: jdoerfert

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[AMDGPU] Cluster FLAT instructions with both vaddr and saddr
Jay Foad [Mon, 6 Jan 2020 15:33:15 +0000 (15:33 +0000)]
[AMDGPU] Cluster FLAT instructions with both vaddr and saddr

Reviewers: rampitec, arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[Clang][Bundler] Add 'exclude' flag to target objects sections
Sergey Dmitriev [Wed, 29 Jan 2020 16:35:15 +0000 (08:35 -0800)]
[Clang][Bundler] Add 'exclude' flag to target objects sections

Summary: This flag tells link editor to exclude section from linker inputs when linking executable or shared library.

Reviewers: ABataev, alexshap, jdoerfert

Reviewed By: ABataev

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[DAGCombiner] Sub/SUBSAT - use general SelectionDAG::FoldConstantArithmetic
Simon Pilgrim [Wed, 29 Jan 2020 16:56:27 +0000 (16:56 +0000)]
[DAGCombiner] Sub/SUBSAT - use general SelectionDAG::FoldConstantArithmetic

This handles all the constant splat / opaque testing for us.

4 years ago[DAGCombiner] visitIMINMAX - use general SelectionDAG::FoldConstantArithmetic
Simon Pilgrim [Wed, 29 Jan 2020 16:36:03 +0000 (16:36 +0000)]
[DAGCombiner] visitIMINMAX - use general SelectionDAG::FoldConstantArithmetic

This handles all the constant splat / opaque testing for us instead of the ConstantSDNode variant where we have to do it ourselves.

4 years ago[X86] Use a shorter sequence to implement FLT_ROUNDS
Craig Topper [Wed, 29 Jan 2020 16:14:29 +0000 (08:14 -0800)]
[X86] Use a shorter sequence to implement FLT_ROUNDS

This code needs to map from the FPCW 2-bit encoding for rounding mode to the 2-bit encoding defined for FLT_ROUNDS. The previous implementation did some clever swapping of bits and adding 1 modulo 4 to do the mapping.

This patch instead uses an 8-bit immediate as a lookup table of four 2-bit values. Then we use the 2-bit FPCW encoding to index the lookup table by using a right shift and an AND. This requires extracting the 2-bit value from FPCW and multipying it by 2 to make it usable as a shift amount. But still results in less code.

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

4 years agoAMDGPU/GlobalISel: Fix tablegen selection for scalar bin ops
Matt Arsenault [Fri, 24 Jan 2020 19:01:09 +0000 (14:01 -0500)]
AMDGPU/GlobalISel: Fix tablegen selection for scalar bin ops

Fixes selection for scalar G_SMULH/G_UMULH. Also switches to using
tablegen selected add/sub, which switch to the signed version of the
opcode. This matches the current DAG behavior. We can't drop the
manual selection for add/sub yet, because it's still both for VALU
add/sub and for G_PTR_ADD.

4 years agoAdd a test extracted from D69557 "AsmParser: Allow FMF on varargs call"
Jay Foad [Wed, 29 Jan 2020 16:46:45 +0000 (16:46 +0000)]
Add a test extracted from D69557 "AsmParser: Allow FMF on varargs call"

4 years ago[VE] (conditional) branch modification & isel patterns
Kazushi (Jam) Marukawa [Wed, 29 Jan 2020 16:40:46 +0000 (17:40 +0100)]
[VE] (conditional) branch modification & isel patterns

Summary:
InstInfo for branch modification, (conditional) branch isel patterns and tests.

Reviewed By: arsenm

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

4 years agoGlobalISel: Fix mask computation in lowerInsert
Matt Arsenault [Tue, 21 Jan 2020 23:38:19 +0000 (18:38 -0500)]
GlobalISel: Fix mask computation in lowerInsert

This is supposed to be the high bit index, not the width. Use the
wrapping form of getBitsSet and avoid the bitflip.

4 years agoAMDGPU: Directly select 16-bank LDS case of llvm.amdgcn.interp.p1.f16
Matt Arsenault [Wed, 1 Jan 2020 02:54:33 +0000 (21:54 -0500)]
AMDGPU: Directly select 16-bank LDS case of llvm.amdgcn.interp.p1.f16

Manually select this is as a tablegen workraound. Both SelectionDAG
and GlobalISel end up misplacing the copy to m0 when both instructions
in the output need it. Neither considers that both output instructions
depend on m0. I don't know of any other pattern we need to handle this
case, so it's less effort to just workaround this for now.

4 years ago[MachineScheduler] Ignore artificial edges when forming store chains
Jay Foad [Thu, 19 Dec 2019 16:53:05 +0000 (16:53 +0000)]
[MachineScheduler] Ignore artificial edges when forming store chains

Summary:
BaseMemOpClusterMutation::apply forms store chains by looking for
control (i.e. non-data) dependencies from one mem op to another.

In the test case, clusterNeighboringMemOps successfully clusters the
loads, and then adds artificial edges to the loads' successors as
described in the comment:
      // Copy successor edges from SUa to SUb. Interleaving computation
      // dependent on SUa can prevent load combining due to register reuse.
The effect of this is that *data* dependencies from one load to a store
are copied as *artificial* dependencies from a different load to the
same store.

Then when BaseMemOpClusterMutation::apply looks at the stores, it finds
that some of them have a control dependency on a previous load, which
breaks the chains and means that the stores are not all considered part
of the same chain and won't all be clustered.

The fix is to only consider non-artificial control dependencies when
forming chains.

Subscribers: MatzeB, jvesely, nhaehnle, hiraditya, javed.absar, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU/GlobalISel: Handle LDS with relocations case
Matt Arsenault [Sun, 26 Jan 2020 04:20:38 +0000 (23:20 -0500)]
AMDGPU/GlobalISel: Handle LDS with relocations case

4 years ago[PassManagerBuilder] Remove global extension when a plugin is unloaded
Elia Geretto [Wed, 29 Jan 2020 05:45:27 +0000 (05:45 +0000)]
[PassManagerBuilder] Remove global extension when a plugin is unloaded

This commit fixes PR39321.

GlobalExtensions is not guaranteed to be destroyed when optimizer plugins are unloaded. If it is indeed destroyed after a plugin is dlclose-d, the destructor of the corresponding ExtensionFn is not mapped anymore, causing a call to unmapped memory during destruction.

This commit guarantees that extensions coming from external plugins are removed from GlobalExtensions when the plugin is unloaded if GlobalExtensions has not been destroyed yet.

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

4 years agoAMDGPU: Fix handling of infinite loops in fragment shaders
Connor Abbott [Wed, 27 Nov 2019 13:09:13 +0000 (14:09 +0100)]
AMDGPU: Fix handling of infinite loops in fragment shaders

Summary:
Due to the fact that kill is just a normal intrinsic, even though it's
supposed to terminate the thread, we can end up with provably infinite
loops that are actually supposed to end successfully. The
AMDGPUUnifyDivergentExitNodes pass breaks up these loops, but because
there's no obvious place to make the loop branch to, it just makes it
return immediately, which skips the exports that are supposed to happen
at the end and hangs the GPU if all the threads end up being killed.

While it would be nice if the fact that kill terminates the thread were
modeled in the IR, I think that the structurizer as-is would make a mess if we
did that when the kill is inside control flow. For now, we just add a null
export at the end to make sure that it always exports something, which fixes
the immediate problem without penalizing the more common case. This means that
we sometimes do two "done" exports when only some of the threads enter the
discard loop, but from tests the hardware seems ok with that.

This fixes dEQP-VK.graphicsfuzz.while-inside-switch with radv.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU/GlobalISel: Look through copies for source modifiers
Matt Arsenault [Sun, 26 Jan 2020 01:25:37 +0000 (20:25 -0500)]
AMDGPU/GlobalISel: Look through copies for source modifiers

When all VOP instructions are legalized to VGPRs, any SGPR source
modifiers will have a copy in the way.

4 years ago[AMDGPU] override isHighLatencyDef
Stanislav Mekhanoshin [Tue, 28 Jan 2020 22:14:37 +0000 (14:14 -0800)]
[AMDGPU] override isHighLatencyDef

SIMachineScheduler uses isHighLatencyInstruction with the same
sematincs, but TargetInstrInfo has virtual isHighLatencyDef
method, so override it instead.

Added FLAT to the list of high latency opcodes and a check for
mayLoad since stores are not technically high latency in terms
of data dependency.

This change did not produce any visible impact on our tests.

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

4 years agoGlobalISel: Assert on invalid bitcast in MIRBuilder
Matt Arsenault [Tue, 28 Jan 2020 21:09:12 +0000 (16:09 -0500)]
GlobalISel: Assert on invalid bitcast in MIRBuilder

The other casts validate, so this should too.

4 years agoAMDGPU/GlobalISel: Rewrite fadd select tests
Matt Arsenault [Sun, 26 Jan 2020 01:02:12 +0000 (20:02 -0500)]
AMDGPU/GlobalISel: Rewrite fadd select tests

Convert to the style most others use with one test instruction per
function, and use an implicit use to ensure the result register class
is constrained.

Change-Id: I6109148b0e3c80aa5535796a37abca583c19a936

4 years ago[clang-tidy] Initialize token before handing it to the lexer
Benjamin Kramer [Wed, 29 Jan 2020 15:46:18 +0000 (16:46 +0100)]
[clang-tidy] Initialize token before handing it to the lexer

Found by msan.

4 years agoFix MSVC lamdba default capture mode warning. NFCI.
Simon Pilgrim [Wed, 29 Jan 2020 15:19:26 +0000 (15:19 +0000)]
Fix MSVC lamdba default capture mode warning. NFCI.

4 years agoWork around PR44697 in CrashRecoveryContext
Hans Wennborg [Wed, 29 Jan 2020 15:21:08 +0000 (16:21 +0100)]
Work around PR44697 in CrashRecoveryContext

4 years agoLLT: Add changeNumElements
Matt Arsenault [Tue, 28 Jan 2020 18:14:06 +0000 (13:14 -0500)]
LLT: Add changeNumElements

This is the element analog of changeElementType/changeElementSize

4 years ago[gn build] Port 9a08a3fab99
LLVM GN Syncbot [Wed, 29 Jan 2020 15:15:45 +0000 (15:15 +0000)]
[gn build] Port 9a08a3fab99

4 years agoRevert "AMDGPU: Fix handling of infinite loops in fragment shaders"
Connor Abbott [Wed, 29 Jan 2020 15:14:52 +0000 (16:14 +0100)]
Revert "AMDGPU: Fix handling of infinite loops in fragment shaders"

This reverts commit 0994c485e61322a04e580d83617eab547292aba2.

4 years agoRevert "AMDGPU: Fix AMDGPUUnifyDivergentExitNodes with no normal returns"
Connor Abbott [Wed, 29 Jan 2020 15:14:49 +0000 (16:14 +0100)]
Revert "AMDGPU: Fix AMDGPUUnifyDivergentExitNodes with no normal returns"

This reverts commit 323bfde20c5f3e63db3d6b385b394ed38542abe6.

4 years ago[Analyzer] Split container modeling from iterator modeling
Adam Balogh [Thu, 16 Jan 2020 15:33:05 +0000 (16:33 +0100)]
[Analyzer] Split container modeling from iterator modeling

Iterator modeling depends on container modeling,
but not vice versa. This enables the possibility
to arrange these two modeling checkers into
separate layers.

There are several advantages for doing this: the
first one is that this way we can keep the
respective modeling checkers moderately simple
and small. Furthermore, this enables creation of
checkers on container operations which only
depend on the container modeling. Thus iterator
modeling can be disabled together with the
iterator checkers if they are not needed.

Since many container operations also affect
iterators, container modeling also uses the
iterator library: it creates iterator positions
upon calling the `begin()` or `end()` method of
a containter (but propagation of the abstract
position is left to the iterator modeling),
shifts or invalidates iterators according to the
rules upon calling a container modifier and
rebinds the iterator to a new container upon
`std::move()`.

Iterator modeling propagates the abstract
iterator position, handles the relations between
iterator positions and models iterator
operations such as increments and decrements.

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

4 years ago[LoopFusion] Move instructions from FC1.Preheader to FC0.Preheader when
Whitney Tsang [Wed, 29 Jan 2020 15:02:21 +0000 (15:02 +0000)]
[LoopFusion] Move instructions from FC1.Preheader to FC0.Preheader when
proven safe.

Summary:
Currently LoopFusion give up when the second loop nest preheader is
not empty. For example:

for (int i = 0; i < 100; ++i) {}
x+=1;
for (int i = 0; i < 100; ++i) {}
The above example should be safe to fuse.
This PR moves instructions in FC1 preheader (e.g. x+=1; ) to
FC0 preheader, which then LoopFusion is able to fuse them.
Reviewer: kbarton, Meinersbur, jdoerfert, dmgreen, fhahn, hfinkel,
bmahjour, etiotto
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D71821

4 years ago[VE] udiv/sdiv/urem/srem/mul isel patterns
Kazushi (Jam) Marukawa [Wed, 29 Jan 2020 14:59:29 +0000 (15:59 +0100)]
[VE] udiv/sdiv/urem/srem/mul isel patterns

Summary:
udiv/sdiv/urem/srem/mul integer isel patterns and tests.
Pretend for now that integer division were always cheap in HW.

Reviewed By: arsenm

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

4 years ago[libc] Fix benchmarks CMakeLists.txt
Guillaume Chatelet [Mon, 27 Jan 2020 09:55:32 +0000 (10:55 +0100)]
[libc] Fix benchmarks CMakeLists.txt

Summary:
This is a follow up on https://reviews.llvm.org/rGaba80d0734d1#886881.
`target_link_options` requires CMake>=3.13.

Reviewers: abrachet

Subscribers: mgorny, MaskRay, tschuett, libc-commits

Tags: #libc-project

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

4 years ago[mlir][Linalg] Introduce folding patterns to remove certain MemRefCastOp
Nicolas Vasilache [Tue, 28 Jan 2020 18:44:37 +0000 (13:44 -0500)]
[mlir][Linalg] Introduce folding patterns to remove certain MemRefCastOp

Summary:
Canonicalization and folding patterns in StandardOps may interfere with the needs
of Linalg. This revision introduces specific foldings for dynamic memrefs that can
be proven to be static.

Very concretely:

Determines whether it is possible to fold it away in the parent Linalg op:

```mlir
  %1 = memref_cast %0 : memref<8x16xf32> to memref<?x?xf32>
  %2 = linalg.slice %1 ... : memref<?x?xf32> ...
  // or
  %1 = memref_cast %0 : memref<8x16xf32, affine_map<(i, j)->(16 * i + j)>>
         to memref<?x?xf32>
  linalg.generic(%1 ...) : memref<?x?xf32> ...
```

into

```mlir
  %2 = linalg.slice %0 ... : memref<8x16xf32> ...
  // or
  linalg.generic(%0 ... : memref<8x16xf32, affine_map<(i, j)->(16 * i + j)>>
```

Reviewers: ftynse, aartbik, jsetoain, tetuante, asaadaldien

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU/GlobalISel: Manually select scalar f64 G_FNEG
Matt Arsenault [Sun, 26 Jan 2020 00:34:22 +0000 (19:34 -0500)]
AMDGPU/GlobalISel: Manually select scalar f64 G_FNEG

This should be no problem to support with a pattern, but it turns out
there are just too many yaks to shave. The main problem is in the DAG
emitter, which I have no desire to sink effort into fixing.

If we had a bit to disable patterns in the DAG importer, fixing the
GlobalISelEmitter is more manageable.

4 years agoAnalysis: Add max recursison to isDereferenceableAndAlignedPointer
Matt Arsenault [Sun, 12 Jan 2020 21:50:56 +0000 (16:50 -0500)]
Analysis: Add max recursison to isDereferenceableAndAlignedPointer

Fixes stack overflow in test/CodeGen/X86/large-gep-chain.ll when store
lowering starts adding dereferenceable flags.

4 years agoGlobalISel: Lower G_WRITE_REGISTER
Matt Arsenault [Sun, 12 Jan 2020 18:29:44 +0000 (13:29 -0500)]
GlobalISel: Lower G_WRITE_REGISTER

4 years agoMore fixes of implicit std::string conversions
Mikael Holmén [Wed, 29 Jan 2020 09:32:04 +0000 (10:32 +0100)]
More fixes of implicit std::string conversions

4 years agoAMDGPU: Fix AMDGPUUnifyDivergentExitNodes with no normal returns
Connor Abbott [Mon, 9 Dec 2019 11:04:00 +0000 (12:04 +0100)]
AMDGPU: Fix AMDGPUUnifyDivergentExitNodes with no normal returns

Summary:
The code was assuming in a few places that if there was only one exit
from the function that it was a normal return, which is invalid. It
could be an infinite loop, in which case we still need to insert the
usual fake edge so that the null export happens. This fixes shaders that
end with an infinite loop that discards.

Reviewers: arsenm, nhaehnle, critson

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU: Fix handling of infinite loops in fragment shaders
Connor Abbott [Wed, 27 Nov 2019 13:09:13 +0000 (14:09 +0100)]
AMDGPU: Fix handling of infinite loops in fragment shaders

Summary:
Due to the fact that kill is just a normal intrinsic, even though it's
supposed to terminate the thread, we can end up with provably infinite
loops that are actually supposed to end successfully. The
AMDGPUUnifyDivergentExitNodes pass breaks up these loops, but because
there's no obvious place to make the loop branch to, it just makes it
return immediately, which skips the exports that are supposed to happen
at the end and hangs the GPU if all the threads end up being killed.

While it would be nice if the fact that kill terminates the thread were
modeled in the IR, I think that the structurizer as-is would make a mess if we
did that when the kill is inside control flow. For now, we just add a null
export at the end to make sure that it always exports something, which fixes
the immediate problem without penalizing the more common case. This means that
we sometimes do two "done" exports when only some of the threads enter the
discard loop, but from tests the hardware seems ok with that.

This fixes dEQP-VK.graphicsfuzz.while-inside-switch with radv.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[clangd] Remove the temporary alias for clangd::DiagnosticConsumer.
Haojian Wu [Wed, 29 Jan 2020 11:46:51 +0000 (12:46 +0100)]
[clangd] Remove the temporary alias for clangd::DiagnosticConsumer.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[InstCombine] canonicalize splat shuffle after cmp
Sanjay Patel [Tue, 28 Jan 2020 22:06:22 +0000 (17:06 -0500)]
[InstCombine] canonicalize splat shuffle after cmp

cmp (splat V1, M), SplatC --> splat (cmp V1, SplatC'), M

As discussed in PR44588:
https://bugs.llvm.org/show_bug.cgi?id=44588
...we try harder to push shuffles after binops than after compares.

This patch handles the special (but presumably most common case) of
splat shuffles. If both operands are splats, then we can do the
comparison on the non-splat inputs followed by splat of the compare.
That should take care of the regression noted in D73411.

There's another potential fold requested in PR37463 to scalarize the
compare, but that's another patch (and it's not clear if we can do
that without the ability to undo it later):
https://bugs.llvm.org/show_bug.cgi?id=37463

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

4 years ago[AArch64] Add IR intrinsics for sq(r)dmulh_lane(q)
Sanne Wouda [Wed, 29 Jan 2020 13:07:15 +0000 (13:07 +0000)]
[AArch64] Add IR intrinsics for sq(r)dmulh_lane(q)

Summary:
Currently, sqdmulh_lane and friends from the ACLE (implemented in arm_neon.h),
are represented in LLVM IR as a (by vector) sqdmulh and a vector of (repeated)
indices, like so:

   %shuffle = shufflevector <4 x i16> %v, <4 x i16> undef, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
   %vqdmulh2.i = tail call <4 x i16> @llvm.aarch64.neon.sqdmulh.v4i16(<4 x i16> %a, <4 x i16> %shuffle)

When %v's values are known, the shufflevector is optimized away and we are no
longer able to select the lane variant of sqdmulh in the backend.

This defeats a (hand-coded) optimization that packs several constants into a
single vector and uses the lane intrinsics to reduce register pressure and
trade-off materialising several constants for a single vector load from the
constant pool, like so:

   int16x8_t v = {2,3,4,5,6,7,8,9};
   a = vqdmulh_laneq_s16(a, v, 0);
   b = vqdmulh_laneq_s16(b, v, 1);
   c = vqdmulh_laneq_s16(c, v, 2);
   d = vqdmulh_laneq_s16(d, v, 3);
   [...]

In one microbenchmark from libjpeg-turbo this accounts for a 2.5% to 4%
performance difference.

We could teach the compiler to recover the lane variants, but this would likely
require its own pass.  (Alternatively, "volatile" could be used on the constants
vector, but this is a bit ugly.)

This patch instead implements the following LLVM IR intrinsics for AArch64 to
maintain the original structure through IR optmization and into instruction
selection:
- sqdmulh_lane
- sqdmulh_laneq
- sqrdmulh_lane
- sqrdmulh_laneq.

These 'lane' variants need an additional register class.  The second argument
must be in the lower half of the 64-bit NEON register file, but only when
operating on i16 elements.

Note that the existing patterns for shufflevector and sqdmulh into sqdmulh_lane
(etc.) remain, so code that does not rely on NEON intrinsics to generate these
instructions is not affected.

This patch also changes clang to emit these IR intrinsics for the corresponding
NEON intrinsics (AArch64 only).

Reviewers: SjoerdMeijer, dmgreen, t.p.northover, rovka, rengolin, efriedma

Reviewed By: efriedma

Subscribers: kristof.beyls, hiraditya, jdoerfert, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[MVE][MC] evaluateBranch: add missing MVE opcode
Sjoerd Meijer [Wed, 29 Jan 2020 13:19:45 +0000 (13:19 +0000)]
[MVE][MC] evaluateBranch: add missing MVE opcode

This adds some missing MVE opcodes to evaluateBranch, which results in
llvm-objdump being able to print the PC relative branch target as an
annotation.

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

4 years ago[VE] Isel patterns for fp32/64 and i32/64 conversion
Kazushi (Jam) Marukawa [Wed, 29 Jan 2020 12:58:29 +0000 (13:58 +0100)]
[VE] Isel patterns for fp32/64 and i32/64 conversion

Summary:
fp32/64 <> signed/unsigned i32/64 conversion isel patterns and tests

(This patch depends on `fsub` implemented by https://reviews.llvm.org/D73540 )

Reviewers: arsenm, craig.topper, rengolin, k-ishizaka

Reviewed By: arsenm

Subscribers: merge_guards_bot, wdng, hiraditya, llvm-commits

Tags: #ve, #llvm

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

4 years agoRegenerate aarch64-neon-2velem.c CHECK lines
Sanne Wouda [Fri, 13 Dec 2019 10:46:39 +0000 (10:46 +0000)]
Regenerate aarch64-neon-2velem.c CHECK lines

4 years agoFix clang test build
Sanne Wouda [Wed, 29 Jan 2020 13:01:24 +0000 (13:01 +0000)]
Fix clang test build

4 years agoAdd TagDecl AST matcher
Karasev Nikita [Wed, 29 Jan 2020 12:57:27 +0000 (07:57 -0500)]
Add TagDecl AST matcher

4 years ago[yaml2obj][obj2yaml] - Add lost test cases.
Georgii Rymar [Wed, 29 Jan 2020 12:37:50 +0000 (15:37 +0300)]
[yaml2obj][obj2yaml] - Add lost test cases.

It is a part of https://reviews.llvm.org/D71872 which
was lost somehow during relanding after being reverted:

https://reviews.llvm.org/rG7570d387c21935b58afa67cb9ee17250e38721fa

4 years agoclang-format: insert trailing commas into containers.
Martin Probst [Fri, 24 Jan 2020 15:13:51 +0000 (16:13 +0100)]
clang-format: insert trailing commas into containers.

Summary:
This change adds an option to insert trailing commas into container
literals. For example, in JavaScript:

    const x = [
      a,
      b,
       ^~~~~ inserted if missing.
    ]

This is implemented as a seperate post-processing pass after formatting
(because formatting might change whether the container literal does or
does not wrap). This keeps the code relatively simple and orthogonal,
though it has the notable drawback that the newly inserted comma is not
taken into account for formatting decisions (e.g. it might exceed the 80
char limit). To avoid exceeding the ColumnLimit, a comma is only
inserted if it fits into the limit.

Trailing comma insertion conceptually conflicts with argument
bin-packing: inserting a comma disables bin-packing, so we cannot do
both. clang-format rejects FormatStyle configurations that do both with
this change.

Reviewers: krasimir, MyDeveloperDay

Subscribers: cfe-commits

Tags: #clang

4 years ago[AArch64][SVE] Add SVE2 intrinsics for uniform DSP operations
Kerry McLaughlin [Wed, 29 Jan 2020 10:40:48 +0000 (10:40 +0000)]
[AArch64][SVE] Add SVE2 intrinsics for uniform DSP operations

Summary:
Implements the following intrinsics:
 - sqrdmlah, sqrdmlsh, sqrdmulh & sqdmulh
 - [s|u]hadd, [s|u]hsub, [s|u]rhadd & [s|u]hsubr
 - urecpe, ursqrte, sqabs & sqneg

Reviewers: sdesmalen, efriedma, dancgr, cameron.mcinally

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[NFC][ARM] Add test
Sam Parker [Wed, 29 Jan 2020 11:58:41 +0000 (06:58 -0500)]
[NFC][ARM] Add test

4 years ago[clangd][vscode] Update lsp dependencies to pickup the progress support in LSP 3.15
Haojian Wu [Wed, 29 Jan 2020 10:15:47 +0000 (11:15 +0100)]
[clangd][vscode] Update lsp dependencies to pickup the progress support in LSP 3.15

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[clangd] Replace raw lexer code with token buffer in prepare rename.
Haojian Wu [Wed, 29 Jan 2020 09:12:56 +0000 (10:12 +0100)]
[clangd] Replace raw lexer code with token buffer in prepare rename.

Summary:
there is a slight behavior change in this patch:

- before: `in^t a;`, returns our internal error message (no symbol at given location)
- after: `in^t a, returns null, and client displays their message (e.g.
   e.g. "the element can't be renamed" in vscode).

both are sensible according LSP, and we'd save one `rename` call in the later case.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[clangd] Go-to-definition on 'override' jumps to overridden method(s)
Sam McCall [Fri, 24 Jan 2020 17:21:47 +0000 (18:21 +0100)]
[clangd] Go-to-definition on 'override' jumps to overridden method(s)

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[clangd] add CODE_OWNERS
Sam McCall [Tue, 28 Jan 2020 11:10:50 +0000 (12:10 +0100)]
[clangd] add CODE_OWNERS

Reviewers: klimek

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[LLD][ELF][ARM] Do not substitute BL/BLX for non STT_FUNC symbols.
Peter Smith [Mon, 27 Jan 2020 19:45:28 +0000 (19:45 +0000)]
[LLD][ELF][ARM] Do not substitute BL/BLX for non STT_FUNC symbols.

D73474 disabled the generation of interworking thunks for branch
relocations to non STT_FUNC symbols. This patch handles the case of BL and
BLX instructions to non STT_FUNC symbols. LLD would normally look at the
state of the caller and the callee and write a BL if the states are the
same and a BLX if the states are different.

This patch disables BL/BLX substitution when the destination symbol does
not have type STT_FUNC. This brings our behavior in line with GNU ld which
may prevent difficult to diagnose runtime errors when switching to lld.

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

4 years ago[MLIR] Add OpenMP dialect with barrier operation
David Truby [Wed, 29 Jan 2020 11:31:25 +0000 (11:31 +0000)]
[MLIR] Add OpenMP dialect with barrier operation

Summary:
Barrier is a simple operation that takes no arguments and returns
nothing, but implies a side effect (synchronization of all threads)

Reviewers: jdoerfert

Subscribers: mgorny, guansong, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, llvm-commits

Tags: #llvm

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

4 years ago[clangd] Get rid of delayed template parsing
Kadir Cetinkaya [Wed, 29 Jan 2020 11:01:46 +0000 (12:01 +0100)]
[clangd] Get rid of delayed template parsing

Summary:
No need to pass fno-delayed-template-parsing as the opposite flag is
only passed to cc1 when abi is set to msvc. Sending as a follow-up to D73613 to
keep changes in the release branch minimal.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[clangd][Hover] Make tests hermetic by setting target triplet
Kadir Cetinkaya [Wed, 29 Jan 2020 10:17:45 +0000 (11:17 +0100)]
[clangd][Hover] Make tests hermetic by setting target triplet

Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=44696

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years agoFix an implicit conversion in clang-tidy. GCC 5 complains about it.
Benjamin Kramer [Wed, 29 Jan 2020 11:05:01 +0000 (12:05 +0100)]
Fix an implicit conversion in clang-tidy. GCC 5 complains about it.

4 years ago[ARM] Add documentation for -march= and -mfpu= command line options
Momchil Velikov [Wed, 29 Jan 2020 10:38:10 +0000 (10:38 +0000)]
[ARM] Add documentation for -march= and -mfpu= command line options

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

4 years ago[AArch64][SVE] Add SVE2 intrinsics for pairwise arithmetic
Kerry McLaughlin [Wed, 29 Jan 2020 09:57:30 +0000 (09:57 +0000)]
[AArch64][SVE] Add SVE2 intrinsics for pairwise arithmetic

Summary:
Implements the following intrinsics:
 - addp
 - smaxp, sminp, umaxp & uminp
 - sadalp & uadalp

Reviewers: dancgr, efriedma, sdesmalen, c-rhodes

Reviewed By: c-rhodes

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cameron.mcinally, cfe-commits, llvm-commits

Tags: #llvm

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