platform/upstream/llvm.git
3 years ago[InstCombine] Fix bswap(trunc(bswap(x))) -> trunc(lshr(x, c)) vector support
Simon Pilgrim [Wed, 30 Sep 2020 14:51:54 +0000 (15:51 +0100)]
[InstCombine] Fix bswap(trunc(bswap(x))) -> trunc(lshr(x, c)) vector support

Use getScalarSizeInBits not getPrimitiveSizeInBits to determine the shift value at the element level.

3 years ago[InstCombine] Add bswap(trunc(bswap(x))) -> trunc(lshr(x, c)) vector tests
Simon Pilgrim [Wed, 30 Sep 2020 14:42:53 +0000 (15:42 +0100)]
[InstCombine] Add bswap(trunc(bswap(x))) -> trunc(lshr(x, c)) vector tests

Add tests showing failure to correctly fold vector bswap(trunc(bswap(x))) intrinsic patterns

3 years ago[mlir][Linalg] Generalize the logic to compute reassociation maps
Mahesh Ravishankar [Tue, 29 Sep 2020 23:14:49 +0000 (16:14 -0700)]
[mlir][Linalg] Generalize the logic to compute reassociation maps
while folding tensor_reshape op.

While folding reshapes that introduce unit extent dims, the logic to
compute the reassociation maps can be generalized to handle some
corner cases, for example, when the folded shape still has unit-extent
dims but corresponds to folded unit extent dims of the expanded shape.

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

3 years ago[FE] Use preferred alignment instead of ABI alignment for complete object when applicable
Xiangling Liao [Wed, 30 Sep 2020 14:35:00 +0000 (10:35 -0400)]
[FE] Use preferred alignment instead of ABI alignment for complete object when applicable

On some targets, preferred alignment is larger than ABI alignment in some cases. For example,
on AIX we have special power alignment rules which would cause that. Previously, to support
those cases, we added a “PreferredAlignment” field in the `RecordLayout` to store the AIX
special alignment values in “PreferredAlignment” as the community suggested.

However, that patch alone is not enough. There are places in the Clang where `PreferredAlignment`
should have been used instead of ABI-specified alignment. This patch is aimed at fixing those
spots.

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

3 years ago[InstCombine] Remove %tmp variable names from bswap-fold tests
Simon Pilgrim [Wed, 30 Sep 2020 14:32:57 +0000 (15:32 +0100)]
[InstCombine] Remove %tmp variable names from bswap-fold tests

Appease update_test_checks script that was complaining about potential %TMP clashes

3 years agoGlobalISel: Assert if MoreElements uses a non-vector type
Matt Arsenault [Sat, 26 Sep 2020 14:14:14 +0000 (10:14 -0400)]
GlobalISel: Assert if MoreElements uses a non-vector type

3 years agoLiveDebugValues: Fix typos and indentation
Matt Arsenault [Tue, 22 Sep 2020 15:46:41 +0000 (11:46 -0400)]
LiveDebugValues: Fix typos and indentation

3 years agoRegAllocFast: Add extra DBG_VALUE for live out spills
Matt Arsenault [Mon, 28 Sep 2020 17:42:17 +0000 (13:42 -0400)]
RegAllocFast: Add extra DBG_VALUE for live out spills

This allows LiveDebugValues to insert the proper DBG_VALUEs in live
out blocks if a spill is inserted before the use of a
register. Previously, this would see the register use as the last
DBG_VALUE, even though the stack slot should be treated as the live
out value.

This avoids an lldb test regression when D52010 is re-applied.

3 years agoReapply "RegAllocFast: Rewrite and improve"
Matt Arsenault [Tue, 22 Sep 2020 12:55:54 +0000 (08:55 -0400)]
Reapply "RegAllocFast: Rewrite and improve"

This reverts commit 73a6a164b84a8195defbb8f5eeb6faecfc478ad4.

3 years ago[NFC][FE] Replace TypeSize with StorageUnitSize
Xiangling Liao [Wed, 30 Sep 2020 13:52:41 +0000 (09:52 -0400)]
[NFC][FE] Replace TypeSize with StorageUnitSize

On some targets like AIX, last bitfield size is not always equal to last
bitfield type size. Some bitfield like bool will have the same alignment
as [unsigned]. So we'd like to use a more general term `StorageUnit` to
replace type in this field.

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

3 years ago[sanitizers] Fix internal__exit on Solaris
Rainer Orth [Wed, 30 Sep 2020 14:30:18 +0000 (16:30 +0200)]
[sanitizers] Fix internal__exit on Solaris
`TestCases/log-path_test.cpp` currently `FAIL`s on Solaris:

  $ env ASAN_OPTIONS=log_path=`for((i=0;i<10000;i++)); do echo -n $i; done`  ./log-path_test.cpp.tmp
  ==5031==ERROR: Path is too long: 01234567...
  Segmentation Fault (core dumped)

The `SEGV` happens here:

  Thread 2 received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 1 (LWP 1)]
  0x00000000 in ?? ()
  (gdb) where
  #0  0x00000000 in ?? ()
  #1  0x080a1e63 in __interceptor__exit (status=1)
      at /vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:3808
  #2  0x08135ea8 in __sanitizer::internal__exit (exitcode=1)
      at /vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cc:139

when `__interceptor__exit` tries to call `__interception::real__exit` which
is `NULL` at this point because the interceptors haven't been initialized yet.

Ultimately, the problem lies elsewhere, however: `internal__exit` in
`sanitizer_solaris.cpp` calls `_exit` itself since there doesn't exit a
non-intercepted version in `libc`.  Using the `syscall` interface instead
isn't usually an option on Solaris because that interface isn't stable.
However, in the case of `SYS_exit` it can be used nonetheless: `SYS_exit`
has remained unchanged since at least Solaris 2.5.1 in 1996, and this is
what this patch does.

Tested on `amd64-pc-solaris2.11`.

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

3 years agoMove AffineMapAttr into BaseOps.td
Benjamin Kramer [Wed, 30 Sep 2020 11:26:25 +0000 (13:26 +0200)]
Move AffineMapAttr into BaseOps.td

AffineMapAttr is already part of base, it's just impossible to refer to
it from ODS without pulling in the definition from Affine dialect.

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

3 years ago[GlobalISel] Fix incorrect setting of ValNo when splitting
Gabriel Hjort Åkerlund [Wed, 30 Sep 2020 13:24:41 +0000 (15:24 +0200)]
[GlobalISel] Fix incorrect setting of ValNo when splitting

Before, for each original argument i, ValNo was set to i + PartIdx, but
ValNo is intended to reflect the index of the value before splitting.
Hence, ValNo should always be set to i and not consider the PartIdx.

Reviewed By: arsenm

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

3 years ago[PowerPC] Remove support for VRSAVE save/restore/update.
Sean Fertile [Wed, 30 Sep 2020 13:56:55 +0000 (09:56 -0400)]
[PowerPC] Remove support for VRSAVE save/restore/update.

After removal of Darwin as a PowerPC subtarget, the VRSAVE
save/restore/spill/update code is no longer needed by any supported
subtarget, so remove it while keeping support for vrsave and related instruction
aliases for inline asm. I've pre-commited tests to document the existing vrsave
handling in relation to @llvm.eh.unwind.init and inline asm usage, as
well as a test which shows a beahviour change on AIX related to
returning vector type as we were wrongly emiting VRSAVE_UPDATE on AIX.

3 years ago[clangd] Fix invalid UTF8 when extracting doc comments.
Sam McCall [Wed, 30 Sep 2020 13:45:13 +0000 (15:45 +0200)]
[clangd] Fix invalid UTF8 when extracting doc comments.

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

3 years ago[InstCombine] recognizeBSwapOrBitReverseIdiom - merge the regular/trunc+zext paths...
Simon Pilgrim [Wed, 30 Sep 2020 13:54:04 +0000 (14:54 +0100)]
[InstCombine] recognizeBSwapOrBitReverseIdiom - merge the regular/trunc+zext paths. NFCI.

There doesn't seem to be any good reason for having a separate path for when we bswap/bitreverse at a smaller size than the destination size - so merge these to make the instruction generation a lot clearer.

3 years ago[InstCombine] Remove %tmp variable names from bswap tests
Simon Pilgrim [Wed, 30 Sep 2020 13:39:23 +0000 (14:39 +0100)]
[InstCombine] Remove %tmp variable names from bswap tests

Appease update_test_checks script that was complaining about potential %TMP clashes

3 years ago[InstCombine] recognizeBSwapOrBitReverseIdiom - remove unnecessary cast. NFCI.
Simon Pilgrim [Wed, 30 Sep 2020 13:36:12 +0000 (14:36 +0100)]
[InstCombine] recognizeBSwapOrBitReverseIdiom - remove unnecessary cast. NFCI.

3 years ago[lldb] [Process/NetBSD] Fix operating on ftag register
Michał Górny [Wed, 30 Sep 2020 12:53:05 +0000 (14:53 +0200)]
[lldb] [Process/NetBSD] Fix operating on ftag register

3 years ago[VPlan] Change recipes to inherit from VPUser instead of a member var.
Florian Hahn [Tue, 22 Sep 2020 14:10:06 +0000 (15:10 +0100)]
[VPlan] Change recipes to inherit from VPUser instead of a member var.

Now that VPUser is not inheriting from VPValue, we can take the next
step and turn the recipes that already manage their operands via VPUser
into VPUsers directly. This is another small step towards traversing
def-use chains in VPlan.

This is NFC with respect to the generated code, but makes the interface
more powerful.

3 years ago[lldb] Fix FreeBSD Arm Process Plugin build
Ed Maste [Wed, 30 Sep 2020 12:27:09 +0000 (08:27 -0400)]
[lldb] Fix FreeBSD Arm Process Plugin build

Add a missing include and some definitions in 769533216666.

Patch by: Brooks Davis

Reviewed by: labath

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

3 years ago[InstCombine] Add PR47191 bswap tests
Simon Pilgrim [Wed, 30 Sep 2020 13:19:00 +0000 (14:19 +0100)]
[InstCombine] Add PR47191 bswap tests

3 years ago[InstCombine] recognizeBSwapOrBitReverseIdiom - cleanup bswap/bitreverse detection...
Simon Pilgrim [Wed, 30 Sep 2020 13:11:43 +0000 (14:11 +0100)]
[InstCombine] recognizeBSwapOrBitReverseIdiom - cleanup bswap/bitreverse detection loop. NFCI.

Early out if both pattern matches have failed (or we don't want them). Fix case of bit index iterator (and avoid Wshadow issue).

3 years ago[RDA] isSafeToDefRegAt: Look at global uses
Sam Parker [Wed, 30 Sep 2020 11:25:06 +0000 (12:25 +0100)]
[RDA] isSafeToDefRegAt: Look at global uses

We weren't looking at global uses of a value, so we could happily
overwrite the register incorrectly.

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

3 years ago[InstCombine] recognizeBSwapOrBitReverseIdiom - use ArrayRef::back() helper. NFCI.
Simon Pilgrim [Wed, 30 Sep 2020 12:39:18 +0000 (13:39 +0100)]
[InstCombine] recognizeBSwapOrBitReverseIdiom - use ArrayRef::back() helper. NFCI.

Post-commit feedback on D88316

3 years agoInstCombine] collectBitParts - cleanup variable names. NFCI.
Simon Pilgrim [Wed, 30 Sep 2020 11:28:18 +0000 (12:28 +0100)]
InstCombine] collectBitParts - cleanup variable names. NFCI.

Fix a number of WShadow warnings (I was used as the instruction and index......) and fix cases to match style.

Also, replaced the Bit APInt mask check in AND instructions with a direct APInt[] bit check.

3 years ago[SCEV] Verify that all mapped SCEV AddRecs refer to valid loops.
Florian Hahn [Wed, 30 Sep 2020 11:39:30 +0000 (12:39 +0100)]
[SCEV] Verify that all mapped SCEV AddRecs refer to valid loops.

This check helps to guard against cases where expressions referring to
invalidated/deleted loops are not properly invalidated.

The additional check is motivated by the reproducer shared for 8fdac7cb7abb
and I think in general make sense as a sanity check.

Reviewed By: reames

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

3 years ago[mlir][Linalg] Tile sizes for Conv ops vectorization added as pass arguments
Jakub Lichman [Wed, 30 Sep 2020 07:13:59 +0000 (07:13 +0000)]
[mlir][Linalg] Tile sizes for Conv ops vectorization added as pass arguments

Current setup for conv op vectorization does not enable user to specify tile
sizes as well as dimensions for vectorization. In this commit we change that by
adding tile sizes as pass arguments. Every dimension with corresponding tile
size > 1 is automatically vectorized.

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

3 years ago[NFC][ARM] Add more LowOverheadLoop tests.
Sam Parker [Wed, 30 Sep 2020 11:14:39 +0000 (12:14 +0100)]
[NFC][ARM] Add more LowOverheadLoop tests.

3 years ago[mlir] Added support for rank reducing subviews
Jakub Lichman [Wed, 30 Sep 2020 07:42:43 +0000 (07:42 +0000)]
[mlir] Added support for rank reducing subviews

This commit adds support for subviews which enable to reduce resulting rank
by dropping static dimensions of size 1.

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

3 years ago[InstCombine] recognizeBSwapOrBitReverseIdiom - recognise zext(bswap(trunc(x))) patte...
Simon Pilgrim [Wed, 30 Sep 2020 11:07:19 +0000 (12:07 +0100)]
[InstCombine] recognizeBSwapOrBitReverseIdiom - recognise zext(bswap(trunc(x))) patterns (PR39793)

PR39793 demonstrated an issue where we fail to recognize 'partial' bswap patterns of the lower bytes of an integer source.

In fact, most of this is already in place collectBitParts suitably tags zero bits, so we just need to correctly handle this case by finding the zero'd upper bits and reducing the bswap pattern just to the active demanded bits.

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

3 years ago[InstCombine] recognizeBSwapOrBitReverseIdiom - assert for correct bit providence...
Simon Pilgrim [Wed, 30 Sep 2020 10:13:54 +0000 (11:13 +0100)]
[InstCombine] recognizeBSwapOrBitReverseIdiom - assert for correct bit providence indices. NFCI.

As suggested by @spatel on D88316

3 years ago[gn build] Port 413577a8790
LLVM GN Syncbot [Wed, 30 Sep 2020 10:09:34 +0000 (10:09 +0000)]
[gn build] Port 413577a8790

3 years ago[X86] Support Intel Key Locker
Xiang1 Zhang [Wed, 30 Sep 2020 10:01:15 +0000 (18:01 +0800)]
[X86] Support Intel Key Locker

Key Locker provides a mechanism to encrypt and decrypt data with an AES key without having access
to the raw key value by converting AES keys into “handles”. These handles can be used to perform the
same encryption and decryption operations as the original AES keys, but they only work on the current
system and only until they are revoked. If software revokes Key Locker handles (e.g., on a reboot),
then any previous handles can no longer be used.

Reviewed By: craig.topper

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

3 years ago[MLIR][SPIRV] Support different function control in (de)serialization
George Mitenkov [Wed, 30 Sep 2020 09:05:17 +0000 (12:05 +0300)]
[MLIR][SPIRV] Support different function control in (de)serialization

Added support for different function control
in serialization and deserialization.

Reviewed By: mravishankar

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

3 years ago[SystemZ] Support bare nop instructions
Jonas Paulsson [Thu, 24 Sep 2020 15:24:29 +0000 (17:24 +0200)]
[SystemZ]  Support bare nop instructions

Add support of "nop" and "nopr" (without operands) to assembler.

Review: Ulrich Weigand

3 years ago[SplitKit] Cope with no live subranges in defFromParent
Jay Foad [Mon, 28 Sep 2020 08:30:58 +0000 (09:30 +0100)]
[SplitKit] Cope with no live subranges in defFromParent

Following on from D87757 "[SplitKit] Only copy live lanes", it is
possible to split a live range at a point when none of its subranges
are live. This patch handles that case by inserting an implicit def
of the superreg.

Patch by Quentin Colombet!

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

3 years ago[AMDGPU] Do not generate mul with 1 in AMDGPU Atomic Optimizer
Mirko Brkusanin [Tue, 29 Sep 2020 14:35:42 +0000 (16:35 +0200)]
[AMDGPU] Do not generate mul with 1 in AMDGPU Atomic Optimizer

Check if operand of mul is constant value of one for certain atomic
instructions in order to avoid making unnecessary instructions when
-amdgpu-atomic-optimizer is present.

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

3 years ago[clangd][remote] Make sure relative paths are absolute with respect to posix style
Kadir Cetinkaya [Tue, 29 Sep 2020 18:15:03 +0000 (20:15 +0200)]
[clangd][remote] Make sure relative paths are absolute with respect to posix style

Relative paths received from the server are always in posix style. So
we need to ensure they are relative using that style, and not the native one.

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

3 years ago[clangd] Fix fuzzer build after 7ba0779fbb41b6fa8
Sam McCall [Wed, 30 Sep 2020 09:02:05 +0000 (11:02 +0200)]
[clangd] Fix fuzzer build after 7ba0779fbb41b6fa8

3 years ago[clangd] Fix member/type name conflict caught by buildbots.
Sam McCall [Wed, 30 Sep 2020 08:56:43 +0000 (10:56 +0200)]
[clangd] Fix member/type name conflict caught by buildbots.

3 years agoRevert "[gardening] Replace some uses of setDebugLoc(DebugLoc()) with dropLocation...
Jeremy Morse [Wed, 30 Sep 2020 08:43:29 +0000 (09:43 +0100)]
Revert "[gardening] Replace some uses of setDebugLoc(DebugLoc()) with dropLocation(), NFC"

Some of the buildbots have croaked with this patch, for examples failures
that begin in this build:

  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/29933

This reverts commit 674f57870f4c8a7fd7b629bffc85b149cbefd3e0.

3 years ago[llvm-readobj][test] - Stop using few precompiled binaries in mips-got.test
Georgii Rymar [Tue, 29 Sep 2020 14:06:08 +0000 (17:06 +0300)]
[llvm-readobj][test] - Stop using few precompiled binaries in mips-got.test

This removes 4 input files (one source file and 3 precompiled binaries) from
`mips-got.test` (now YAMLs are used instead) and also makes the testing of
the GNU output a bit stricter (`--strict-whitespace --match-full-lines`).

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

3 years ago[llvm-readobj][ARM] - Improve support of printing unwind (-u) information for non...
Georgii Rymar [Tue, 29 Sep 2020 10:53:38 +0000 (13:53 +0300)]
[llvm-readobj][ARM] - Improve support of printing unwind (-u) information for non-relocatable objects.

This is the one more patch for https://bugs.llvm.org/show_bug.cgi?id=47581

It fixes how we print an information for the Generic model. With this patch
we are able to read values from `.ARM.extab` and dump proper personality routines names/addresses.

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

3 years ago[MLIR][Standard] Add `atan2` to standard dialect
Frederik Gossen [Wed, 30 Sep 2020 08:38:08 +0000 (08:38 +0000)]
[MLIR][Standard] Add `atan2` to standard dialect

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

3 years ago[ARM][LowOverheadLoops] TryRemove helper.
Sam Parker [Wed, 30 Sep 2020 08:36:57 +0000 (09:36 +0100)]
[ARM][LowOverheadLoops] TryRemove helper.

Make a helper function that wraps around RDA::isSafeToRemove and
utilises the existing DCE IT block checks.

3 years ago[clangd] Mark code action as "preferred" if it's the sole quickfix action
Sam McCall [Tue, 29 Sep 2020 14:28:50 +0000 (16:28 +0200)]
[clangd] Mark code action as "preferred" if it's the sole quickfix action

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

3 years ago[clangd] Extract options struct for ClangdLSPServer. NFC
Sam McCall [Tue, 29 Sep 2020 08:37:46 +0000 (10:37 +0200)]
[clangd] Extract options struct for ClangdLSPServer. NFC

In preparation for making moving TweakFilter from ClangdServer::Options to
a ClangdLSPServer option, and letting it vary per-request.
(In order to implement CodeActionParams.only)

Also a general overdue cleanup.

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

3 years ago[NFC][ARM] Add LowOverheadLoop test
Sam Parker [Wed, 30 Sep 2020 07:36:48 +0000 (08:36 +0100)]
[NFC][ARM] Add LowOverheadLoop test

3 years ago[RDA] Switch isSafeToMove iterators
Sam Parker [Mon, 28 Sep 2020 14:46:56 +0000 (15:46 +0100)]
[RDA] Switch isSafeToMove iterators

So forwards is forwards and backwards is reverse. Also add a check
so that we know the instructions are in the expected order.

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

3 years ago[ARM] Change VPT state assertion
Sam Parker [Thu, 24 Sep 2020 13:02:53 +0000 (14:02 +0100)]
[ARM] Change VPT state assertion

Just because we haven't encountered an instruction setting the VPR,
it doesn't mean we can't create a VPT block - the VPR maybe a
live-in.

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

3 years ago[lldb] Use config.lldb_src_root in lit_config.load_config (NFC)
Jonas Devlieghere [Wed, 30 Sep 2020 06:00:18 +0000 (23:00 -0700)]
[lldb] Use config.lldb_src_root in lit_config.load_config (NFC)

Rather than relaying on CMake to substitute the full path to the lldb
source root, use the  value set in config.lldb_src_root. This makes it
slightly easier to write a custom lit.site.cfg.py.

3 years agoRemove test AST/const-fpfeatures-diag.c
Serge Pavlov [Wed, 30 Sep 2020 04:07:55 +0000 (11:07 +0700)]
Remove test AST/const-fpfeatures-diag.c

This test is going to be removed because using dynamic rounding mode
in initializers is changing. It also causes build failures in some
cases, so remove it now.

3 years ago[mlir] Update docs referencing OpTrait::Symbol.
Scott Todd [Wed, 30 Sep 2020 03:55:54 +0000 (03:55 +0000)]
[mlir] Update docs referencing OpTrait::Symbol.

Since https://reviews.llvm.org/D78522, Symbol is not a Trait itself.

Reviewed By: rriddle

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

3 years ago[gn build] Add missing dependency to Extensions
Arthur Eubanks [Wed, 30 Sep 2020 03:12:00 +0000 (20:12 -0700)]
[gn build] Add missing dependency to Extensions

3 years agoRemove further OpenBSD/sparc bits
Brad Smith [Wed, 30 Sep 2020 02:17:12 +0000 (22:17 -0400)]
Remove further OpenBSD/sparc bits

3 years ago[GlobalISel] Fix multiply with overflow intrinsics legalization generating invalid...
Amara Emerson [Tue, 29 Sep 2020 21:39:54 +0000 (14:39 -0700)]
[GlobalISel] Fix multiply with overflow intrinsics legalization generating invalid MIR.

During lowering of G_UMULO and friends, the previous code moved the builder's
insertion point to be after the legalizing instruction. When that happened, if
there happened to be a "G_CONSTANT i32 0" immediately after, the CSEMIRBuilder
would try to find that constant during the buildConstant(zero) call, and since
it dominates itself would return the iterator unchanged, even though the def
of the constant was *after* the current insertion point. This resulted in the
compare being generated *before* the constant which it was using.

There's no need to modify the insertion point before building the mul-hi or
constant. Delaying moving the insert point ensures those are built/CSEd before
the G_ICMP is built.

Fixes PR47679

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

3 years ago[X86] Increase the depth threshold required to form VPERMI2W/VPERMI2B in shuffle...
Craig Topper [Tue, 29 Sep 2020 17:51:49 +0000 (10:51 -0700)]
[X86] Increase the depth threshold required to form VPERMI2W/VPERMI2B in shuffle combining

These instructions are implemented with two port 5 uops and one port 015 uop so they are more complicated that most shuffles.

This patch increases the depth threshold for when we form them during shuffle combining to try to limit increasing the number of uops especially on port 5.

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

3 years ago[AIX] asm output: use character literals in byte lists for strings
Hubert Tong [Wed, 30 Sep 2020 01:11:16 +0000 (21:11 -0400)]
[AIX] asm output: use character literals in byte lists for strings

This patch improves the assembly output produced for string literals by
using character literals in byte lists. This provides the benefits of
having printable characters appear as such in the assembly output and of
having strings kept as logical units on the same line.

Reviewed By: daltenty

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

3 years ago[RISCV] Use the extensions in the canonical order (NFC)
Evandro Menezes [Tue, 29 Sep 2020 22:11:12 +0000 (17:11 -0500)]
[RISCV] Use the extensions in the canonical order (NFC)

Use the ISA extensions for specific processors in the conventional canonical order.

3 years agoAdd remquo, frexp and modf overload functions to HIP header
Yaxun (Sam) Liu [Tue, 29 Sep 2020 12:51:26 +0000 (08:51 -0400)]
Add remquo, frexp and modf overload functions to HIP header

3 years ago[gardening] Replace some uses of setDebugLoc(DebugLoc()) with dropLocation(), NFC
Vedant Kumar [Wed, 30 Sep 2020 00:37:36 +0000 (17:37 -0700)]
[gardening] Replace some uses of setDebugLoc(DebugLoc()) with dropLocation(), NFC

3 years ago[lldb] Hoist -s (trace directory) argument out of LLDB_TEST_COMMON_ARGS (NFC)
Jonas Devlieghere [Wed, 30 Sep 2020 00:22:16 +0000 (17:22 -0700)]
[lldb] Hoist -s (trace directory) argument out of LLDB_TEST_COMMON_ARGS (NFC)

Give the trace directory argument its own variable
(LLDB_TEST_TRACE_DIRECTORY) so that we can configure it in
lit.site.cfg.py if we so desire.

3 years agoFix test failures with trunk clang
Richard Smith [Wed, 30 Sep 2020 00:08:42 +0000 (17:08 -0700)]
Fix test failures with trunk clang

- Make the consteval constructor for the zero type be noexcept
- Don't expect three-way comparison of 0 against a comparison category
  to fail

3 years ago[NFC][Msan] Add llvm.fabs test
Vitaly Buka [Tue, 29 Sep 2020 22:31:25 +0000 (15:31 -0700)]
[NFC][Msan] Add llvm.fabs test

llvm.fabs does not need a special handler as llvm.abs as its
single argument type match the return type.

3 years ago[NFC][MSAN] Remove an attribute in test
Vitaly Buka [Tue, 29 Sep 2020 21:38:56 +0000 (14:38 -0700)]
[NFC][MSAN] Remove an attribute in test

3 years ago[docs] Recommend dropLocation() over setDebugLoc(DebugLoc())
Vedant Kumar [Wed, 30 Sep 2020 00:07:06 +0000 (17:07 -0700)]
[docs] Recommend dropLocation() over setDebugLoc(DebugLoc())

3 years ago[DebugInfo] Add types from constructor homing to the retained types list.
Amy Huang [Tue, 29 Sep 2020 23:19:08 +0000 (16:19 -0700)]
[DebugInfo] Add types from constructor homing to the retained types list.

Add class types to the retained types list to make sure they
don't get dropped if the constructor is optimized out later.

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

3 years agoFix a variety of minor issues with ObjC method mangling:
John McCall [Tue, 29 Sep 2020 22:47:37 +0000 (18:47 -0400)]
Fix a variety of minor issues with ObjC method mangling:

- Fix a memory leak accidentally introduced yesterday by using CodeGen's
  existing mangling context instead of creating a new context afresh.

- Move GNU-runtime ObjC method mangling into the AST mangler; this will
  eventually be necessary to support direct methods there, but is also
  just the right architecture.

- Make the Apple-runtime method mangling work properly when given an
  interface declaration, fixing a bug (which had solidified into a test)
  where mangling a category method from the interface could cause it to
  be mangled as if the category name was a class name.  (Category names
  are namespaced within their class and have no global meaning.)

- Fix a code cross-reference in dsymutil.

Based on a patch by Ellis Hoag.

3 years ago[mlir] Remove more OpBuilder args which are now injected
Jacques Pienaar [Tue, 29 Sep 2020 23:47:21 +0000 (16:47 -0700)]
[mlir] Remove more OpBuilder args which are now injected

NFC. Some small changes to make things more consistent but primarily
avoiding old behavior without any further change.

3 years ago[CodeExtractor] Don't create bitcasts when inserting lifetime markers (NFCI)
Vedant Kumar [Tue, 29 Sep 2020 23:32:06 +0000 (16:32 -0700)]
[CodeExtractor] Don't create bitcasts when inserting lifetime markers (NFCI)

Lifetime marker intrinsics support any pointer type, so CodeExtractor
does not need to bitcast to `i8*` in order to use these markers.

3 years agoFix use of wrong printf format specifier for size_t argument.
Richard Smith [Tue, 29 Sep 2020 23:01:25 +0000 (16:01 -0700)]
Fix use of wrong printf format specifier for size_t argument.

This causes a build break under -Werror=format.

3 years ago[AMDGPU] Remove SIEncodingFamily.GFX10_B
Stanislav Mekhanoshin [Tue, 29 Sep 2020 22:32:04 +0000 (15:32 -0700)]
[AMDGPU] Remove SIEncodingFamily.GFX10_B

It turns to be not needed anymore.

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

3 years agoRecognize setjmp and friends as builtins even if jmp_buf is not declared yet.
Richard Smith [Tue, 29 Sep 2020 22:20:11 +0000 (15:20 -0700)]
Recognize setjmp and friends as builtins even if jmp_buf is not declared yet.

This happens in glibc's headers. It's important that we recognize these
functions so that we can mark them as returns_twice.

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

3 years agoImprove the representation of <compare>'s zero-only type.
Richard Smith [Fri, 31 Jul 2020 22:03:21 +0000 (15:03 -0700)]
Improve the representation of <compare>'s zero-only type.

* Use an empty struct instead of a member pointer to represent this
  type, so that we don't actually pass a zero member pointer at runtime.

* Mark the constructor as consteval to ensure that no code is emitted
  for it whenever possible.

* Add a honeypot constructor to reject all non-int arguments, so that
  the only argument that can arrive at the real constructor is the
  literal 0.

This results in better generated code, and rejecting invalid comparisons
against nullptr, 0L, and so on, while also rejecting invalid comparisons
against (1-1) and similar that would be allowed if we required an
integer constant expression with value 0.

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

3 years ago[nfc][libomptarget] Drop parameter to named_sync
JonChesterfield [Tue, 29 Sep 2020 22:11:46 +0000 (23:11 +0100)]
[nfc][libomptarget] Drop parameter to named_sync

[nfc][libomptarget] Drop parameter to named_sync

named_sync has one call site (in sync.cu) where it always passed L1_BARRIER.
Folding this into the call site and dropping the macro is a simplification.

amdgpu doesn't have ptx' bar.sync instruction. A correct implementation of
__kmpc_impl_named_sync in terms of shared memory is much easier if it can
assume that the barrier argument is this constant. Said implementation is left
for a second patch.

Reviewed By: jdoerfert

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

3 years ago[flang][msvc] Define access flags under Windows. NFC.
Michael Kruse [Tue, 29 Sep 2020 21:57:05 +0000 (16:57 -0500)]
[flang][msvc] Define access flags under Windows. NFC.

The flags F_OK, R_OK and W_OK are defined in unistd.h, which does not exist under the Windows platform. Windows still defines the `access` function. Its access flags are documented at https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/access-waccess. For compatibility, define the flags F_OK, R_OK and W_OK using these constants.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: klausler

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

3 years ago[flang][msvc] Define implicit conversion from UnsignedInt128 to int64_t.
Michael Kruse [Tue, 29 Sep 2020 21:30:07 +0000 (16:30 -0500)]
[flang][msvc] Define implicit conversion from UnsignedInt128 to int64_t.

The custom implementation of UnsignedInt128 has an implicit conversion operator to unit64_t, but not int64_t. Considering that the former is already truncating, and C++ implicitly converts uint64_t to int64_t, UnsignedInt128  should also support an implicit conversion to int64_t. An analogous conversion would be from uint32_t to int16_t.

Without the conversion operator overload, the msvc emits the following error:
```
descriptor-io.h(44): error C2440: 'static_cast': cannot convert from 'A' to 'int64_t'
        with
        [
            A=Fortran::common::uint128_t
        ]
```

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: klausler

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

3 years ago[SVE] Lower fixed length VECREDUCE_[FMAX|FMIN] to Scalable
Cameron McInally [Tue, 29 Sep 2020 21:20:33 +0000 (16:20 -0500)]
[SVE] Lower fixed length VECREDUCE_[FMAX|FMIN] to Scalable

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

3 years ago[ms] [llvm-ml] Create the @feat.00 symbol, and populate it appropriately
Eric Astor [Tue, 29 Sep 2020 21:02:18 +0000 (17:02 -0400)]
[ms] [llvm-ml] Create the @feat.00 symbol, and populate it appropriately

@feat.00 is a bitfield read by Microsoft-style linkers, and is required to signal (e.g.) /safeseh support on 32-bit systems.

Reviewed By: rnk

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

3 years ago[ms] [llvm-ml] Accept whitespace around the dot operator
Eric Astor [Tue, 29 Sep 2020 21:01:05 +0000 (17:01 -0400)]
[ms] [llvm-ml] Accept whitespace around the dot operator

MASM allows arbitrary whitespace around the Intel dot operator, especially when used for struct field lookup

Reviewed By: rnk

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

3 years ago[ms] [llvm-ml] Add support for "alias" directive
Eric Astor [Tue, 29 Sep 2020 20:59:42 +0000 (16:59 -0400)]
[ms] [llvm-ml] Add support for "alias" directive

Support the "alias" directive.

Required support for emitWeakReference in MCWinCOFFStreamer.

Reviewed By: thakis

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

3 years ago[ms] [llvm-ml] Add REAL10 support (x87 extended precision)
Eric Astor [Tue, 29 Sep 2020 20:58:39 +0000 (16:58 -0400)]
[ms] [llvm-ml] Add REAL10 support (x87 extended precision)

Add MASM support for 80-bit reals in the x87 extended precision format.

Reviewed By: thakis

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

3 years ago[ms] [llvm-ml] Add MASM hex float support
Eric Astor [Tue, 29 Sep 2020 20:57:25 +0000 (16:57 -0400)]
[ms] [llvm-ml] Add MASM hex float support

Implement MASM's syntax for specifying floats in raw hexadecimal bytes.

Reviewed By: thakis

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

3 years ago[ms] [llvm-ml] Add support for .radix directive, and accept all radix specifiers
Eric Astor [Tue, 29 Sep 2020 20:17:47 +0000 (16:17 -0400)]
[ms] [llvm-ml] Add support for .radix directive, and accept all radix specifiers

Add support for .radix directive, and radix specifiers [yY] (binary), [oOqQ] (octal), and [tT] (decimal).

Also, when lexing MASM integers, require radix specifier; MASM requires that all literals without a radix specifier be treated as in the default radix. (e.g., 0100 = 100)

Relanding D87400, now with fewer ms-inline-asm tests broken!

Reviewed By: rnk

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

3 years ago[MLIR] Avoid adding debuginfo for a function if it contains calls that has no debug...
Tim Shen [Wed, 23 Sep 2020 06:36:08 +0000 (23:36 -0700)]
[MLIR] Avoid adding debuginfo for a function if it contains calls that has no debug info.

Also add a verifier pass to ExecutionEngine.

It's hard to come up with a test case, since mlir-opt always add location info after parsing it (?)

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

3 years ago[clangd] Trivial setter support when moving items to fields
Nathan James [Tue, 29 Sep 2020 20:51:14 +0000 (21:51 +0100)]
[clangd] Trivial setter support when moving items to fields

Extend the Trivial setter documentation to support cases where the value is moved into a field using `std::move`.

Reviewed By: sammccall, kadircet

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

3 years agoRevert "[Sema] Address-space sensitive check for unbounded arrays (v2)"
Chris Hamilton [Tue, 29 Sep 2020 20:34:46 +0000 (22:34 +0200)]
Revert "[Sema] Address-space sensitive check for unbounded arrays (v2)"

This reverts commit d9ee935679e7164d1c47e351bbbcf5c25742b59c.

3 years agoBetter diagnostics for anonymous bit-fields with attributes or an initializer.
Aaron Ballman [Tue, 29 Sep 2020 20:27:51 +0000 (16:27 -0400)]
Better diagnostics for anonymous bit-fields with attributes or an initializer.

The current C++ grammar allows an anonymous bit-field with an attribute,
but this is ambiguous (the attribute in that case could appertain to the
type instead of the bit-field). The current thinking in the Core Working
Group is that it's better to disallow attributes in that position at the
grammar level so that the ambiguity resolves in favor of applying to the
type.

During discussions about the behavior of the attribute, the Core Working
Group also felt it was better to disallow anonymous bit-fields from
specifying a default member initializer.

This implements both sets of related grammar changes.

3 years ago[libc++] Rename the -fno-rtti Lit feature to just no-rtti
Louis Dionne [Tue, 29 Sep 2020 20:28:41 +0000 (16:28 -0400)]
[libc++] Rename the -fno-rtti Lit feature to just no-rtti

This is consistent to the way we name other Lit features, and it removes
the possibility for confusing the Lit feature with the actual compiler
flag.

3 years ago[lldb] Hoist --server argument out of LLDB_TEST_COMMON_ARGS (NFC)
Jonas Devlieghere [Tue, 29 Sep 2020 20:26:09 +0000 (13:26 -0700)]
[lldb] Hoist --server argument out of LLDB_TEST_COMMON_ARGS (NFC)

Give the server argument its own variable (LLDB_TEST_SERVER) so that we
can configure it in lit.site.cfg.py if we so desire.

3 years ago[libc++] Fix some test failures in unusual configurations
Louis Dionne [Tue, 29 Sep 2020 20:21:20 +0000 (16:21 -0400)]
[libc++] Fix some test failures in unusual configurations

3 years agoFix TODO in the mlir-cpu-runner/bare_ptr_call_conv.mlir test: call ops in bare-ptr...
Mehdi Amini [Tue, 29 Sep 2020 20:19:23 +0000 (20:19 +0000)]
Fix TODO in the mlir-cpu-runner/bare_ptr_call_conv.mlir test: call ops in bare-ptr calling convention is supported now (NFC)

This was fixed in a89fc12653c.

3 years ago[trace] Fix destructor declaration
Walter Erquinigo [Tue, 29 Sep 2020 20:08:22 +0000 (13:08 -0700)]
[trace] Fix destructor declaration

The destructor must be defined in the implementation class so that it
can be called, as Vedant Kumar pointed out in:

'''
What were your thoughts, re:

+class Trace : public PluginInterface {
+public:
+  ~Trace() override = default;

   Does this need to be `virtual ~Trace() = ...`?

      Otherwise, when a std::shared_ptr<Trace> is destroyed, the
      destructor for the derived TraceIntelPT instance won't run.
'''

3 years ago[libc++][ci] Turn on Phabricator reporting by default
Louis Dionne [Thu, 24 Sep 2020 15:45:55 +0000 (11:45 -0400)]
[libc++][ci] Turn on Phabricator reporting by default

3 years ago[lldb/docs] Remove manual codesigning documentation
Dave Lee [Tue, 29 Sep 2020 19:50:38 +0000 (12:50 -0700)]
[lldb/docs] Remove manual codesigning documentation

The `macos-setup-codesign.sh` script has been in place for over two years. If there are no known issues, it's a good time to drop the manual steps from the docs.

Reviewed By: JDevlieghere

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

3 years ago[libc++][ci] Improve the phabricator-report script
Louis Dionne [Tue, 29 Sep 2020 19:29:11 +0000 (15:29 -0400)]
[libc++][ci] Improve the phabricator-report script

- Detect whether a build has passed more accurately
- Retry pushing the status to Phabricator
- Allow running on a non-review branch

3 years ago[libc++][ci] Add a script to describe when to trigger libc++ CI builds
Louis Dionne [Tue, 29 Sep 2020 19:30:42 +0000 (15:30 -0400)]
[libc++][ci] Add a script to describe when to trigger libc++ CI builds

3 years ago[InstCombine] ease alignment restriction for converting masked load to normal load
Sanjay Patel [Tue, 29 Sep 2020 19:25:04 +0000 (15:25 -0400)]
[InstCombine] ease alignment restriction for converting masked load to normal load

I think we initially made this fold conservative to be safer, but we do not
need the alignment attribute/metadata limitation because the masked load
intrinsic itself specifies the alignment. A normal vector load is better for
IR transforms and should be no worse in codegen than the masked alternative.
If it is worse for some target, the backend can reverse this transform.

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

3 years ago[mlir] Support return and call ops in bare-ptr calling convention
Diego Caballero [Tue, 29 Sep 2020 18:11:27 +0000 (11:11 -0700)]
[mlir] Support return and call ops in bare-ptr calling convention

This patch adds support for the 'return' and 'call' ops to the bare-ptr
calling convention. These changes also align the bare-ptr calling
convention code with the latest changes in the default calling convention
and reduce the amount of customization code needed.

Reviewed By: ftynse

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