Josh Mottley [Wed, 13 Oct 2021 18:19:33 +0000 (19:19 +0100)]
[Flang] flang-omp-report replace std::vector's with llvm::SmallVector
This patch replaces all uses of std::vector with llvm::SmallVector in the flang-omp-report plugin.
This is a one of several patches focusing on switching containers from STL to LLVM's ADT library.
Reviewed By: Leporacanthicus
Differential Revision: https://reviews.llvm.org/
D111709
Tobias Gysi [Thu, 14 Oct 2021 09:08:39 +0000 (09:08 +0000)]
[mlir][linalg] Verify every LinalgOp has a body.
After removing the last LinalgOps that have no region attached we can verify there is a region. The patch performs the following changes:
- Move the SingleBlockImplicitTerminator trait further up the the structured op base class.
- Adapt the LinalgOp verification since the trait only check if there is 0 or 1 block.
- Introduce a getBlock method on the LinalgOp interface.
- Access the LinalgOp body using either getBlock() or getBody() if the concrete operation type is known.
This patch is a follow up to https://reviews.llvm.org/
D111233.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/
D111393
Pavel Labath [Thu, 14 Oct 2021 08:38:00 +0000 (10:38 +0200)]
[lldb] Fix TestStackCorefile.py for
ca0ce99fc8
Jonas Paulsson [Tue, 12 Oct 2021 10:35:01 +0000 (12:35 +0200)]
[SystemZ] Reapply memcmp and memcpy patches.
This reverts
3562076 and includes some refactoring as well.
Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/
D111733
Jonas Paulsson [Sat, 9 Oct 2021 16:13:09 +0000 (18:13 +0200)]
[SystemZ] Bugfix and refactorization of mem-mem operations
This patch fixes the bug that consisted of treating variable / immediate
length mem operations (such as memcpy, memset, ...) differently. The variable
length case needs to have the length minus 1 passed due to the use of EXRL
target instructions. However, the DAGCombiner can convert a register length
argument into a constant one, and whenever that happened one byte too little
would end up being performed.
This is also a refactorization by reducing the number of opcodes and variants
involved. For any opcode (variable or constant length), only the length minus
one is passed on to the ISD node. The rest of the logic is now instead
handled during isel pseudo expansion.
Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/
D111729
Martin Storsjö [Fri, 8 Oct 2021 08:41:02 +0000 (11:41 +0300)]
[lldb] Make the thread_local g_global_boundary accessed from a single file
This makes the compiler generated code for accessing the thread local
variable much simpler (no need for wrapper functions and weak pointers
to potential init functions), and can avoid toolchain bugs regarding how
to access TLS variables.
In particular, this fixes LLDB when built with current GCC/binutils for
MinGW, see https://github.com/msys2/MINGW-packages/issues/8868.
Differential Revision: https://reviews.llvm.org/
D111779
Pavel Labath [Tue, 12 Oct 2021 12:32:34 +0000 (14:32 +0200)]
[lldb] Print embedded nuls in char arrays (PR44649)
When we know the bounds of the array, print any embedded nuls instead of
treating them as terminators. An exception to this rule is made for the
nul character at the very end of the string. We don't print that, as
otherwise 99% of the strings would end in \0. This way the strings
usually come out the same as how the user typed it into the compiler
(char foo[] = "with\0nuls"). It also matches how they come out in gdb.
This resolves a FIXME left from
D111399, and leaves another FIXME for dealing
with nul characters in "escape-non-printables=false" mode. In this mode the
characters cause the entire summary string to be terminated prematurely.
Differential Revision: https://reviews.llvm.org/
D111634
Max Kazantsev [Thu, 14 Oct 2021 07:06:52 +0000 (14:06 +0700)]
[SCEV][NFC] Simplify check with CI->isZero() exit condition
Replace check with
if ((ExitIfTrue && CI->isZero()) || (!ExitIfTrue && CI->isOne()))
with equivalent and simpler version
if (ExitIfTrue == CI->isZero())
Max Kazantsev [Thu, 14 Oct 2021 06:29:05 +0000 (13:29 +0700)]
[SCEV][NFC] Reorder checks to delay call of all_of
Check lightweight getter condition before calling all_of.
Arthur Eubanks [Thu, 14 Oct 2021 06:13:55 +0000 (23:13 -0700)]
Set LLVM_HAS_RVALUE_REFERENCE_THIS when __GNUC__ is defined
gcc does not support __has_feature(), so this was accidentally changed
in
D111581 when compiling with gcc.
Valentin Clement [Thu, 14 Oct 2021 05:04:40 +0000 (07:04 +0200)]
[fir] Remove unused variable in FIRBuilder.h
Remove unsused variable that break Werror on some buildbots
Ben Shi [Thu, 14 Oct 2021 03:10:33 +0000 (03:10 +0000)]
[RISCV] Optimize immediate materialisation with BSETI/BCLRI
Opitimize immediate materialisation in the following way if profitable:
1. Use BCLRI for upper 32 bits if the lower 32 bits are negative int32.
2. Use BSETI for upper 32 bits if the lower 32 bits are positive int32.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/
D111508
Kazu Hirata [Thu, 14 Oct 2021 03:41:54 +0000 (20:41 -0700)]
[clang] Use llvm::is_contained (NFC)
Abinav Puthan Purayil [Sun, 10 Oct 2021 15:43:24 +0000 (21:13 +0530)]
[AMDGPU] Fix 24-bit mul intrinsic generation for > 32-bit result.
The 24-bit mul intrinsics yields the low-order 32 bits. We should only
do the transformation if the operands are known to be not wider than 24
bits and the result is known to be not wider than 32 bits.
Differential Revision: https://reviews.llvm.org/
D111523
Tom Stellard [Thu, 14 Oct 2021 03:25:31 +0000 (03:25 +0000)]
docs: Document workaround for arcanist failures
Reviewed By: smeenai
Differential Revision: https://reviews.llvm.org/
D110976
Ben Shi [Wed, 13 Oct 2021 10:37:56 +0000 (10:37 +0000)]
[RISCV] Optimize immediate materialisation with SLLI.UW
Use LUI+SLLI.UW to compose the upper bits instead of LUI+SLLI.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/
D111705
Ben Shi [Wed, 13 Oct 2021 10:00:58 +0000 (10:00 +0000)]
[RISCV][test] Add more tests of immediate materialisation
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/
D111704
Stella Laurenzo [Sun, 10 Oct 2021 04:16:29 +0000 (21:16 -0700)]
[mlir] Ability to build CAPI dylibs from out of tree projects against installed LLVM.
* Incorporates a reworked version of
D106419 (which I have closed but has comments on it).
* Extends the standalone example to include a minimal CAPI (for registering its dialect) and a test which, from out of tree, creates an aggregate dylib and links a little sample program against it. This will likely only work today in *static* MLIR builds (until the TypeID fiasco is finally put to bed). It should work on all platforms, though (including Windows - albeit I haven't tried this exact incarnation there).
* This is the biggest pre-requisite to being able to build out of tree MLIR Python-based projects from an installed MLIR/LLVM.
* I am rather nauseated by the CMake shenanigans I had to endure to get this working. The primary complexity, above and beyond the previous patch is because (with no reason given), it is impossible to export target properties that contain generator expressions... because, of course it isn't. In this case, the primary reason we use generator expressions on the individual embedded libraries is to support arbitrary ordering. Since that need doesn't apply to out of tree (which import everything via FindPackage at the outset), we fall back to a more imperative way of doing the same thing if we detect that the target was imported. Gross, but I don't expect it to need a lot of maintenance.
* There should be a relatively straight-forward path from here to rebase libMLIR.so on top of this facility and also make it include the CAPI.
Differential Revision: https://reviews.llvm.org/
D111504
Lang Hames [Thu, 14 Oct 2021 01:19:53 +0000 (18:19 -0700)]
[examples] Fix LLJITWithRemoteDebugging example after
4fcc0ac15e0.
wlei [Wed, 13 Oct 2021 06:42:07 +0000 (23:42 -0700)]
[llvm-profgen] Ignore the whole trace with the leading external branch
The first LBR entry can be an external branch, we should ignore the whole trace.
```
7f7448e889e4 0x7f7448e889e4/0x7f7448e88826/P/-/-/1 0x7f7448e8899f/0x7f7448e889d8/P/-/-/4 ...
```
Reviewed By: wenlei, hoy
Differential Revision: https://reviews.llvm.org/
D111749
wlei [Mon, 11 Oct 2021 20:40:22 +0000 (13:40 -0700)]
[llvm-profgen] Ignore stack samples before aggregation
With `ignore-stack-samples`, We can ignore the call stack before the samples aggregation which could reduce some redundant computations.
Reviewed By: hoy, wenlei
Differential Revision: https://reviews.llvm.org/
D111577
Lang Hames [Wed, 13 Oct 2021 23:22:28 +0000 (16:22 -0700)]
[ORC] Use a Setup object for SimpleRemoteEPC construction.
SimpleRemoteEPC notionally allowed subclasses to override the
createMemoryManager and createMemoryAccess methods to use custom objects, but
could not actually be subclassed in practice (The construction process in
SimpleRemoteEPC::Create could not be re-used).
Instead of subclassing, this commit adds a SimpleRemoteEPC::Setup class that
can be used by clients to set up the memory manager and memory access members.
A default-constructed Setup object results in no change from previous behavior
(EPCGeneric* memory manager and memory access objects used by default).
Lang Hames [Wed, 13 Oct 2021 23:22:07 +0000 (16:22 -0700)]
[ORC] Add a missing definition.
wren romano [Wed, 13 Oct 2021 23:08:35 +0000 (16:08 -0700)]
[mlir][sparse] Misc code cleanup
Depends On
D111763
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/
D111766
wren romano [Wed, 13 Oct 2021 23:03:26 +0000 (16:03 -0700)]
[mlir][sparse] Factoring out helper functions for generating constants
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/
D111763
Nico Weber [Wed, 13 Oct 2021 22:43:16 +0000 (18:43 -0400)]
[gn build] (manually) port
6c76d0101193
Shoaib Meenai [Sun, 10 Oct 2021 21:06:49 +0000 (14:06 -0700)]
[InstCombine] Remove attributes after hoisting free above null check
If the parameter had been annotated as nonnull because of the null
check, we want to remove the attribute, since it may no longer apply and
could result in miscompiles if left. Similarly, we also want to remove
undef-implying attributes, since they may not apply anymore either.
Fixes PR52110.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/
D111515
Mircea Trofin [Wed, 13 Oct 2021 17:36:08 +0000 (10:36 -0700)]
[mlgo][aot] requrie the model is autogenerated for test determinism
The tests that exercise the 'release' mode, where the model is AOT-ed,
check the output has certain properties, to validate that, indeed, a
different policy from the default one was exercised. For determinism, we
can't reliably check that output for an arbitrary learned policy, since
it could be that policy happens to mimic the default one in that
particular case.
This patch adds a requirement that those tests run only when the model
is autogenerated (e.g. on build bots).
Differential Revision: https://reviews.llvm.org/
D111747
Vitaly Buka [Wed, 13 Oct 2021 20:53:15 +0000 (13:53 -0700)]
[sanitizer] Cleanup benchmark
Philip Reames [Wed, 13 Oct 2021 20:55:54 +0000 (13:55 -0700)]
[instcombine] PRE freeze to only potentially posion/undef operand of phi
This extends the foldOpIntoPhi code used when visiting a freeze user of a phi to allow any non-undef/poison operand as opposed to only non-undef/poison constants. This lets us hoist a freeze in the increment of an IV into the preheader in many cases.
Differential Revision: https://reviews.llvm.org/
D111744
Martin Storsjö [Wed, 13 Oct 2021 06:06:49 +0000 (06:06 +0000)]
[Support] [Path] Move function declarations to the right doxygen group in the header. NFC.
They were in the doxygen group Observers, while they are about
mutating paths.
Differential Revision: https://reviews.llvm.org/
D111732
Martin Storsjö [Mon, 4 Oct 2021 13:48:07 +0000 (16:48 +0300)]
[Support] [Path] Use std::replace instead of an explicit comparison loop. NFC.
After
8fc7a907b93a8e9eef96e872f8f926db3ebfe9b6, this loop does
the same as a plain `std::replace`.
Also clarify the comment about what this function does.
Differential Revision: https://reviews.llvm.org/
D111730
Jeremy Drake [Wed, 13 Oct 2021 19:49:29 +0000 (22:49 +0300)]
[clang][Tooling] Use Windows command lines on all Windows, except Cygwin
Previously it only used Windows command lines for MSVC triples, but this
was causing issues for windows-gnu. In fact, everything 'native' Windows
(ie, not Cygwin) should use Windows command line parsing.
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/
D111195
Martin Storsjö [Tue, 12 Oct 2021 19:36:33 +0000 (19:36 +0000)]
[libcxx] [test] Generalize the conditions for testing bitcasts between long double, double and int128
MSVC targets also have a 64 bit long double, as do MinGW targets on ARM.
This hasn't been noticed in CI because the MSVC configurations there run
with _LIBCPP_HAS_NO_INT128 defined.
This avoids assuming that either __int128_t or double is equal in size to
long double. i386 MinGW targets have sizeof(long double) == 10, which
doesn't match any of the tested types.
Differential Revision: https://reviews.llvm.org/
D111671
Martin Storsjö [Wed, 13 Oct 2021 10:38:17 +0000 (13:38 +0300)]
[clang] [Windows] Mark PIC as implicitly enabled for aarch64, just like for x86_64
This doesn't practically affect the code generation.
Differential Revision: https://reviews.llvm.org/
D111707
Eric Schweitz [Wed, 13 Oct 2021 19:46:18 +0000 (21:46 +0200)]
[fir] Add the DoLoopHelper
Add the DoLoopHelper. Some helpers functions
to create fir.do_loop operations.
This code was part of
D111337 and was extracted in order to
make the patch easier to review.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/
D111713
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Roman Lebedev [Wed, 13 Oct 2021 19:47:43 +0000 (22:47 +0300)]
[NFC][X86][LV] Autogenerate checklines in cost-model.ll to simplify further updates
Roman Lebedev [Wed, 13 Oct 2021 19:44:57 +0000 (22:44 +0300)]
[NFC][Costmodel][X86] Fix broken `CHECK-NOT`'s in interleave costmodel tests
Roman Lebedev [Wed, 13 Oct 2021 19:35:39 +0000 (22:35 +0300)]
[X86][Costmodel] Fix `X86TTIImpl::getGSScalarCost()`
`X86TTIImpl::getGSScalarCost()` has (at least) two issues:
* it naively computes the cost of sequence of `insertelement`/`extractelement`.
If we are operating not on the XMM (but YMM/ZMM),
this widely overestimates the cost of subvector insertions/extractions.
* Gather/scatter takes a vector of pointers, and scalarization results in us performing
scalar memory operation for each of these pointers, but we never account for the cost
of extracting these pointers out of the vector of pointers.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/
D111222
Vitaly Buka [Wed, 13 Oct 2021 06:56:38 +0000 (23:56 -0700)]
[sanitizer] Add trivial StackDepot benchmark
Yaxun (Sam) Liu [Wed, 13 Oct 2021 15:18:18 +0000 (11:18 -0400)]
[HIP] Fix test rcom-detect.hip
This patches fixes https://bugs.llvm.org/show_bug.cgi?id=51404
Some builds use custom resource directory for clang, therefore the test
cannot assume default resource directory for clang. Use -resource-dir
to force it.
Differential Revision: https://reviews.llvm.org/
D111726
Craig Topper [Wed, 13 Oct 2021 18:31:31 +0000 (11:31 -0700)]
[Builtins] Remove stale comment. NFC
The header name was made a separate string more than 12.5 years ago.
I think it was part of the attribute string for less than a week.
Nico Weber [Wed, 13 Oct 2021 18:27:16 +0000 (14:27 -0400)]
[clang] Delete unused class DiagsUninitializedSeveretyRAII
Sjoerd Meijer [Tue, 12 Oct 2021 14:37:21 +0000 (15:37 +0100)]
[FuncSpec] Don't run the solver if there's nothing to do
Even if there are no interesting functions, the SCCP solver would still run
before bailing. Now bail earlier, avoid running the solver for nothing.
Differential Revision: https://reviews.llvm.org/
D111645
AndreyChurbanov [Wed, 13 Oct 2021 18:02:18 +0000 (21:02 +0300)]
[OpenMP] libomp: add atomic functions for new OpenMP 5.1 atomics.
Added functions those implement "atomic compare".
Though clang does not use library interfaces to implement OpenMP atomics,
the functions added for consistency.
Also added missed functions for 80-bit floating min/max atomics.
Differential Revision: https://reviews.llvm.org/
D110109
Noah Shutty [Wed, 13 Oct 2021 07:38:40 +0000 (00:38 -0700)]
[CMake] Add optional libCURL dependency to llvm build configuration
This finds the curl libraries if LLVM_ENABLE_CURL is set. This is needed
to implement the debuginfod client library in LLVM.
Patch By: noajshu
Differential Revision: https://reviews.llvm.org/
D111238
AndreyChurbanov [Wed, 13 Oct 2021 17:49:05 +0000 (20:49 +0300)]
[OpenMP] libomp: fix ittnotify usage.
Replaced storing of ittnotify domain array index into
location info structure (which is now read-only) with storing of
(location info address + ittnotify domain + team size) into hash map.
Replaced __kmp_itt_barrier_domains and __kmp_itt_imbalance_domains arrays with
__kmp_itt_barrier_domains hash map; __kmp_itt_region_domains and
__kmp_itt_region_team_size arrays with __kmp_itt_region_domains hash map.
Basic functionality did not change (at least tried to not change).
The patch fixes https://bugs.llvm.org/show_bug.cgi?id=48644.
Differential Revision: https://reviews.llvm.org/
D111580
Arthur Eubanks [Wed, 13 Oct 2021 17:22:57 +0000 (10:22 -0700)]
Make various assume bundle data structures use uint64_t
Following
D110451, we need to make sure to support 64 bit values.
Aart Bik [Wed, 13 Oct 2021 17:13:44 +0000 (10:13 -0700)]
[mlir][sparse] emergency fix after constant -> arith.constant change
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/
D111743
Lang Hames [Wed, 13 Oct 2021 16:56:00 +0000 (09:56 -0700)]
[llvm-jitlink] Don't use thread pool task dispatch when LLVM_ENABLE_THREADS=Off
This should fix compile errors in llvm-jitlink.cpp in LLVM_ENABLE_THREADS=Off
builds due to
f3411616896.
AndreyChurbanov [Wed, 13 Oct 2021 17:11:47 +0000 (20:11 +0300)]
[OpenMP] libomp: fix warning on comparison of integer expressions of different signedness
Replaced macro with global variable of correspondent type.
Differential Revision: https://reviews.llvm.org/
D111562
Joe Nash [Wed, 13 Oct 2021 15:26:28 +0000 (11:26 -0400)]
[AMDGPU] Remove unneeded emit literal check
NFC. This check does not verify any functional property since size 8
was added. Remove it for simplicity.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/
D111737
Change-Id: Ifd7cbd324a137f939d8dc04acb8fbd54c9527a42
Kai Nacke [Wed, 13 Oct 2021 16:20:04 +0000 (12:20 -0400)]
[SystemZ/z/OS] Implement save of non-volatile registers on z/OS XPLINK
This PR implements the save of the XPLINK callee-saved registers
on z/OS.
Reviewed By: uweigand, Kai
Differential Revision: https://reviews.llvm.org/
D111653
Aart Bik [Tue, 12 Oct 2021 22:08:27 +0000 (15:08 -0700)]
[mlir][sparse] add init sparse tensor operation
This is the first step towards supporting general sparse tensors as output
of operations. The init sparse tensor is used to materialize an empty sparse
tensor of given shape and sparsity into a subsequent computation (similar to
the dense tensor init operation counterpart).
Example:
%c = sparse_tensor.init %d1, %d2 : tensor<?x?xf32, #SparseMatrix>
%0 = linalg.matmul
ins(%a, %b: tensor<?x?xf32>, tensor<?x?xf32>)
outs(%c: tensor<?x?xf32, #SparseMatrix>) -> tensor<?x?xf32, #SparseMatrix>
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/
D111684
Stella Stamenova [Wed, 13 Oct 2021 16:46:41 +0000 (09:46 -0700)]
[lldb] Skip several lldb tests that are flaky on Windows
These tests fail every 10 or so runs on Windows causing both local failures as well as buildbot failures.
Differential Revision: https://reviews.llvm.org/
D111659
Mike Rice [Tue, 12 Oct 2021 21:55:00 +0000 (14:55 -0700)]
[OPENMP51]Initial parsing/sema for adjust_args clause for 'declare variant'
Adds initial parsing and sema for the 'adjust_args' clause.
Note that an AST clause is not created as it instead adds its expressions
to the OMPDeclareVariantAttr.
Differential Revision: https://reviews.llvm.org/D99905
liuke [Wed, 13 Oct 2021 16:29:36 +0000 (12:29 -0400)]
bugprone-argument-comment: SourceLocation valid judgment avoid emitting coredump in isInSystemHeader
If the Node has an invalid location, it will trigger assert in
isInSystemHeader(...).
void test() {
__builtin_va_list __args;
// __builtin_va_list has no defination in any source file and its
// CXXConstructorDecl has invalid sourcelocation
}
coredump with "Assertion `Loc.isValid() && "Can't get file
characteristic of invalid loc!"' failed." in
getFileCharacteristic(SourceLocation).
Philip Reames [Wed, 13 Oct 2021 16:23:47 +0000 (09:23 -0700)]
[instcombine] propagate single use freeze(gep inbounds X)
This is a follow on for
D111675 which implements the gep case. I'd originally left it out because I was hoping to actually implement the inrange todo, but after a bit of staring at the code, decided to leave it as is since it doesn't effect this use case (i.e. instcombine requires the op to freeze to be an instruction).
Differential Revision: https://reviews.llvm.org/
D111691
Florian Hahn [Wed, 13 Oct 2021 15:47:42 +0000 (16:47 +0100)]
[SCEV] Add test for propagating poison through select condition.
Precommit a test for
D111643.
Jay Foad [Tue, 12 Oct 2021 14:39:43 +0000 (15:39 +0100)]
[AMDGPU] Enable load clustering in the post-RA scheduler
This has a couple of benefits:
1. It can sometimes fix clusters that got broken apart when the register
allocator inserted a copy.
2. Post-RA scheduling does not have to worry about increasing register
pressure, which in some cases gives it more freedom to reorder
instructions.
Testing on a collection of 10,000 graphics shaders compiled for gfx1010
showed:
- The average length of each run of one or more load instructions
increased by about 1%.
- The number of runs of two or more load instructions increased by
about 4%.
Differential Revision: https://reviews.llvm.org/
D111646
Jan Svoboda [Tue, 12 Oct 2021 09:21:06 +0000 (11:21 +0200)]
[clang][modules] Cache loads of modules imported by PCH
During explicit modular build, PCM files are typically specified via the `-fmodule-file=<path>` command-line option. Early during the compilation, Clang uses the `ASTReader` to read their contents and caches the result so that the module isn't loaded implicitly later on. A listener is attached to the `ASTReader` to collect names of the modules read from the PCM files. However, if the PCM has already been loaded previously via PCH:
1. the `ASTReader` doesn't do anything for the second time,
2. the listener is not invoked at all,
3. the module load result is not cached,
4. the compilation fails when attempting to load the module implicitly later on.
This patch solves this problem by attaching the listener to the `ASTReader` for PCH reading as well.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/
D111560
Jan Svoboda [Wed, 13 Oct 2021 15:57:45 +0000 (17:57 +0200)]
[clang] NFC: Move class to make it reusable
This is a prep patch for
D111560.
xndcn [Sun, 10 Oct 2021 14:40:20 +0000 (22:40 +0800)]
[mlir][spirv] Add memory semantics verify for atomic operations
Differential Revision: https://reviews.llvm.org/
D111510
Valentin Clement [Wed, 13 Oct 2021 15:46:39 +0000 (17:46 +0200)]
[fir][NFC] Add disclaimer to affine promotion/demotion passes
AffinePromotion and AffineDemotion passes where upstreamed
in their current status from fir-dev. In order to make sure everybody
is on the same page, this patch add some comments to state that.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/
D111629
Alex Zinenko [Wed, 13 Oct 2021 15:29:19 +0000 (17:29 +0200)]
[mlir] fix python bindings cmake
Raphael Isemann [Wed, 13 Oct 2021 15:05:30 +0000 (17:05 +0200)]
[lldb] Add a test for CRTP
Alex Zinenko [Wed, 13 Oct 2021 13:20:31 +0000 (15:20 +0200)]
[mlir][python] Add custom constructor for memref load
The type can be inferred trivially, but it is currently done as string
stitching between ODS and C++ and is not easily exposed to Python.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/
D111712
thomasraoux [Wed, 13 Oct 2021 03:00:40 +0000 (20:00 -0700)]
[mlir][vector] Add canonicalization extract + splat
Make canonicalization working on broadcast also work on splat op.
Differential Revision: https://reviews.llvm.org/
D111690
Jeremy Morse [Wed, 13 Oct 2021 14:54:46 +0000 (15:54 +0100)]
[DebugInfo][InstrRef] Only calculate IDF for reg units
In
D110173 we start using the existing LLVM IDF calculator to place PHIs as
we reconstruct an SSA form of machine-code program. Sadly that's slower
than the old (but broken) way, this patch attempts to recover some of that
performance.
The key observation: every time we def a register, we also have to def it's
register units. If we def'd $rax, in the current implementation we
independently calculate PHI locations for {al, ah, ax, eax, hax, rax}, and
they will all have the same PHI positions. Instead of doing that, we can
calculate the PHI positions for {al, ah} and place PHIs for any aliasing
registers in the same positions. Any def of a super-register has to def
the unit, and vice versa, so this is sound. It cuts down the SSA placement
we need to do significantly.
This doesn't work for stack slots, or registers we only ever read, so place
PHIs normally for those. LiveDebugValues choses to ignore writes to SP at
calls, and now have to ignore writes to SP register units too.
Differential Revision: https://reviews.llvm.org/
D111627
LLVM GN Syncbot [Wed, 13 Oct 2021 14:58:13 +0000 (14:58 +0000)]
[gn build] Port
dd71b65ca85d
Michael Kruse [Wed, 13 Oct 2021 14:05:54 +0000 (09:05 -0500)]
[llvm-reduce] Introduce operands-to-args pass.
Instead of setting operands to undef as the "operands" pass does,
convert the operands to a function argument. This avoids having to
introduce undef values into the IR which have some unpredictability
during optimizations.
For instance,
define void @func() {
entry:
%val = add i32 32, 21
store i32 %val, i32* null
ret void
}
is reduced to
define void @func(i32 %val) {
entry:
%val1 = add i32 32, 21
store i32 %val, i32* null
ret void
}
(note that the instruction %val is renamed to %val1 when printing
the IR to avoid ambiguity; ideally %val1 would be removed by dce or the
instruction reduction pass)
Any call to @func is replaced with a call to the function with the
new signature and filled with undef. This is not ideal for IPA passes,
but those out-of-scope for now.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/
D111503
Sanjay Patel [Wed, 13 Oct 2021 14:40:44 +0000 (10:40 -0400)]
[InstCombine] improve code comments; NFC
Kamau Bridgeman [Wed, 6 Oct 2021 13:33:26 +0000 (08:33 -0500)]
[PowerPC][Builtin] Allowing __rlwnm to accept a variable as a shift parameter
The builtin __rlwnm is currently constrained to accept only constants
for the shift parameter but the instructions emitted for it have no such
constraint, this patch allows the builtins to accept variable shift.
Reviewed By: NeHuang, amyk
Differential Revision: https://reviews.llvm.org/
D111229
Sanjay Patel [Wed, 13 Oct 2021 14:15:26 +0000 (10:15 -0400)]
[InstCombine] allow matching vector splat constants in foldLogOpOfMaskedICmps()
This is NFC-intended for scalar code. There are still unnecessary
m_ConstantInt restrictions in surrounding code, so this is not a
complete fix.
This prevents regressions seen with a planned follow-on to
D111410.
Sanjay Patel [Wed, 13 Oct 2021 13:39:16 +0000 (09:39 -0400)]
[InstCombine] add vector splat tests for foldLogOpOfMaskedICmps(); NFC
There's a substantial pile of scalar tests for transforms that
depend on this code, but zero vector coverage. This patch adds
a vector test next to the first scalar test in each file that
is affected by foldLogOpOfMaskedICmps.
The code that handles these transforms is artificially limited
from working with vector splat constants.
Raphael Isemann [Wed, 13 Oct 2021 12:05:25 +0000 (14:05 +0200)]
[lldb][NFC] for-range loop when iterating over delayed_properties
Alex Zinenko [Wed, 13 Oct 2021 12:40:49 +0000 (14:40 +0200)]
[mlir] Fix typos in the Python bindings doc
Alex Zinenko [Mon, 11 Oct 2021 16:24:48 +0000 (18:24 +0200)]
[mlir][python] Provide some methods and properties for API completeness
When writing the user-facing documentation, I noticed several inconsistencies
and asymmetries in the Python API we provide. Fix them by adding:
- the `owner` property to regions, similarly to blocks;
- the `isinstance` method to any class derived from `PyConcreteAttr`,
`PyConcreteValue` and `PyConreteAffineExpr`, similar to `PyConcreteType` to
enable `isa`-like calls without having to handle exceptions;
- a mechanism to create the first block in the region as we could only create
blocks relative to other blocks, with is impossible in an empty region.
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/
D111556
Jeremy Morse [Wed, 13 Oct 2021 12:27:25 +0000 (13:27 +0100)]
Follow up
a3936a6c19c to work around an old compiler bug
Old versions of gcc want template specialisations to happen within the
namespace where the template lives; this is still present in gcc 5.1, which
we officially support, so it has to be worked around.
Louis Dionne [Tue, 12 Oct 2021 21:45:45 +0000 (17:45 -0400)]
[libc++abi][ci] Add a from-scratch config for libc++abi on Apple/system
I came across an issue where since we build the library for Apple with
the install name directory being /usr/lib, which means that if we don't
run the tests with DYLD_LIBRARY_PATH, we'll end up loading the
system-provided libc++abi when running the tests. That wreaks havoc.
Instead of fixing it in the legacy config file, this commit introduces
an Apple libc++abi config file that does the right thing.
Differential Revision: https://reviews.llvm.org/
D111279
Louis Dionne [Tue, 12 Oct 2021 18:15:33 +0000 (14:15 -0400)]
[libc++abi] Change LIBCXXABI_NO_TIMER to LIBCXXABI_USE_TIMER
Instead of always defining LIBCXXABI_NO_TIMER to run the tests, only
define LIBCXXABI_USE_TIMER when we want to enable the timer. This makes
the libc++abi testing configuration simpler.
As a fly-by fix, remove the unused LIBUNWIND_NO_TIMER macro from libunwind.
Differential Revision: https://reviews.llvm.org/
D111667
Jeremy Morse [Wed, 13 Oct 2021 11:35:35 +0000 (12:35 +0100)]
[DebugInfo][InstrRef] Use PHI placement utilities for machine locations
InstrRefBasedLDV used to try and determine which values are in which
registers using a lattice approach; however this is hard to understand, and
broken in various ways. This patch replaces that approach with a standard
SSA approach using existing LLVM utilities. PHIs are placed at dominance
frontiers; value propagation then eliminates un-necessary PHIs.
This patch also adds a bunch of unit tests that should cover many of the
weirder forms of control flow.
Differential Revision: https://reviews.llvm.org/
D110173
Hsiangkai Wang [Wed, 13 Oct 2021 06:35:56 +0000 (14:35 +0800)]
[RISCV] After reverting _mt builtins, add `ta` argument for LLVM IR.
Previous patch only reverts C builtins for tail policy. In order to keep
LLVM IR intact, add the `ta` argument in vector builtins.
Hsiangkai Wang [Wed, 13 Oct 2021 06:50:45 +0000 (14:50 +0800)]
Revert "[RISCV] (2/2) Add the tail policy argument to builtins/intrinsics."
This reverts commit
7afa61e71877a5b7892ffe4992f804cd84807240.
Nathan Sidwell [Wed, 13 Oct 2021 11:19:39 +0000 (04:19 -0700)]
[clang][NFC] Correct doc markup
Spotted when implementing an extension.
Adam Czachorowski [Tue, 12 Oct 2021 14:52:09 +0000 (16:52 +0200)]
[clangd] TargetFinder: Fix assert-crash on TemplateExpansion args.
Previously we would call getAsTemplate() when kind == TemplateExpansion,
which triggers an assertion. The call is now replaced with
getAsTemplateOrTemplatePattern(), which is exactly the same as
getAsTemplate(), except it allows calls when kind == TemplateExpansion.
No change in behavior for no-assert builds.
Differential Revision: https://reviews.llvm.org/
D111648
Raphael Isemann [Tue, 12 Oct 2021 13:03:31 +0000 (15:03 +0200)]
[lldb][NFC] Split out DW_TAG_inheritance parsing into own function
Just moving that block inside DWARFASTParserClang::ParseChildMembers into
its own function. Also early-exiting instead of a large if when
num_attributes is 0.
Nathan Sidwell [Wed, 13 Oct 2021 11:07:58 +0000 (04:07 -0700)]
[doc][clang] correct version for p0388 implementation
The p0388 patch series took so long, the clang version was incorrect,
and I failed to realize that.
Kerry McLaughlin [Wed, 13 Oct 2021 09:24:43 +0000 (10:24 +0100)]
[SVE][CodeGen] Add patterns for ADD/SUB + element count
This patch adds patterns to match the following with INC/DEC:
- @llvm.aarch64.sve.cnt[b|h|w|d] intrinsics + ADD/SUB
- vscale + ADD/SUB
For some implementations of SVE, INC/DEC VL is not as cheap as ADD/SUB and
so this behaviour is guarded by the "use-scalar-inc-vl" feature flag, which for SVE
is off by default. There are no known issues with SVE2, so this feature is
enabled by default when targeting SVE2.
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/
D111441
Dávid Bolvanský [Wed, 13 Oct 2021 10:15:44 +0000 (12:15 +0200)]
[NFC] Added test for PR50339
Dávid Bolvanský [Wed, 13 Oct 2021 09:46:37 +0000 (11:46 +0200)]
[NFC] Added test for PR49927
Simon Pilgrim [Wed, 13 Oct 2021 09:47:20 +0000 (10:47 +0100)]
[X86][SSE] Add X86ISD::AVG to isCommutativeBinOp to support folding shuffles through the binop
Simon Pilgrim [Wed, 13 Oct 2021 09:25:18 +0000 (10:25 +0100)]
[X86][SSE] Add tests showing missing shuffle(avg(shuffle(),shuffle())) -> avg(shuffle(),shuffle()) fold
X86ISD::AVG needs to be added to isCommutativeBinOp to use these folds.
Jan Svoboda [Wed, 13 Oct 2021 09:23:46 +0000 (11:23 +0200)]
[clang][modules] Avoid using uninitialized SourceLocation
At this point, `F.ImportLoc` has not been initialized by the `ASTReader` yet and using it leads to an assertion failure.
Introduced in
638c673a8c3e27b6532049ac17ac9bc96640fc45 and
444513510999e4c1ea23253654196793834d53bf.
Mehdi Amini [Wed, 13 Oct 2021 09:06:59 +0000 (09:06 +0000)]
Avoid one branch in Operation::getOpOperand()/getOperand() (NFC)
Skip the check on "hasOperandStorage" since the array will be indexed anyway.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/
D111696
Zi Xuan Wu [Wed, 13 Oct 2021 08:51:46 +0000 (16:51 +0800)]
[NFC][CSKY] Remove unneeded MC test case
Balazs Benics [Wed, 13 Oct 2021 08:50:26 +0000 (10:50 +0200)]
[analyzer] Introduce the assume-controlled-environment config option
If the `assume-controlled-environment` is `true`, we should expect `getenv()`
to succeed, and the result should not be considered tainted.
By default, the option will be `false`.
Reviewed By: NoQ, martong
Differential Revision: https://reviews.llvm.org/
D111296
Balazs Benics [Wed, 13 Oct 2021 08:50:26 +0000 (10:50 +0200)]
[analyzer] Bifurcate on getenv() calls
The `getenv()` function might return `NULL` just like any other function.
However, in case of `getenv()` a state-split seems justified since the
programmer should expect the failure of this function.
`secure_getenv(const char *name)` behaves the same way but is not handled
right now.
Note that `std::getenv()` is also not handled.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/
D111245
Diana Picus [Thu, 7 Oct 2021 13:44:14 +0000 (13:44 +0000)]
[flang] Implement GET_ENVIRONMENT_VARIABLE(LENGTH)
Search for the environment variable in the envp string passed to
ProgramStart. This doesn't work if the main program isn't Fortran.
Differential Revision: https://reviews.llvm.org/
D111394
Valentin Clement [Wed, 13 Oct 2021 08:37:56 +0000 (01:37 -0700)]
[fir][NFC] Remove unused variable