Jordan Rupprecht [Wed, 30 Sep 2020 18:24:10 +0000 (11:24 -0700)]
[lldb-vscode] Allow an empty 'breakpoints' field to clear breakpoints.
Per the DAP spec for SetBreakpoints [1], the way to clear breakpoints is: `To clear all breakpoint for a source, specify an empty array.`
However, leaving the breakpoints field unset is also a well formed request (note the `breakpoints?:` in the `SetBreakpointsArguments` definition). If it's unset, we have a couple choices:
1. Crash (current behavior)
2. Clear breakpoints
3. Return an error response that the breakpoints field is missing.
I propose we do (2) instead of (1), and treat an unset breakpoints field the same as an empty breakpoints field.
[1] https://microsoft.github.io/debug-adapter-protocol/specification#Requests_SetBreakpoints
Reviewed By: wallace, labath
Differential Revision: https://reviews.llvm.org/D88513
Eugene Zhulenev [Tue, 29 Sep 2020 20:55:33 +0000 (13:55 -0700)]
[MLIR] Add async.value type to Async dialect
Return values from async regions as !async.value<...>.
Reviewed By: mehdi_amini, csigg
Differential Revision: https://reviews.llvm.org/D88510
Jordan Rupprecht [Wed, 30 Sep 2020 17:47:48 +0000 (10:47 -0700)]
[lldb/ipv6] Support running lldb tests in an ipv6-only environment.
When running in an ipv6-only environment where `AF_INET` sockets are not available, many lldb tests (mostly gdb remote tests) fail because things like `127.0.0.1` don't work there.
Use `localhost` instead of `127.0.0.1` whenever possible, or include a fallback of creating `AF_INET6` sockets when `AF_INET` fails.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D87333
Rahman Lavaee [Wed, 30 Sep 2020 17:37:00 +0000 (10:37 -0700)]
Exception support for basic block sections
This is part of the Propeller framework to do post link code layout optimizations. Please see the RFC here: https://groups.google.com/forum/#!msg/llvm-dev/ef3mKzAdJ7U/1shV64BYBAAJ and the detailed RFC doc here: https://github.com/google/llvm-propeller/blob/plo-dev/Propeller_RFC.pdf
This patch provides exception support for basic block sections by splitting the call-site table into call-site ranges corresponding to different basic block sections. Still all landing pads must reside in the same basic block section (which is guaranteed by the the core basic block section patch D73674 (ExceptionSection) ). Each call-site table will refer to the landing pad fragment by explicitly specifying @LPstart (which is omitted in the normal non-basic-block section case). All these call-site tables will share their action and type tables.
The C++ ABI somehow assumes that no landing pads point directly to LPStart (which works in the normal case since the function begin is never a landing pad), and uses LP.offset = 0 to specify no landing pad. In the case of basic block section where one section contains all the landing pads, the landing pad offset relative to LPStart could actually be zero. Thus, we avoid zero-offset landing pads by inserting a **nop** operation as the first non-CFI instruction in the exception section.
**Background on Exception Handling in C++ ABI**
https://github.com/itanium-cxx-abi/cxx-abi/blob/master/exceptions.pdf
Compiler emits an exception table for every function. When an exception is thrown, the stack unwinding library queries the unwind table (which includes the start and end of each function) to locate the exception table for that function.
The exception table includes a call site table for the function, which is used to guide the exception handling runtime to take the appropriate action upon an exception. Each call site record in this table is structured as follows:
| CallSite | --> Position of the call site (relative to the function entry)
| CallSite length | --> Length of the call site.
| Landing Pad | --> Position of the landing pad (relative to the landing pad fragment’s begin label)
| Action record offset | --> Position of the first action record
The call site records partition a function into different pieces and describe what action must be taken for each callsite. The callsite fields are relative to the start of the function (as captured in the unwind table).
The landing pad entry is a reference into the function and corresponds roughly to the catch block of a try/catch statement. When execution resumes at a landing pad, it receives an exception structure and a selector value corresponding to the type of the exception thrown, and executes similar to a switch-case statement. The landing pad field is relative to the beginning of the procedure fragment which includes all the landing pads (@LPStart). The C++ ABI requires all landing pads to be in the same fragment. Nonetheless, without basic block sections, @LPStart is the same as the function @Start (found in the unwind table) and can be omitted.
The action record offset is an index into the action table which includes information about which exception types are caught.
**C++ Exceptions with Basic Block Sections**
Basic block sections break the contiguity of a function fragment. Therefore, call sites must be specified relative to the beginning of the basic block section. Furthermore, the unwinding library should be able to find the corresponding callsites for each section. To do so, the .cfi_lsda directive for a section must point to the range of call-sites for that section.
This patch introduces a new **CallSiteRange** structure which specifies the range of call-sites which correspond to every section:
`struct CallSiteRange {
// Symbol marking the beginning of the precedure fragment.
MCSymbol *FragmentBeginLabel = nullptr;
// Symbol marking the end of the procedure fragment.
MCSymbol *FragmentEndLabel = nullptr;
// LSDA symbol for this call-site range.
MCSymbol *ExceptionLabel = nullptr;
// Index of the first call-site entry in the call-site table which
// belongs to this range.
size_t CallSiteBeginIdx = 0;
// Index just after the last call-site entry in the call-site table which
// belongs to this range.
size_t CallSiteEndIdx = 0;
// Whether this is the call-site range containing all the landing pads.
bool IsLPRange = false;
};`
With N basic-block-sections, the call-site table is partitioned into N call-site ranges.
Conceptually, we emit the call-site ranges for sections sequentially in the exception table as if each section has its own exception table. In the example below, two sections result in the two call site ranges (denoted by LSDA1 and LSDA2) placed next to each other. However, their call-sites will refer to records in the shared Action Table. We also emit the header fields (@LPStart and CallSite Table Length) for each call site range in order to place the call site ranges in separate LSDAs. We note that with -basic-block-sections, The CallSiteTableLength will not actually represent the length of the call site table, but rather the reference to the action table. Since the only purpose of this field is to locate the action table, correctness is guaranteed.
Finally, every call site range has one @LPStart pointer so the landing pads of each section must all reside in one section (not necessarily the same section). To make this easier, we decide to place all landing pads of the function in one section (hence the `IsLPRange` field in CallSiteRange).
| @LPStart | ---> Landing pad fragment ( LSDA1 points here)
| CallSite Table Length | ---> Used to find the action table.
| CallSites |
| … |
| … |
| @LPStart | ---> Landing pad fragment ( LSDA2 points here)
| CallSite Table Length |
| CallSites |
| … |
| … |
…
…
| Action Table |
| Types Table |
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D73739
David Tenty [Tue, 29 Sep 2020 15:30:28 +0000 (11:30 -0400)]
[AIX][Clang][Driver] Link libm in c++ mode
since that is the normal behaviour of other compilers on the platform.
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D88500
Joseph Huber [Mon, 28 Sep 2020 14:23:14 +0000 (10:23 -0400)]
[OpenMP] Replace OpenMP RTL Functions With OMPIRBuilder and OMPKinds.def
Summary:
Replace the OpenMP Runtime Library functions used in CGOpenMPRuntimeGPU
for OpenMP device code generation with ones in OMPKinds.def and use
OMPIRBuilder for generating runtime calls. This allows us to consolidate
more OpenMP code generation into the OMPIRBuilder. This patch also
invalidates specifying target architectures with conflicting pointer
sizes.
Reviewers: jdoerfert
Subscribers: aaron.ballman cfe-commits guansong llvm-commits sstefan1 yaxunl
Tags: #OpenMP #Clang #LLVM
Differential Revision: https://reviews.llvm.org/D88430
Joseph Huber [Wed, 30 Sep 2020 17:10:32 +0000 (13:10 -0400)]
[OpenMP] Add Error Handling for Conflicting Pointer Sizes for Target Offload
Summary:
This patch adds an error to Clang that detects if OpenMP offloading is used
between two architectures with incompatible pointer sizes. This ensures that
the data mapping can be done correctly and solves an issue in code generation
generating the wrong size pointer.
Reviewer: jdoerfert
Subscribers:
Tags: #OpenMP #Clang
Differential Revision:
Richard Smith [Wed, 30 Sep 2020 17:48:00 +0000 (10:48 -0700)]
Fix interaction of `constinit` and `weak`.
We previously took a shortcut and said that weak variables never have
constant initializers (because those initializers are never correct to
use outside the variable). We now say that weak variables can have
constant initializers, but are never usable in constant expressions.
Alexandre Rames [Wed, 30 Sep 2020 17:11:14 +0000 (18:11 +0100)]
[Sema] Support Comma operator for fp16 vectors.
The current half vector was enforcing an assert expecting
"(LHS is half vector) == (RHS is half vector)"
for comma.
Reviewed By: ahatanak, fhahn
Differential Revision: https://reviews.llvm.org/D88265
Sanjay Patel [Wed, 30 Sep 2020 17:18:42 +0000 (13:18 -0400)]
[CodeGen] add test for NAN creation; NFC
This goes with the APFloat change proposed in
D88238.
This is copied from the MIPS-specific test in
builtin-nan-legacy.c to verify that the normal
behavior is correct on other targets without the
complication of an inverted quiet bit.
Congzhe Cao [Wed, 30 Sep 2020 17:03:14 +0000 (13:03 -0400)]
[AArch64] Avoid pairing loads when the base reg is modified
When pairing loads, we should check if in between the two loads the
base register has been modified. If that is the case then avoid pairing
them because the second load actually loads from a different address.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D86956
Rainer Orth [Wed, 30 Sep 2020 16:56:52 +0000 (18:56 +0200)]
[asan][test] Several Posix/unpoison-alternate-stack.cpp fixes
`Posix/unpoison-alternate-stack.cpp` currently `FAIL`s on Solaris/i386.
Some of the problems are generic:
- `clang` warns compiling the testcase:
compiler-rt/test/asan/TestCases/Posix/unpoison-alternate-stack.cpp:83:7: warning: nested designators are a C99 extension [-Wc99-designator]
.sa_sigaction = signalHandler,
^~~~~~~~~~~~~
compiler-rt/test/asan/TestCases/Posix/unpoison-alternate-stack.cpp:84:7: warning: ISO C++ requires field designators to be specified in declaration order; field '_funcptr' will be initialized after field 'sa_flags' [-Wreorder-init-list]
.sa_flags = SA_SIGINFO | SA_NODEFER | SA_ONSTACK,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and some more instances. This can all easily be avoided by initializing
each field separately.
- The test `SEGV`s in `__asan_memcpy`. The default Solaris/i386 stack size
is only 4 kB, while `__asan_memcpy` tries to allocate either 5436
(32-bit) or 10688 bytes (64-bit) on the stack. This patch avoids this by
requiring at least 16 kB stack size.
- Even without `-fsanitize=address` I get an assertion failure:
Assertion failed: !isOnSignalStack(), file compiler-rt/test/asan/TestCases/Posix/unpoison-alternate-stack.cpp, line 117
The fundamental problem with this testcase is that `longjmp` from a
signal handler is highly unportable; XPG7 strongly warns against it and
it is thus unspecified which stack is used when `longjmp`ing from a
signal handler running on an alternative stack.
So I'm `XFAIL`ing this testcase on Solaris.
Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
Differential Revision: https://reviews.llvm.org/D88501
Arthur Eubanks [Wed, 30 Sep 2020 16:42:49 +0000 (09:42 -0700)]
[test][SampleProfile][NewPM] Fix some tests under NPM
Peter Collingbourne [Fri, 25 Sep 2020 00:01:24 +0000 (17:01 -0700)]
scudo: Make it thread-safe to set some runtime configuration flags.
Move some of the flags previously in Options, as well as the
UseMemoryTagging flag previously in the primary allocator, into an
atomic variable so that it can be updated while other threads are
running. Relaxed accesses are used because we only have the requirement
that the other threads see the new value eventually.
The code is set up so that the variable is generally loaded once per
allocation function call with the exception of some rarely used code
such as error handlers. The flag bits can generally stay in a register
during the execution of the allocation function which means that they
can be branched on with minimal overhead (e.g. TBZ on aarch64).
Differential Revision: https://reviews.llvm.org/D88523
Vy Nguyen [Tue, 4 Aug 2020 22:34:22 +0000 (18:34 -0400)]
[llvm-exegesis] Add option to check the hardware support for a given feature before benchmarking.
This is mostly for the benefit of the LBR latency mode.
Right now, it performs no checking. If this is run on non-supported hardware, it will produce all zeroes for latency.
Differential Revision: https://reviews.llvm.org/D85254
Valentin Clement [Wed, 30 Sep 2020 16:23:06 +0000 (12:23 -0400)]
[mlir][openacc] Remove -allow-unregistred-dialect from ops and invalid tests
Switch to a dummy op in the test dialect so we can remove the -allow-unregistred-dialect
on ops.mlir and invalid.mlir. Change after comment on D88272.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D88587
Arthur Eubanks [Sat, 26 Sep 2020 07:18:42 +0000 (00:18 -0700)]
[ObjCARCAA][NewPM] Add already ported objc-arc-aa to PassRegistry.def
Also add missing AnalysisKey definition.
Kazushi (Jam) Marukawa [Mon, 21 Sep 2020 08:15:26 +0000 (17:15 +0900)]
[VE] Support TargetBlockAddress
Change to handle TargetBlockAddress and add a regression test for it.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D88576
Simon Moll [Wed, 30 Sep 2020 15:10:44 +0000 (17:10 +0200)]
[DA][SDA] SyncDependenceAnalysis re-write
This patch achieves two things:
1. It breaks up the `join_blocks` interface between the SDA to the DA to
return two separate sets for divergent loops exits and divergent,
disjoint path joins.
2. It updates the SDA algorithm to run in O(n) time and improves the
precision on divergent loop exits.
This fixes `https://bugs.llvm.org/show_bug.cgi?id=46372` (by virtue of
the improved `join_blocks` interface) and revealed an imprecise expected
result in the `Analysis/DivergenceAnalysis/AMDGPU/hidden_loopdiverge.ll`
test.
Reviewed By: sameerds
Differential Revision: https://reviews.llvm.org/D84413
Mircea Trofin [Tue, 29 Sep 2020 16:09:25 +0000 (09:09 -0700)]
[NFC][regalloc] Make VirtRegAuxInfo part of allocator state
All the state of VRAI is allocator-wide, so we can avoid creating it
every time we need it. In addition, the normalization function is
allocator-specific. In a next change, we can simplify that design in
favor of just having it as a virtual member.
Differential Revision: https://reviews.llvm.org/D88499
Simon Pilgrim [Wed, 30 Sep 2020 15:08:52 +0000 (16:08 +0100)]
[InstCombine] Add tests for 'partial' bswap patterns
As mentioned on PR47191, if we're bswap'ing some bytes and the zero'ing the remainder we can perform this as a bswap+mask which helps us match 'partial' bswaps as a first step towards folding into a more complex bswap pattern.
Zarko Todorovski [Wed, 30 Sep 2020 15:03:03 +0000 (11:03 -0400)]
[PPC] Do not emit extswsli in 32BIT mode when using -mcpu=pwr9
It looks like in some circumstances when compiling with `-mcpu=pwr9` we create an EXTSWSLI node when which causes llc to fail. No such error occurs in pwr8 or lower.
This occurs in 32BIT AIX and BE Linux. the cause seems to be that the default return in combineSHL is to create an EXTSWSLI node. Adding a check for whether we are in PPC64 before that fixes the issue.
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D87046
Benjamin Kramer [Wed, 30 Sep 2020 15:01:14 +0000 (17:01 +0200)]
[PowerPC] Avoid unused variable warning in Release builds
PPCFrameLowering.cpp:632:8: warning: unused variable 'isAIXABI' [-Wunused-variable]
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.
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
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
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
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
Matt Arsenault [Sat, 26 Sep 2020 14:14:14 +0000 (10:14 -0400)]
GlobalISel: Assert if MoreElements uses a non-vector type
Matt Arsenault [Tue, 22 Sep 2020 15:46:41 +0000 (11:46 -0400)]
LiveDebugValues: Fix typos and indentation
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.
Matt Arsenault [Tue, 22 Sep 2020 12:55:54 +0000 (08:55 -0400)]
Reapply "RegAllocFast: Rewrite and improve"
This reverts commit
73a6a164b84a8195defbb8f5eeb6faecfc478ad4.
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
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
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
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
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.
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
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.
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
Simon Pilgrim [Wed, 30 Sep 2020 13:36:12 +0000 (14:36 +0100)]
[InstCombine] recognizeBSwapOrBitReverseIdiom - remove unnecessary cast. NFCI.
Michał Górny [Wed, 30 Sep 2020 12:53:05 +0000 (14:53 +0200)]
[lldb] [Process/NetBSD] Fix operating on ftag register
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.
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
Simon Pilgrim [Wed, 30 Sep 2020 13:19:00 +0000 (14:19 +0100)]
[InstCombine] Add PR47191 bswap tests
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).
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
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
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.
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
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
Sam Parker [Wed, 30 Sep 2020 11:14:39 +0000 (12:14 +0100)]
[NFC][ARM] Add more LowOverheadLoop tests.
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
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
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
LLVM GN Syncbot [Wed, 30 Sep 2020 10:09:34 +0000 (10:09 +0000)]
[gn build] Port
413577a8790
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
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
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
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
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
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
Sam McCall [Wed, 30 Sep 2020 09:02:05 +0000 (11:02 +0200)]
[clangd] Fix fuzzer build after
7ba0779fbb41b6fa8
Sam McCall [Wed, 30 Sep 2020 08:56:43 +0000 (10:56 +0200)]
[clangd] Fix member/type name conflict caught by buildbots.
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.
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
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
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
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.
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
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
Sam Parker [Wed, 30 Sep 2020 07:36:48 +0000 (08:36 +0100)]
[NFC][ARM] Add LowOverheadLoop test
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
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
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.
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.
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
Arthur Eubanks [Wed, 30 Sep 2020 03:12:00 +0000 (20:12 -0700)]
[gn build] Add missing dependency to Extensions
Brad Smith [Wed, 30 Sep 2020 02:17:12 +0000 (22:17 -0400)]
Remove further OpenBSD/sparc bits
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
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
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
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.
Yaxun (Sam) Liu [Tue, 29 Sep 2020 12:51:26 +0000 (08:51 -0400)]
Add remquo, frexp and modf overload functions to HIP header
Vedant Kumar [Wed, 30 Sep 2020 00:37:36 +0000 (17:37 -0700)]
[gardening] Replace some uses of setDebugLoc(DebugLoc()) with dropLocation(), 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.
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
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.
Vitaly Buka [Tue, 29 Sep 2020 21:38:56 +0000 (14:38 -0700)]
[NFC][MSAN] Remove an attribute in test
Vedant Kumar [Wed, 30 Sep 2020 00:07:06 +0000 (17:07 -0700)]
[docs] Recommend dropLocation() over setDebugLoc(DebugLoc())
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
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.
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.
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.
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.
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
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
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
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
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