Matt Arsenault [Wed, 8 Jan 2020 17:53:15 +0000 (12:53 -0500)]
TableGen/GlobalISel: Add way for SDNodeXForm to work on timm
The current implementation assumes there is an instruction associated
with the transform, but this is not the case for
timm/TargetConstant/immarg values. These transforms should directly
operate on a specific MachineOperand in the source
instruction. TableGen would assert if you attempted to define an
equivalent GISDNodeXFormEquiv using timm when it failed to find the
instruction matcher.
Specially recognize SDNodeXForms on timm, and pass the operand index
to the render function.
Ideally this would be a separate render function type that looks like
void renderFoo(MachineInstrBuilder, const MachineOperand&), but this
proved to be somewhat mechanically painful. Add an optional operand
index which will only be passed if the transform should only look at
the one source operand.
Theoretically it would also be possible to only ever pass the
MachineOperand, and the existing renderers would check the parent. I
think that would be somewhat ugly for the standard usage which may
want to inspect other operands, and I also think MachineOperand should
eventually not carry a pointer to the parent instruction.
Use it in one sample pattern. This isn't a great example, since the
transform exists to satisfy DAG type constraints. This could also be
avoided by just changing the MachineInstr's arbitrary choice of
operand type from i16 to i32. Other patterns have nontrivial uses, but
this serves as the simplest example.
One flaw this still has is if you try to use an SDNodeXForm defined
for imm, but the source pattern uses timm, you still see the "Failed
to lookup instruction" assert. However, there is now a way to avoid
it.
Matt Arsenault [Sat, 28 Dec 2019 00:26:51 +0000 (19:26 -0500)]
GlobalISel: Handle llvm.read_register
Compared to the attempt in
bdcc6d3d2638b3a2c99ab3b9bfaa9c02e584993a,
this uses intermediate generic instructions.
Matt Arsenault [Thu, 9 Jan 2020 16:39:02 +0000 (11:39 -0500)]
DAG: Don't use unchecked dyn_cast
Matt Arsenault [Thu, 9 Jan 2020 16:03:17 +0000 (11:03 -0500)]
GlobalISel: Fix else after return
Matt Arsenault [Sat, 28 Dec 2019 14:18:56 +0000 (09:18 -0500)]
CodeGen: Use LLT instead of EVT in getRegisterByName
Only PPC seems to be using it, and only checks some simple cases and
doesn't distinguish between FP. Just switch to using LLT to simplify
use from GlobalISel.
Amara Emerson [Wed, 8 Jan 2020 23:16:55 +0000 (15:16 -0800)]
[AArch64][GlobalISel] Implement selection of <2 x float> vector splat.
Also requires making G_IMPLICIT_DEF of v2s32 legal.
Differential Revision: https://reviews.llvm.org/D72422
Eric Schweitz [Thu, 9 Jan 2020 21:59:51 +0000 (22:59 +0100)]
[mlir] add a missing dependency for Linalg conversion
We were seeing some occasional build failures that would come and go.
It appeared to be this missing dependence.
Differential Revision: https://reviews.llvm.org/D72419
Kern Handa [Thu, 9 Jan 2020 21:55:31 +0000 (22:55 +0100)]
[mlir] mlir-cpu-runner test's cblas_interface should export functions on Windows
This change fixes the build on Windows, so that cblas_interface.dll
exports functions correctly and an implib is created and installed
correctly.
Currently, LLVM cannot be consumed on Windows after it has been
installed in a location because cblas_interface.lib is not
created/installed, thus failing the import check in `LLVMExports.cmake`.
Differential Revision: https://reviews.llvm.org/D72384
Alex Richardson [Thu, 9 Jan 2020 20:48:06 +0000 (20:48 +0000)]
Add builtins for aligning and checking alignment of pointers and integers
This change introduces three new builtins (which work on both pointers
and integers) that can be used instead of common bitwise arithmetic:
__builtin_align_up(x, alignment), __builtin_align_down(x, alignment) and
__builtin_is_aligned(x, alignment).
I originally added these builtins to the CHERI fork of LLVM a few years ago
to handle the slightly different C semantics that we use for CHERI [1].
Until recently these builtins (or sequences of other builtins) were
required to generate correct code. I have since made changes to the default
C semantics so that they are no longer strictly necessary (but using them
does generate slightly more efficient code). However, based on our experience
using them in various projects over the past few years, I believe that adding
these builtins to clang would be useful.
These builtins have the following benefit over bit-manipulation and casts
via uintptr_t:
- The named builtins clearly convey the semantics of the operation. While
checking alignment using __builtin_is_aligned(x, 16) versus
((x & 15) == 0) is probably not a huge win in readably, I personally find
__builtin_align_up(x, N) a lot easier to read than (x+(N-1))&~(N-1).
- They preserve the type of the argument (including const qualifiers). When
using casts via uintptr_t, it is easy to cast to the wrong type or strip
qualifiers such as const.
- If the alignment argument is a constant value, clang can check that it is
a power-of-two and within the range of the type. Since the semantics of
these builtins is well defined compared to arbitrary bit-manipulation,
it is possible to add a UBSAN checker that the run-time value is a valid
power-of-two. I intend to add this as a follow-up to this change.
- The builtins avoids int-to-pointer casts both in C and LLVM IR.
In the future (i.e. once most optimizations handle it), we could use the new
llvm.ptrmask intrinsic to avoid the ptrtoint instruction that would normally
be generated.
- They can be used to round up/down to the next aligned value for both
integers and pointers without requiring two separate macros.
- In many projects the alignment operations are already wrapped in macros (e.g.
roundup2 and rounddown2 in FreeBSD), so by replacing the macro implementation
with a builtin call, we get improved diagnostics for many call-sites while
only having to change a few lines.
- Finally, the builtins also emit assume_aligned metadata when used on pointers.
This can improve code generation compared to the uintptr_t casts.
[1] In our CHERI compiler we have compilation mode where all pointers are
implemented as capabilities (essentially unforgeable 128-bit fat pointers).
In our original model, casts from uintptr_t (which is a 128-bit capability)
to an integer value returned the "offset" of the capability (i.e. the
difference between the virtual address and the base of the allocation).
This causes problems for cases such as checking the alignment: for example, the
expression `if ((uintptr_t)ptr & 63) == 0` is generally used to check if the
pointer is aligned to a multiple of 64 bytes. The problem with offsets is that
any pointer to the beginning of an allocation will have an offset of zero, so
this check always succeeds in that case (even if the address is not correctly
aligned). The same issues also exist when aligning up or down. Using the
alignment builtins ensures that the address is used instead of the offset. While
I have since changed the default C semantics to return the address instead of
the offset when casting, this offset compilation mode can still be used by
passing a command-line flag.
Reviewers: rsmith, aaron.ballman, theraven, fhahn, lebedev.ri, nlopes, aqjune
Reviewed By: aaron.ballman, lebedev.ri
Differential Revision: https://reviews.llvm.org/D71499
Christian Sigg [Tue, 7 Jan 2020 10:01:29 +0000 (11:01 +0100)]
Add gdb pretty printer for MutableArrayRef, remove ConstArrayRef.
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: merge_guards_bot, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72136
Matt Arsenault [Thu, 9 Jan 2020 15:56:35 +0000 (10:56 -0500)]
GlobalISel: Move getLLTForMVT/getMVTForLLT
As an intermediate step, some TLI functions can be converted to using
LLT instead of MVT. Move this somewhere out of GlobalISel so DAG
functions can use these.
Matt Arsenault [Thu, 9 Jan 2020 00:49:30 +0000 (19:49 -0500)]
TableGen/GlobalISel: Address fixme
Don't call computeAvailableFunctionFeatures for every instruction.
Matt Arsenault [Thu, 9 Jan 2020 17:54:16 +0000 (12:54 -0500)]
GlobalISel: Don't assert on MoreElements creating vectors
If the original type was a scalar, it should be valid to add elements
to turn it into a vector.
Tests included with following legalization change.
Matt Arsenault [Fri, 3 Jan 2020 18:33:36 +0000 (13:33 -0500)]
AMDGPU/GlobalISel: Fix argument lowering for vectors of pointers
When these arguments are broken down by the EVT based callbacks, the
pointer information is lost. Hack around this by coercing the register
types to be the expected pointer element type when building the
remerge operations.
Matt Arsenault [Thu, 9 Jan 2020 19:34:43 +0000 (14:34 -0500)]
AMDGPU/GlobalISel: Widen 16-bit shift amount sources
This should be legal, but will require future selection work. 16-bit
shift amounts were already removed from being legal, but this didn't
adjust the transformation rules.
Sylvestre Ledru [Thu, 9 Jan 2020 21:28:45 +0000 (22:28 +0100)]
phab doc: Replace or remove references to svn
Sylvestre Ledru [Thu, 9 Jan 2020 21:16:52 +0000 (22:16 +0100)]
phab doc: also document 'arc land'
Sylvestre Ledru [Thu, 9 Jan 2020 21:12:30 +0000 (22:12 +0100)]
phab doc: remove the svn section
Nathan Ridge [Thu, 2 Jan 2020 05:45:01 +0000 (00:45 -0500)]
[clangd] Handle DeducedTemplateSpecializationType in TargetFinder
Summary:
This is a workaround for https://bugs.llvm.org/show_bug.cgi?id=42914.
Once that is fixed, the handling in VisitDeducedTyped() should be sufficient.
Fixes https://github.com/clangd/clangd/issues/242
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72119
Sylvestre Ledru [Wed, 8 Jan 2020 23:26:34 +0000 (00:26 +0100)]
[clang-tidy] Refresh the add_new_check.py now that we use a table + autofix
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: njames93, xazax.hun, mgorny, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D72421
Eric Fiselier [Thu, 9 Jan 2020 20:50:55 +0000 (15:50 -0500)]
[libc++] Explicitly enumerate std::string external instantiations.
The external instantiation of std::string is a problem for libc++.
Additions and removals of inline functions in string can cause ABI
breakages, including introducing new symbols.
This patch aims to:
(1) Make clear which functions are explicitly instatiated.
(2) Prevent new functions from being accidentally instantiated.
(3) Allow a migration path for adding or removing functions from the
explicit instantiation over time.
Although this new formulation is uglier, it is preferable from a
maintainability and readability standpoint because it explicitly
enumerates the functions we've chosen to expose in our ABI. Changing
this list is non-trivial and requires thought and planning.
(3) is achieved by making it possible to control the extern template declaration
separately from it's definition. Meaning we could add a new definition to
the dylib, wait for it to roll out, then add the extern template
declaration to the header. Similarly, we could remove existing extern
template declarations while still keeping the definition to prevent ABI
breakages.
River Riddle [Thu, 9 Jan 2020 20:39:26 +0000 (12:39 -0800)]
[mlir] NFC: Move the state for managing SSA value names out of OperationPrinter and into a new class SSANameState.
Summary:
This reduces the complexity of OperationPrinter and simplifies the code by quite a bit. The SSANameState is now held by ModuleState. This is in preparation for a future revision that molds ModuleState into something that can be used by users for caching the printer state, as well as for implementing printAsOperand style methods.
Depends On D72292
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D72293
Alex Richardson [Tue, 7 Jan 2020 12:31:18 +0000 (12:31 +0000)]
MipsDelaySlotFiller: Update registers def-uses for BUNDLE instructions
Summary:
In commit
b91f239485fb7bb8d29be3e0b60660a2de7570a9 I updated the
MipsDelaySlotFiller to skip BUNDLE instructions.
However, in addition to not considering BUNDLE instructions for the delay
slot, we also need to ensure that the register def-use information is
updated. Not updating this information caused run-time crashes (when using
the out-of-tree CHERI backend) since later definitions could be overwritten
with earlier register values.
Reviewers: atanasyan
Reviewed By: atanasyan
Differential Revision: https://reviews.llvm.org/D72254
Alex Richardson [Tue, 7 Jan 2020 12:29:47 +0000 (12:29 +0000)]
Re-apply "[ELF] Allow getErrPlace() to work before Out::bufferStart is set"
This time with a fix for the UBSAN failure.
Differential Revision: https://reviews.llvm.org/D70659
Craig Topper [Thu, 9 Jan 2020 19:55:22 +0000 (11:55 -0800)]
[X86] Add ueq/one fp128 quiet compare tests. NFC
The ONE expansion calls OGT/OLT libcalls which will signal for QNAN.
The UEQ expansion uses unord and eq libcalls which won't signal.
We should probably use those libcalls for ONE with appropriate
logic.
Quiet OGT/OLT/OLE/OGE have similar issue, but not sure how to fix
those yet.
Jessica Paquette [Wed, 8 Jan 2020 18:57:44 +0000 (10:57 -0800)]
[GlobalISel][AArch64] Import + select LDR*roW and STR*roW patterns
This adds support for selecting a large chunk of the load/store *roW patterns.
This is pretty much a straight port of AArch64DAGToDAGISel::SelectAddrModeWRO
into GISel. The code is very similar to the XRO code. The main difference is
that in the *roW patterns, we want to try and fold in an extend, and *possibly*
a shift along with it. A good portion of this patch is refactoring the existing
XRO code.
- Add selectAddrModeWRO
- Factor out the code from selectAddrModeShiftedExtendXReg which is used by both
selectAddrModeXRO and selectAddrModeWRO into selectExtendedSHL.
This is similar to the function of the same name in AArch64DAGToDAGISel.
- Add support for extends to the factored out code in selectExtendedSHL.
- Teach getExtendTypeForInst how to handle AND masks that are intended to be
used in loads/stores (necessary for this addressing mode.)
- Make getExtendTypeForInst not static because moving it made an annoying diff
and I wanted to have the WRO/XRO functions close to each other while I was
writing the code.
Differential Revision: https://reviews.llvm.org/D72426
serge-sans-paille [Thu, 9 Jan 2020 20:01:29 +0000 (21:01 +0100)]
[clang] Enforce triple in mempcpy test
Fixes http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/2597
Eric Astor [Thu, 9 Jan 2020 19:01:55 +0000 (14:01 -0500)]
[ms] [X86] Use "P" modifier on all branch-target operands in inline X86 assembly.
Summary:
Extend D71677 to apply to all branch-target operands, rather than special-casing call instructions.
Also add a regression test for llvm.org/PR44272, since this finishes fixing it.
Reviewers: thakis, rnk
Reviewed By: thakis
Subscribers: merge_guards_bot, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D72417
Ganesh Gopalasubramanian [Thu, 9 Jan 2020 14:41:32 +0000 (20:11 +0530)]
[X86] AMD Znver2 (Rome) Scheduler enablement
The patch gives out the details of the znver2 scheduler model.
There are few improvements with respect to execution units, latencies and
throughput when compared with znver1.
The tests that were present for znver1 for llvm-mca tool were replicated.
The latencies, execution units, timeline and throughput information are updated for znver2.
Reviewers: craig.topper, Simon Pilgrim
Differential Revision: https://reviews.llvm.org/D66088
Sean Fertile [Wed, 8 Jan 2020 17:32:32 +0000 (12:32 -0500)]
[PowerPC] The VK_PLT symbolref modifier is only used on 32-bit ELF. [NFC]
Fix a conditional that guarded code for execution only on 32-bit ELF by
checking that the Subtarget was not 64-bit and not-Darwin. By adding a new
target ABI (AIX), the condition is no longer correct. This code is dead for
AIX, due to a 'report_fatal_error' for thread local storage usage earlier in the
pipeline, but needs to be modifed as part of Darwins removal from the
PowerPC backend.
Erik Pilkington [Thu, 9 Jan 2020 18:24:09 +0000 (10:24 -0800)]
[demangle] Copy back some NFC commits from LLVM
Craig Topper [Thu, 9 Jan 2020 00:12:31 +0000 (16:12 -0800)]
[TargetLowering][X86] TeachSimplifyDemandedBits to handle cases where only the sign bit is demanded from a SETCC and can be passed through
If we're doing a compare that only tests the sign bit and only the sign bit is demanded, we can just bypass the node. This removes one of the blend dependencies in our v2i64->v2f32 uint_to_fp codegen on pre-sse4.2 targets.
Differential Revision: https://reviews.llvm.org/D72356
Bruno Ricci [Thu, 9 Jan 2020 18:14:05 +0000 (18:14 +0000)]
[Support][NFC] Add an explicit unit test for Process::getPageSize()
It turns out that it was only tested indirectly. For now test only on Linux
X86-64 and aarch64.
Sanjay Patel [Thu, 9 Jan 2020 18:06:54 +0000 (13:06 -0500)]
[x86] add tests for 2-way splat copy; NFC
Based on code in PR42024:
https://bugs.llvm.org/show_bug.cgi?id=42024
Ulrich Weigand [Thu, 9 Jan 2020 18:03:16 +0000 (19:03 +0100)]
[SystemZ] Fix matching another pattern for nxgrk (PR44496)
SystemZDAGToDAGISel::Select will attempt to split logical instruction
with a large immediate constant. This must not happen if the result
matches one of the z15 combined operations, so the code checks for
those. However, one of them was missed, causing invalid code to
be generated in the test case for PR44496.
Jonas Devlieghere [Thu, 9 Jan 2020 17:54:46 +0000 (09:54 -0800)]
[lldb/SWIG] Undo incorrect substitution
The Python directory for the script interpreter is still capitalized.
Bruno Ricci [Thu, 9 Jan 2020 17:38:50 +0000 (17:38 +0000)]
[Support][NFC] Make some helper functions "static" in Memory.inc
Simon Moll [Thu, 9 Jan 2020 17:37:08 +0000 (18:37 +0100)]
[NFC,format] Sort switch cases alphabetically
This patch brings the switch cases of `llvm/lib/Support/Triple.cpp` back into alphabetical order.
This was noted during the the review of https://reviews.llvm.org/D69103
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D72452
Bruno Ricci [Thu, 9 Jan 2020 17:11:29 +0000 (17:11 +0000)]
[Support][NFC] Add a comment about the semantics of MF_HUGE_HINT flag
Simon Tatham [Thu, 9 Jan 2020 17:01:13 +0000 (17:01 +0000)]
[Clang] Handle target-specific builtins returning aggregates.
Summary:
A few of the ARM MVE builtins directly return a structure type. This
causes an assertion failure at code-gen time if you try to assign the
result of the builtin to a variable, because the `RValue` created in
`EmitBuiltinExpr` from the `llvm::Value` produced by codegen is always
made by `RValue::get()`, which creates a non-aggregate `RValue` that
will fail an assertion when `AggExprEmitter::withReturnValueSlot` calls
`Src.getAggregatePointer()`. A similar failure occurs if you try to use
the struct return value directly to extract one field, e.g.
`vld2q(address).val[0]`.
The existing code-gen tests for those MVE builtins pass the returned
structure type directly to the C `return` statement, which apparently
managed to avoid that particular code path, so we didn't notice the
crash.
Now `EmitBuiltinExpr` checks the evaluation kind of the builtin's return
value, and does the necessary handling for aggregate returns. I've added
two extra test cases, both of which crashed before this change.
Reviewers: dmgreen, rjmccall
Reviewed By: rjmccall
Subscribers: kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72271
Jonas Devlieghere [Thu, 9 Jan 2020 17:22:04 +0000 (09:22 -0800)]
[lldb/SWIG] Fix capitalization for case sensitive file systems.
When moving the Python directory I renamed it to python (lowercase) but
didn't update the python.swig file.
Kadir Cetinkaya [Thu, 9 Jan 2020 15:54:22 +0000 (16:54 +0100)]
[clangd] Adjust diagnostic range to be inside main file
Summary:
LSP requires diagnostics to lay inside main file. In clangd we keep
diagnostics in three different cases:
- already in main file
- adjusted to a header included in main file
- has a note covering some range in main file
In the last case, we were not adjusting the diagnostics range to be in main
file, therefore these diagnostics ended up pointing some arbitrary locations.
This patch fixes that issue by adjusting the range of diagnostics to be the
first note inside main file when converting to LSP.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72458
Jonas Devlieghere [Thu, 9 Jan 2020 15:57:59 +0000 (07:57 -0800)]
[lldb/Bindings] Move bindings into their own subdirectory
All the code required to generate the language bindings for Python and
Lua lives under scripts, even though the majority of this code aren't
scripts at all, and surrounded by scripts that are totally unrelated.
I've reorganized these files and moved everything related to the
language bindings into a new top-level directory named bindings. This
makes the corresponding files self contained and much more discoverable.
Differential revision: https://reviews.llvm.org/D72437
Sven van Haastregt [Thu, 9 Jan 2020 16:31:45 +0000 (16:31 +0000)]
[OpenCL][Docs] Rename C++ for OpenCL label
To avoid potential confusion with OpenCL C++.
serge-sans-paille [Wed, 11 Dec 2019 20:30:10 +0000 (21:30 +0100)]
Improve support of GNU mempcpy
- Lower to the memcpy intrinsic
- Raise warnings when size/bounds are known
Differential Revision: https://reviews.llvm.org/D71374
Whitney Tsang [Thu, 9 Jan 2020 16:15:53 +0000 (16:15 +0000)]
[NFCI][LoopUnrollAndJam] Changing LoopUnrollAndJamPass to a function
pass.
Summary: This patch changes LoopUnrollAndJamPass to a function pass, and
keeps the loops traversal order same as defined in
FunctionToLoopPassAdaptor LoopPassManager.h.
The next patch will change the loop traversal to outer to inner order,
so more loops can be transform.
Discussion in llvm-dev mailing list:
https://groups.google.com/forum/#!topic/llvm-dev/LF4rUjkVI2g
Reviewer: dmgreen, jdoerfert, Meinersbur, kbarton, bmahjour, etiotto
Reviewed By: dmgreen
Subscribers: hiraditya, zzheng, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D72230
Jonas Devlieghere [Thu, 9 Jan 2020 16:15:01 +0000 (08:15 -0800)]
[lldb/Lua] Make lldb.debugger et al available to Lua
The Python script interpreter makes the current debugger, target,
process, thread and frame available to interactive scripting sessions
through convenience variables. This patch does the same for Lua.
Differential revision: https://reviews.llvm.org/D71801
Jonas Devlieghere [Thu, 9 Jan 2020 16:13:25 +0000 (08:13 -0800)]
[lldb/SWIG] Add missing '\' in macros again
Making the string conversion operator a macro unintentionally dropped
the backslash before '\n' and '\r' and was therefore incorrectly
stripping 'n' and 'r' from the object description.
David Goldman [Wed, 8 Jan 2020 22:01:59 +0000 (17:01 -0500)]
[clangd] Respect `--sysroot` argument if it is set
Summary:
- Since `--sysroot` is a superset of the `-isysroot` argument, we
shouldn't add the `-isysroot` if we detect a `--sysroot` flag.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72415
Sergej Jaskiewicz [Thu, 26 Dec 2019 09:28:39 +0000 (12:28 +0300)]
[libcxxabi] Allow tests to link with static libc++abi/libc++ even if the shared version is present
Summary:
Right now the only way to force libc++abi tests to link with the static version of libc++abi is to set `LIBCXXABI_ENABLE_SHARED` to `OFF`. However, this doesn't work when libc++abi is built as standalone project because of [this](https://github.com/llvm/llvm-project/blob/
54c522420347e58aa7bae1892cf5c5672b57c875/libcxxabi/CMakeLists.txt#L503-L519).
This change allows specifying the version of the library for tests to link with.
This is useful for remote testing, for example, with `SSHExecutor`, where we _have_ to link with libc++abi statically.
Two new CMake options are introduced here: `LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI` and `LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX`. They can be set to `OFF` to tell the test utility to link tests with the static libraries.
It shouldn't break anything, because the default values of these options are set such that the test utility will behave the same way.
Reviewers: EricWF, mclow.lists, phosek, mehdi_amini, ldionne, jroelofs, bcraig
Subscribers: mgorny, christof, ldionne, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D71894
@raghesh (Raghesh Aloor) [Thu, 9 Jan 2020 15:52:39 +0000 (10:52 -0500)]
[InstCombine] Z / (1.0 / Y) => (Y * Z)
This is a special case of Z / (X / Y) => (Y * Z) / X, with X = 1.0.
The m_OneUse check is avoided because even in the case of the
multiple uses for 1.0/Y, the number of instructions remain the same
and a division is replaced by a multiplication.
Differential Revision: https://reviews.llvm.org/D72319
Sid Manning [Thu, 2 Jan 2020 18:54:59 +0000 (12:54 -0600)]
[ELF][Hexagon] Add support for IE relocations
Differential Revision: https://reviews.llvm.org/D71143
Matt Arsenault [Wed, 8 Jan 2020 15:53:22 +0000 (10:53 -0500)]
TableGen: Remove unused code
Matt Arsenault [Wed, 8 Jan 2020 01:22:06 +0000 (20:22 -0500)]
AMDGPU/GlobalISel: Fix import of integer med3
This isn't too useful now, since nothing is currently trying to form
min/max from cmp+select.
Matt Arsenault [Tue, 7 Jan 2020 23:52:18 +0000 (18:52 -0500)]
AMDGPU: Eliminate more legacy codepred address space PatFrags
These should now be limited to R600 code.
Matt Arsenault [Tue, 7 Jan 2020 22:46:52 +0000 (17:46 -0500)]
AMDGPU: Use new PatFrag system for d16 stores
Matt Arsenault [Tue, 7 Jan 2020 21:48:05 +0000 (16:48 -0500)]
AMDGPU: Use new PatFrag system for d16 load nodes
Matt Arsenault [Tue, 7 Jan 2020 18:10:08 +0000 (13:10 -0500)]
AMDGPU/GlobalISel: Fix import of zext of s16 op patterns
Matt Arsenault [Tue, 7 Jan 2020 17:38:35 +0000 (12:38 -0500)]
AMDGPU/GlobalISel: Add IMMPopCount xform
Partially fixes BFE pattern import.
Matt Arsenault [Tue, 7 Jan 2020 17:21:18 +0000 (12:21 -0500)]
AMDGPU/GlobalISel: Add selectVOP3Mods_nnan
This doesn't enable any new imports yet, but moves the fmed patterns
from failing on this to hitting the "complex suboperand referenced
more than once" limitation in tablegen.
Matt Arsenault [Tue, 7 Jan 2020 16:45:10 +0000 (11:45 -0500)]
AMDGPU/GlobalISel: Add equiv xform for bitcast_fpimm_to_i32
Only partially fixes one pattern import.
Matt Arsenault [Tue, 7 Jan 2020 16:29:05 +0000 (11:29 -0500)]
AMDGPU/GlobalISel: Fix add of neg inline constant pattern
Matt Arsenault [Wed, 8 Jan 2020 23:57:44 +0000 (18:57 -0500)]
TableGen/GlobalISel: Fix slightly wrong generated comment
Matt Arsenault [Wed, 8 Jan 2020 19:12:19 +0000 (14:12 -0500)]
AMDGPU: Add register class to DS_SWIZZLE_B32 pattern
Reduces diff for a future patch.
Simon Tatham [Thu, 9 Jan 2020 11:23:20 +0000 (11:23 +0000)]
[ARM,MVE] Add missing IntrNoMem flag on IR intrinsics.
A lot of the IR-level intrinsics we've been defining for MVE recently
accidentally had `props = []` instead of `props = [IntrNoMem]`, so
that optimization would have been overcautious about reordering them.
All the affected cases were due to instantiating the multiclasses
`MVEPredicated` and `MVEMXPredicated` without filling in the `props`
parameter, because I //thought// I remembered having set the defaults
in those multiclasses to `[IntrNoMem]`. In fact I hadn't done that.
Now I have.
(The IR intrinsics that //do// read and write memory are all
explicitly marked as `[IntrReadMem]` or `[IntrWriteMem]` already, so
they will override these defaults.)
Simon Tatham [Thu, 9 Jan 2020 10:49:41 +0000 (10:49 +0000)]
[ARM,MVE] Fix valid immediate range for vsliq_n.
In common with most MVE immediate shift instructions, the left shift
takes an immediate in the range [0,n-1], while the right shift takes
one in the range [1,n]. I had absent-mindedly made them both the
latter.
While I'm here, I've added a set of regression tests checking both
ends of the immediate range for a representative sample of the
immediate shifts.
Tim Northover [Thu, 9 Jan 2020 14:28:48 +0000 (14:28 +0000)]
IR: remove "else" after "return". NFCI.
Alexey Bataev [Thu, 9 Jan 2020 14:28:59 +0000 (09:28 -0500)]
[OPENMP]Remove unused code, NFC.
Sanjay Patel [Thu, 9 Jan 2020 14:36:22 +0000 (09:36 -0500)]
[DAGCombiner] reduce extract subvector of concat
If we are extracting a chunk of a vector that's a fraction of an
operand of the concatenated vector operand, we can extract directly
from one of those original operands.
This is another suggestion from PR42024:
https://bugs.llvm.org/show_bug.cgi?id=42024#c2
But I'm not sure yet if it will make any difference on those patterns.
It seems to help a few existing AVX512 tests though.
Differential Revision: https://reviews.llvm.org/D72361
Saar Raz [Thu, 9 Jan 2020 14:13:46 +0000 (16:13 +0200)]
[Concepts] Fix failing test on Windows
Fix test failed by D43357 on Windows.
Sanjay Patel [Thu, 9 Jan 2020 14:02:53 +0000 (09:02 -0500)]
[InstSimplify] select Cond, true, false --> Cond
This is step 1 of damage control assuming that we need to remove several
over-reaching folds for select-of-booleans because they can cause
miscompiles as shown in D72396.
The scalar case seems obviously safe:
https://rise4fun.com/Alive/jSj
And I don't think there's any danger for vectors either - if the
condition is poisoned, then the select must be poisoned too, so undef
elements don't make any difference.
Differential Revision: https://reviews.llvm.org/D72412
Momchil Velikov [Thu, 9 Jan 2020 13:47:52 +0000 (13:47 +0000)]
[ARM][MVE] MVE-I should not be disabled by -mfpu=none
Architecturally, it's allowed to have MVE-I without an FPU, thus
-mfpu=none should not disable MVE-I, or moves to/from FP-registers.
This patch removes `+/-fpregs` from features unconditionally added to
target feature list, depending on FPU and moves the logic to Clang
driver, where the negative form (`-fpregs`) is conditionally added to
the target features list for the cases of `-mfloat-abi=soft`, or
`-mfpu=none` without either `+mve` or `+mve.fp`. Only the negative
form is added by the driver, the positive one is derived from other
features in the backend.
Differential Revision: https://reviews.llvm.org/D71843
Sanjay Patel [Thu, 9 Jan 2020 13:20:24 +0000 (08:20 -0500)]
[InstCombine] Use minimal FMF in testcase for Z / (1.0 / Y) => (Y * Z); NFC
Patch by: @raghesh (Raghesh Aloor)
Differential Revision: https://reviews.llvm.org/D72431
Pavel Labath [Thu, 9 Jan 2020 13:14:54 +0000 (14:14 +0100)]
[lldb] Modernize OptionValue::SetValueChangedCallback
instead of a function pointer + void*, take a std::function. This
removes a bunch of repetitive, unsafe void* casts.
Hiroshi Inoue [Thu, 9 Jan 2020 13:03:23 +0000 (13:03 +0000)]
[mlir] fix test failure in EDSC/builder-api-test
This patch fixes a test failure on a non-intel (PowerPC64) box.
The two affine.load are independent and hence llvm may reorder them.
The CHECK lines are modified for supporting reordered case.
Differential Revision: https://reviews.llvm.org/D72435
Saar Raz [Thu, 9 Jan 2020 13:07:51 +0000 (15:07 +0200)]
[Concepts] Function trailing requires clauses
Function trailing requires clauses now parsed, supported in overload resolution and when calling, referencing and taking the address of functions or function templates.
Differential Revision: https://reviews.llvm.org/D43357
Sam Parker [Thu, 9 Jan 2020 12:52:50 +0000 (12:52 +0000)]
[NFC][ARM] LowOverheadLoop comments
Add a comment describing the dependencies of the pass.
Simon Pilgrim [Thu, 9 Jan 2020 12:35:21 +0000 (12:35 +0000)]
Fix "pointer is null" static analyzer warning. NFCI.
Use cast<> instead of dyn_cast<> since we know that the pointer should be valid (and is dereferenced immediately).
Simon Pilgrim [Thu, 9 Jan 2020 12:33:37 +0000 (12:33 +0000)]
Fix "pointer is null" static analyzer warning. NFCI.
Use cast<> instead of dyn_cast<> since we know that the pointer should be valid (and is dereferenced immediately below).
Pavel Labath [Fri, 20 Dec 2019 08:42:37 +0000 (09:42 +0100)]
[lldb/DWARF] Fix mixed v4+v5 location lists
Summary:
Our code was expecting that a single (symbol) file contains only one
kind of location lists. This is not correct (on non-apple platforms, at
least) as a file can compile units with different dwarf versions.
This patch moves the deteremination of location list flavour down to the
compile unit level, fixing this problem. I have also tried to rougly
align the code with the llvm DWARFUnit. Fully matching the API is not
possible because of how lldb's DWARFExpression lives separately from the
rest of the DWARF code, but this is at least a step in the right
direction.
Reviewers: JDevlieghere, aprantl, clayborg
Subscribers: dblaikie, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71751
Pavel Labath [Tue, 17 Dec 2019 16:12:29 +0000 (17:12 +0100)]
[lldb/DWARF] Add is_dwo member to DWARFUnit
Summary:
A skeleton unit can easily be detected by checking the m_dwo_symbol_file
member, but we cannot tell a split unit from a normal unit from the
"inside", which is sometimes useful.
This patch adds a m_is_dwo member to enable this, and align the code
with llvm::DWARFUnit. Right now it's only used to avoid creating a split
unit inside another split unit (which removes one override from
SymbolFileDWARFDwo and brings us a step closer to deleting it), but my
main motivation is fixing the handling of location lists in mixed v4&v5
files. This comes in a separate patch.
Reviewers: JDevlieghere, aprantl, clayborg
Subscribers: dblaikie, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71750
Simon Pilgrim [Thu, 9 Jan 2020 12:05:30 +0000 (12:05 +0000)]
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
Simon Pilgrim [Thu, 9 Jan 2020 11:48:06 +0000 (11:48 +0000)]
Fix "pointer is null" static analyzer warnings. NFCI.
Assert that the pointers are non-null before dereferencing them.
Sam Parker [Thu, 9 Jan 2020 11:57:04 +0000 (11:57 +0000)]
[ARM][MVE] Don't unroll intrinsic loops.
We don't unroll vector loops for MVE targets, but we miss the case
when loops only contain intrinsic calls. So just move the logic a
bit to catch this case.
Differential Revision: https://reviews.llvm.org/D72440
Andi-Bogdan Postelnicu [Thu, 9 Jan 2020 08:00:05 +0000 (10:00 +0200)]
[clang-tidy] For checker `readability-misleading-indentation` update tests.
Summary: In D72333 we've introduced support for `if constexpr` but the test for uninstantiated template was not ready to land on windows platform since this target uses `-fdelayed-template-parsing` by default. This patch addresses this by passing `-fno-delayed-template-parsing` to the test.
Reviewers: JonasToth
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72438
Simon Pilgrim [Thu, 9 Jan 2020 11:10:46 +0000 (11:10 +0000)]
Fix MSVC unhandled enum warning. NFCI.
Raphael Isemann [Thu, 9 Jan 2020 11:09:44 +0000 (12:09 +0100)]
[lldb] Fix that TestNoSuchArch.py was passing for the wrong reason
The command here failed due to the type in 'create' but the expect
did not actually check for the error message. This fixes the typo
and adds a check for the actuall error message we should see.
Florian Hahn [Thu, 9 Jan 2020 10:23:34 +0000 (10:23 +0000)]
[Matrix] Update shape propagation to iterate until done.
This patch updates the shape propagation to iterate until no new shape
information is discovered.
As initial seed for the forward propagation, we use the matrix intrinsic
instructions. Both propagateShapeForward and propagateShapeBackward
return new work lists, with the instructions to be used for the next
iteration. When propagating forward, we record all instructions we added
new shape information for. When propagating backward, we record all
users of instructions we added new shape information for.
Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor
Reviewed By: anemet
Differential Revision: https://reviews.llvm.org/D70901
Kadir Cetinkaya [Fri, 13 Dec 2019 08:34:59 +0000 (09:34 +0100)]
[clangd] Refurbish HoverInfo::present
Summary: Improves basic hover presentation logic to include more info.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71555
Florian Hahn [Thu, 9 Jan 2020 09:52:04 +0000 (09:52 +0000)]
[Matrix] Propagate and use shape information for loads.
This patch extends to shape propagation to also include load
instructions and implements shape aware lowering for vector loads.
Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor
Reviewed By: anemet
Differential Revision: https://reviews.llvm.org/D70900
Kazushi (Jam) Marukawa [Thu, 9 Jan 2020 08:59:37 +0000 (09:59 +0100)]
[VE] Target stub for NEC SX-Aurora
Summary:
This patch registers the 've' target: the NEC SX-Aurora TSUBASA Vector Engine.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D69103
Evgeniy Brevnov [Tue, 31 Dec 2019 06:33:44 +0000 (13:33 +0700)]
[LoopUtils][NFC] Minor refactoring in getLoopEstimatedTripCount.
Florian Hahn [Thu, 9 Jan 2020 09:47:26 +0000 (09:47 +0000)]
[Matrix] Implement back-propagation of shape information.
This patch extends the shape propagation for matrix operations to also
propagate the shape of instructions to their operands.
Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor
Reviewed By: anemet
Differential Revision: https://reviews.llvm.org/D70899
Sam Parker [Thu, 9 Jan 2020 09:21:05 +0000 (09:21 +0000)]
Revert "[ARM][LowOverheadLoops] Update liveness info"
This reverts commit
e93e0d413f3afa1df5c5f88df546bebcd1183155.
There's some ordering problems on some on the buildbots which needs
investigating.
Pavel Labath [Thu, 9 Jan 2020 09:14:30 +0000 (10:14 +0100)]
[DWARFDebugLoc] Tweak error message when resolving offset pairs with no base address
The previous message mentioned DW_LLE_offset_pair, but this is
incorrect/confusing because we can get this message even with DWARF4
(which does not use DW_LLE encodings). This happens because DWARF<=4
location entries are "upgraded" to DWARF v5 during parsing.
The new error message refrains from referencing specific constants.
Fixes pr44482.
Sjoerd Meijer [Thu, 9 Jan 2020 09:14:00 +0000 (09:14 +0000)]
[LV] Still vectorise when tail-folding can't find a primary inducation variable
This addresses a vectorisation regression for tail-folded loops that are
counting down, e.g. loops as simple as this:
void foo(char *A, char *B, char *C, uint32_t N) {
while (N > 0) {
*C++ = *A++ + *B++;
N--;
}
}
These are loops that can be vectorised, but when tail-folding is requested, it
can't find a primary induction variable which we do need for predicating the
loop. As a result, the loop isn't vectorised at all, which it is able to do
when tail-folding is not attempted. So, this adds a check for the primary
induction variable where we decide how to lower the scalar epilogue. I.e., when
there isn't a primary induction variable, a scalar epilogue loop is allowed
(i.e. don't request tail-folding) so that vectorisation could still be
triggered.
Having this check for the primary induction variable make sense anyway, and in
addition, in a follow-up of this I will look into discovering earlier the
primary induction variable for counting down loops, so that this can also be
tail-folded.
Differential revision: https://reviews.llvm.org/D72324
Alex Zinenko [Tue, 7 Jan 2020 19:00:54 +0000 (20:00 +0100)]
[mlir][GPU] introduce utilities for promotion to workgroup memory
Introduce a set of function that promote a memref argument of a `gpu.func` to
workgroup memory using memory attribution. The promotion boils down to
additional loops performing the copy from the original argument to the
attributed memory in the beginning of the function, and back at the end of the
function using all available threads. The loop bounds are specified so as to
adapt to any size of the workgroup. These utilities are intended to compose
with other existing utilities (loop coalescing and tiling) in cases where the
distribution of work across threads is uneven, e.g. copying a 2D memref with
only the threads along the "x" dimension. Similarly, specialization of the
kernel to specific launch sizes should be implemented as a separate pass
combining constant propagation and canonicalization.
Introduce a simple attribute-driven pass to test the promotion transformation
since we don't have a heuristic at the moment.
Differential revision: https://reviews.llvm.org/D71904
Sam Parker [Thu, 9 Jan 2020 08:33:47 +0000 (08:33 +0000)]
[ARM][LowOverheadLoops] Update liveness info
After expanding the pseudo instructions, update the liveness info.
We do this in a post-order traversal of the loop, including its
exit blocks and preheader(s).
Differential Revision: https://reviews.llvm.org/D72131
Nicolas Vasilache [Thu, 9 Jan 2020 08:12:41 +0000 (03:12 -0500)]
[mlir][VectorOps] Implement insert_strided_slice conversion
Summary:
This diff implements the progressive lowering of insert_strided_slice.
Two cases appear:
1. when the source and dest vectors have different ranks, extract the dest
subvector at the proper offset and reduce to case 2.
2. when they have the same rank N:
a. if the source and dest type are the same, the insertion is trivial:
just forward the source
b. otherwise, iterate over all N-1 D subvectors and create an
extract/insert_strided_slice/insert replacement, reducing the problem
to vecotrs of the same N-1 rank.
This combines properly with the other conversion patterns to lower all the way to LLVM.
Reviewers: ftynse, rriddle, AlexEichenberger, andydavis1, tetuante, nicolasvasilache
Reviewed By: andydavis1
Subscribers: merge_guards_bot, mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72317
Nicolas Vasilache [Thu, 9 Jan 2020 07:58:21 +0000 (02:58 -0500)]
[mlir][VectorOps] Implement strided_slice conversion
Summary:
This diff implements the progressive lowering of strided_slice to either:
1. extractelement + insertelement for the 1-D case
2. extract + optional strided_slice + insert for the n-D case.
This combines properly with the other conversion patterns to lower all the way to LLVM.
Appropriate tests are added.
Reviewers: ftynse, rriddle, AlexEichenberger, andydavis1, tetuante
Reviewed By: andydavis1
Subscribers: merge_guards_bot, mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72310