Jacques Pienaar [Tue, 12 Oct 2021 19:45:57 +0000 (12:45 -0700)]
[mlir][python] Add nameloc getter
Expose the nameloc getter to Python API.
Differential Revision: https://reviews.llvm.org/D111663
Philip Reames [Tue, 12 Oct 2021 19:01:36 +0000 (12:01 -0700)]
[tests] Add coverage for cases we can drop flags to propagate freeze without cost
Ayal Zaks [Sun, 29 Aug 2021 22:24:21 +0000 (01:24 +0300)]
[LV] Fix 2nd crash for reverse interleaved groups under mask/fold-tail.
This patch fixes another crash revealed by PR51614:
when *deciding* to vectorize with masked interleave groups, check if the access
is reverse (which is currently not supported).
Differential Revision: https://reviews.llvm.org/D108900
Amara Emerson [Mon, 11 Oct 2021 06:38:34 +0000 (23:38 -0700)]
[GlobalISel] Add support for constant vector folding of binops in CSEMIRBuilder.
Differential Revision: https://reviews.llvm.org/D111524
Arthur Eubanks [Mon, 11 Oct 2021 21:45:34 +0000 (14:45 -0700)]
Remove checks for old gcc versions for LLVM_ATTRIBUTE_*
According to [1] we only support gcc 5.1+. So these checks for older gcc versions are not supported.
Some gcc 5.1+ versions still don't support __has_builtin, so just check __GNUC__ in those cases.
Add a missing #endif for LLVM_ATTRIBUTE_UNREACHABLE.
[1] https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D111581
Michael Jones [Mon, 11 Oct 2021 22:11:39 +0000 (22:11 +0000)]
[libc] Add strncat and fix strcat
This adds strncat to llvm libc. In addition, an error was found with
strcat and that was fixed.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D111583
Tobias Gysi [Tue, 12 Oct 2021 17:43:47 +0000 (17:43 +0000)]
[mlir][linalg] Enable the vector transfer lowering by default.
Adapt CodegenStartegy to used the vector transfer lowering patterns by default.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D111649
Vitaly Buka [Tue, 12 Oct 2021 04:29:06 +0000 (21:29 -0700)]
[sanitizer] Fix StackDepotPrintAll
unlock corrupted backets by using s set by loop to nullptr.
Also StackDepot supports iterating without locking.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D111599
William Woodruff [Tue, 12 Oct 2021 17:47:10 +0000 (23:17 +0530)]
[docs] [NFC] Clarify the datalayout documentation
This patch fixes a couple of small oversights in the documentation for
the datalayout specification:
* The v and f specifications are subject to the same constraints on <size>
as i is.
* The p[n] specification didn't mark <idx> as optional, despite
being documented and parsed as such.
* Similarly, none of the alignment specifications require <pref>.
Kevin P. Neal [Tue, 12 Oct 2021 17:42:58 +0000 (13:42 -0400)]
[FPEnv][InstSimplify] Precommit tests: Enable more folds for constrained fsub
Precommit tests for D107285 as requested. TODO notes left at individual
functions also as requested.
Mircea Trofin [Mon, 11 Oct 2021 23:43:28 +0000 (16:43 -0700)]
[Inline] Make sure the InlineAdvisor is correctly cleared.
If another inlining session came after a ModuleInlinerWrapperPass, the
advisor alanysis would still be cached, but its Result would be cleared.
We need to clear both.
This addresses PR52118
Differential Revision: https://reviews.llvm.org/D111586
Artem Dergachev [Tue, 12 Oct 2021 17:19:35 +0000 (10:19 -0700)]
[analyzer] Fix non-obvious analyzer warning: Use of zero-allocated memory.
Clarify the message provided when the analyzer catches the use of memory
that is allocated with size zero.
Differential Revision: https://reviews.llvm.org/D111655
LLVM GN Syncbot [Tue, 12 Oct 2021 17:32:05 +0000 (17:32 +0000)]
[gn build] Port
9cf995be6bb7
LLVM GN Syncbot [Tue, 12 Oct 2021 17:32:04 +0000 (17:32 +0000)]
[gn build] Port
838b4a533e68
Nico Weber [Tue, 12 Oct 2021 17:31:50 +0000 (13:31 -0400)]
[gn build] (manually) port
67f94e5a9745
Nico Weber [Mon, 11 Oct 2021 18:26:09 +0000 (14:26 -0400)]
[clang/CFG] Don't explicitly add AttributedStmtClass to AlwaysAddList
CFGBuilder::addStmt() implicitly passes AddStmtChoice::AlwaysAdd
to Visit() already, so this should have no behavior change.
Differential Revision: https://reviews.llvm.org/D111570
Roman Lebedev [Tue, 12 Oct 2021 17:24:17 +0000 (20:24 +0300)]
[X86] `detectAVGPattern()`: don't require zext in the with-constant case
Roman Lebedev [Tue, 12 Oct 2021 17:19:18 +0000 (20:19 +0300)]
[NFC][X86] Add another test case for PR52131
Lang Hames [Tue, 12 Oct 2021 16:48:29 +0000 (09:48 -0700)]
[Support][ORC] Add an explicit release operation to OwningMemoryBlock.
This gives OwningMemoryBlock clients a way to check for errors on release.
rdar://
84127175
Roman Lebedev [Tue, 12 Oct 2021 17:11:45 +0000 (20:11 +0300)]
[NFC][X86] `detectAVGPattern()`: rely on `AVGSplitter()` to perform truncation
Benjamin Kramer [Tue, 12 Oct 2021 16:01:54 +0000 (18:01 +0200)]
[mlir][Shape] Add a pattern to turn extract from shape_of into tensor.dim
If I remember correctly this wasn't done previously because dim used to
be in the memref dialect.
Differential Revision: https://reviews.llvm.org/D111651
Stanislav Mekhanoshin [Fri, 8 Oct 2021 20:04:32 +0000 (13:04 -0700)]
[AMDGPU] Promote generic pointer kernel arguments into global
The new pass walks kernel's pointer arguments, then loads from them.
If a loaded value is a pointer and loaded pointer is unmodified in
the kernel before the load, then promote loaded pointer to global.
Then recursively continue.
Differential Revision: https://reviews.llvm.org/D111464
Sanjay Patel [Tue, 12 Oct 2021 16:18:29 +0000 (12:18 -0400)]
[InstCombine] propagate no-wrap flag through select-of-mul fold
This may not be obvious, but Alive2 agrees:
https://alive2.llvm.org/ce/z/Ld9qNT
If the mul has "nsw", then -1 * INT_MIN is poison, so the
negate can also have "nsw" because 0 - INT_MIN is poison.
If the mul has "nuw", then that means the "OtherOp" can only
be 0 or 1 (anything else multiplied by 0xfff... would wrap).
So the replacement negate must be "nsw" because it is either
"0-0" or "0-1".
This is another regression noticed with a planned follow-up
to D111410.
Sanjay Patel [Tue, 12 Oct 2021 15:47:03 +0000 (11:47 -0400)]
[InstCombine] add tests with nsw/nuw for mul-of-select; NFC
Roman Lebedev [Tue, 12 Oct 2021 16:43:51 +0000 (19:43 +0300)]
[X86] `detectAVGPattern()`: support basic case of PAVG chaining (PR52131)
As noted in https://github.com/halide/Halide/pull/6302,
we hilariously fail to match PAVG if we even as much
as look at it the wrong way.
In this particular case, the problem stems from the fact that
`PAVG` root (def) is a `trunc`, and leafs (uses) are `zext`'s,
and InstCombine really loves to get rid of both of these,
for example replace them with a bit mask. So we may not have
said `zext`.
Instead of checking for that + type match,
i think we should rely on the actual active type,
as per the knownbits.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D111571
Roman Lebedev [Tue, 12 Oct 2021 16:42:24 +0000 (19:42 +0300)]
[X86] `detectAVGPattern()`: small preparatory NFC refactor
Nimish Mishra [Tue, 12 Oct 2021 16:44:21 +0000 (22:14 +0530)]
Added OpenMP 5.0 specification based semantic checks for CRITICAL construct name resolution
As reported in https://bugs.llvm.org/show_bug.cgi?id=48145, name resolution for omp critical construct was failing. This patch adds functionality to help that name resolution as well as implementation to catch name mismatches.
The following semantic restrictions are therefore handled here:
- If a name is specified on a critical directive, the same name must also be specified on the end critical directive
- If no name appears on the critical directive, no name can appear on the end critical directive
- If a name appears on either the start critical directive or the end critical directive
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D110502
Hongtao Yu [Thu, 30 Sep 2021 16:13:41 +0000 (09:13 -0700)]
[CSSPGO] Unblock optimizations with pseudo probe instrumentation part 3.
This patch continues unblocking optimizations that are blocked by pseudo probe instrumentation.
Not exactly like DbgIntrinsics, PseudoProbe intrinsic has other attributes (such as mayread, maywrite, mayhaveSideEffect) that can block optimizations. The issues fixed are:
- Flipped default param of getFirstNonPHIOrDbg API to skip pseudo probes
- Unblocked CSE by avoiding pseudo probe from clobbering memory SSA
- Unblocked induction variable simpliciation
- Allow empty loop deletion by treating probe intrinsic isDroppable
- Some refactoring.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D110847
peter klausler [Wed, 6 Oct 2021 21:03:48 +0000 (14:03 -0700)]
[flang] More work on SYSTEM_CLOCK runtime API and implementation
To get proper wrap-around behavior for the various kind parameter
values of the optional COUNT= and COUNT_MAX= dummy arguments to
the intrinsic subroutine SYSTEM_CLOCK, add an extra argument to
the APIs for lowering to pass the integer kind of the actual argument.
Avoid confusion by requiring that both actual arguments have the same
kind when both are present. The results of the runtime functions
remain std::int64_t and lowering should still convert them before
storing to the actual argument variables.
Rework the implementation a bit to accomodate the dynamic
specification of the kind parameter, and to clean up some coding
issues with preprocessing and templates.
Use the kind of the COUNT=/COUNT_MAX= actual arguments to determine
the clock's resolution, where possible, in conformance with other
Fortran implementations.
Differential Revision: https://reviews.llvm.org/D111281
Kazu Hirata [Tue, 12 Oct 2021 16:19:48 +0000 (09:19 -0700)]
[AST, CodeGen, Driver] Use llvm::is_contained (NFC)
Craig Topper [Tue, 12 Oct 2021 15:46:08 +0000 (08:46 -0700)]
[TableGen] Fix both sides of '&&' are same
The operand of the second any_of in EnforceSmallerThan should be
B not S like the FP code in the if below.
Unfortunately, fixing that causes an infinite loop in the build
of RISCV. So I've added a workaround for that as well.
Fixes PR44768.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D111502
Saiyedul Islam [Sat, 9 Oct 2021 12:06:11 +0000 (12:06 +0000)]
[Clang][clang-nvlink-wrapper] Pass nvlink path to the wrapper
Added support of a "--nvlink-path" option in clang-nvlink-wrapper which
takes the path of nvlink binary.
Static Device Library support for OpenMP (D105191) now searches for
nvlink binary and passes its location via this option. In absence
of this option, nvlink binary is searched in locations in PATH.
Differential Revision: https://reviews.llvm.org/D111488
Mark de Wever [Sun, 10 Oct 2021 13:18:46 +0000 (15:18 +0200)]
[libc++] Use addressof to fix debug tests.
Fixes the tests added in D110852 for the debug iterators.
Similar issues with hijacking `operator&` still exist, they will be
addressed separately.
Reviewed By: #libc, ldionne, Quuxplusone
Differential Revision: https://reviews.llvm.org/D111564
Jeremy Morse [Tue, 12 Oct 2021 16:05:51 +0000 (17:05 +0100)]
Scatter NDEBUG to fix after
838b4a533e6
These "dump" methods call into MachineOperand::dump, which doesn't exist
with NDEBUG, thus we croak. Disable LiveDebugValues dump methods when
NDEBUG is turned on to avoid this.
David Tenty [Tue, 12 Oct 2021 15:53:12 +0000 (11:53 -0400)]
[libcxx][AIX] Explicitly include localedef.h in locale.cpp
This header was transitively included to provide the definition of
__lc_ctype_ptr that we use on AIX, but that is fragile as it depends on
the settings of compatibility macros, so we explicitly include it here
to avoid that scenario.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D111239
Aart Bik [Tue, 12 Oct 2021 00:11:13 +0000 (17:11 -0700)]
[mlir][sparse] add action enum, group enums together, few asserts
Some random changes that were hanging around in my workspace. Also,
a tiny step towards creating a header file for the sparse utils lib.
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D111589
Lei Zhang [Tue, 12 Oct 2021 15:39:56 +0000 (11:39 -0400)]
[mlir][vector] Add folder for no-op InsertStridedSliceOp
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D111636
Mike Urbach [Mon, 11 Oct 2021 23:23:42 +0000 (16:23 -0700)]
[mlir] Limit Python dependency to Development.Module when possible.
After CMake 3.18, we are able to limit the scope of the search to just
Development.Module. Searching for Development will fail in situations
where the Python libraries are not available. When possible, limit to
just Development.Module. See:
https://pybind11.readthedocs.io/en/stable/compiling.html#findpython-mode
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D111585
Mark de Wever [Sun, 6 Jun 2021 12:48:08 +0000 (14:48 +0200)]
[libc++] Update atomic synopsis and tests.
While looking at LWG-2988 and P0558 it seems the issues were already
implemented, but the synopsis wasn't updated. Some of the tests didn't
validate the `noexcept` status. A few tests were missing completely:
- `atomic_wait_explicit`
- `atomic_notify_one`
- `atomic_notify_all`
Mark P0558 as complete, didn't investigate which version of libc++ first
includes this. It seems the paper has been retroactively applied. I
couldn't find whether this is correct, but looking at cppreference it
seems intended.
Completes
- LWG-2988 Clause 32 cleanup missed one typename
- P0558 Resolving atomic<T> named base class inconsistencies
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D103765
Martin Storsjö [Fri, 27 Aug 2021 10:09:19 +0000 (10:09 +0000)]
[libcxx] [test] Make windows triples in XFAILs less specific
This allows picking up on mingw triples that often use 'w64' instead
of 'pc' as the vendor part.
Differential Revision: https://reviews.llvm.org/D111297
Jay Foad [Tue, 12 Oct 2021 15:19:35 +0000 (16:19 +0100)]
Revert "[AMDGPU] Enable load clustering in the post-RA scheduler"
This reverts commit
66e13c7f439cf162d7ed1d25883e71a5755ac7ec.
It was committed by accident.
Jay Foad [Tue, 12 Oct 2021 08:15:07 +0000 (09:15 +0100)]
[TwoAddressInstruction] Remove ad hoc machine verification
With the -early-live-intervals command line flag,
TwoAddressInstructionPass::runOnMachineFunction would call
MachineFunction::verify before returning to check the live intervals.
But there was not much benefit to doing this since -verify-machineinstrs
and LLVM_ENABLE_EXPENSIVE_CHECKS provide a more general way of
scheduling machine verification after every pass.
Also it caused problems on targets like Lanai which are marked as "not
machine verifier clean", since verification would fail for known
target-specific problems which are nothing to do with LiveIntervals.
Differential Revision: https://reviews.llvm.org/D111618
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%.
Jeremy Morse [Tue, 12 Oct 2021 14:55:46 +0000 (15:55 +0100)]
[DebugInfo][NFC] Move LiveDebugValues class to header
This patch shifts the InstrRefBasedLDV class declaration to a header.
Partially because it's already massive, but mostly so that I can start
writing some unit tests for it. This patch also adds the boilerplate for
said unit tests.
Differential Revision: https://reviews.llvm.org/D110165
Tobias Gysi [Tue, 12 Oct 2021 14:53:33 +0000 (14:53 +0000)]
[mlir][linalg] Add switch to disable/enable vector transfer lowering.
Add a switch to code gen strategy to disable/enable the vector transfer lowering and disable it by default.
Differential Revision: https://reviews.llvm.org/D111647
Bradley Smith [Tue, 5 Oct 2021 12:20:58 +0000 (12:20 +0000)]
[AArch64][SVE] Add fixed type lowering for EXTRACT_SUBVECTOR
Depends on D111135
Differential Revision: https://reviews.llvm.org/D111165
Nathan Sidwell [Fri, 21 May 2021 18:34:23 +0000 (11:34 -0700)]
[clang] p0388 array list initialization overloads
This is the second part of p0388, dealing with overloads of list
initialization to incomplete array types. It extends the handling
added in D103088 to permit incomplete arrays. We have to record that
the conversion involved an incomplete array, and so (re-add) a bit flag
into the standard conversion sequence object. Comparing such
conversion sequences requires knowing (a) the number of array elements
initialized and (b) whether the initialization is of an incomplete array.
This also updates the web page to indicate p0388 is implemented (there
is no feature macro).
Differential Revision: https://reviews.llvm.org/D103908
Nathan Sidwell [Thu, 20 May 2021 20:31:31 +0000 (13:31 -0700)]
[clang] p0388 conversion to incomplete array
This implements the new implicit conversion sequence to an incomplete
(unbounded) array type. It is mostly Richard Smith's work, updated to
trunk, testcases added and a few bugs fixed found in such testing.
It is not a complete implementation of p0388.
Differential Revision: https://reviews.llvm.org/D102645
Balázs Kéri [Tue, 12 Oct 2021 14:43:16 +0000 (16:43 +0200)]
[clang-tidy] Update documentation of check bugprone-unused-return-value [NFC].
The list of checked functions was incomplete in the description.
Reviewed By: aaron.ballman, steakhal
Differential Revision: https://reviews.llvm.org/D111623
Tobias Gysi [Tue, 12 Oct 2021 13:50:25 +0000 (13:50 +0000)]
[mlir][linalg] Add vector transfer lowering patters to codegen strategy.
Add the vector transfer patterns and introduce the max transfer rank option on the codegen strategy.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D111635
Siger Yang [Tue, 12 Oct 2021 14:08:05 +0000 (22:08 +0800)]
[lldb/lua] Supplement Lua bindings for lldb module
Add necessary typemaps for Lua bindings, together with some other files.
Signed-off-by: Siger Yang <sigeryeung@gmail.com>
Reviewed By: tammela
Differential Revision: https://reviews.llvm.org/D108090
Carlos Galvez [Tue, 12 Oct 2021 14:05:43 +0000 (10:05 -0400)]
Remove 'IgnoreDestructors = true' from cppcoreguidelines-explicit-virtual-functions
This requirement was introduced in the C++ Core guidelines in 2016:
https://github.com/isocpp/CppCoreGuidelines/commit/
1894380d0abf4d7d49a983005647e0d41ecbf214
Then clang-tidy got updated to comply with the rule.
However in 2019 this decision was reverted:
https://github.com/isocpp/CppCoreGuidelines/commit/
5fdfb20b760c5307bf86873798a146fcd7e912e6
Therefore we need to apply the correct configuration to
clang-tidy again.
This also makes this cppcoreguidelines check consistent
with the other 2 alias checks: hicpp-use-override and
modernize-use-override.
Additionally, add another RUN line to the unit test,
to make sure cppcoreguidelines-explicit-virtual-functions
is tested.
Ahsan Saghir [Mon, 13 Sep 2021 01:48:48 +0000 (20:48 -0500)]
[PowerPC] Allow MMA built-ins to accept restrict and volatile qualified pointers
This patch allows MMA built-ins on PowerPC to accept restrict
and volatile qualified pointers.
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D106550
Hans Wennborg [Tue, 12 Oct 2021 13:51:01 +0000 (15:51 +0200)]
Add self to .mailmap
Siger Yang [Tue, 12 Oct 2021 13:02:21 +0000 (21:02 +0800)]
[lldb/lua] Force Lua version to be 5.3
Due to CMake cache, find_package in FindLuaAndSwig.cmake
will be ignored. This commit adds EXACT and REQUIRED flags
to it and removes find_package in Lua ScriptInterpreter.
Signed-off-by: Siger Yang <sigeryeung@gmail.com>
Reviewed By: tammela, JDevlieghere
Differential Revision: https://reviews.llvm.org/D108515
Nicolas Vasilache [Tue, 12 Oct 2021 13:27:41 +0000 (13:27 +0000)]
[mlir][Vector][Bigfix] Fix vector transfer to store lowering to insert a proper ExtractOp
Differential Revision: https://reviews.llvm.org/D111641
Michał Górny [Fri, 20 Aug 2021 10:11:45 +0000 (12:11 +0200)]
[lldb] [gdb-remote] Fix displaying i387_ext & vec regs with gdbserver
Adjust the encoding and format applied to i387_ext and vec* type
registers from gdbserver to match lldb-server. Both types are now
displayed as vector of uint8 instead of float and integer formats used
before. Additionally, this fixes display of STi registers when they do
not carry floating-point data (they are also used to hold MMX vectors).
Differential Revision: https://reviews.llvm.org/D108468
Nico Weber [Mon, 11 Oct 2021 18:19:21 +0000 (14:19 -0400)]
[clang] Omit most AttributedStatements from the CFG
`[[clang::fallthrough]]` has meaning for the CFG, but all other
StmtAttrs we currently have don't. So omit them, as AttributedStatements
with children cause several issues and there's no benefit in including
them.
Fixes PR52103 and PR49454. See PR52103 for details.
Differential Revision: https://reviews.llvm.org/D111568
Nicolas Vasilache [Tue, 12 Oct 2021 12:56:40 +0000 (12:56 +0000)]
mlir][Vector] Fix spuriously disabled test.
Nicolas Vasilache [Tue, 12 Oct 2021 12:39:26 +0000 (12:39 +0000)]
[mlir][Linalg] Refactor and improve vectorization to add support for reduction into 0-d tensors.
This revision takes advantage of the recently added support for 0-d transfers and vector.multi_reduction that return a scalar.
Reviewed By: pifon2a
Differential Revision: https://reviews.llvm.org/D111626
Lei Zhang [Tue, 12 Oct 2021 12:35:16 +0000 (08:35 -0400)]
[mlir][tensor] Add some folders for insert/extract slice ops
* Fold extract_slice immediately after insert_slice.
* Fold overlapping insert_slice.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D111439
Nicolas Vasilache [Tue, 12 Oct 2021 12:35:55 +0000 (12:35 +0000)]
[mlir][Vector] NFC - Add test to exercise lowering of vector.transfer to scf
This revision also renames and moves some tests around.
Differential Revision: https://reviews.llvm.org/D111606
Simon Pilgrim [Tue, 12 Oct 2021 12:23:02 +0000 (13:23 +0100)]
[X86] Fix implicit MathsExtras.h header dependency
Nicolas Vasilache [Tue, 12 Oct 2021 12:26:30 +0000 (12:26 +0000)]
[mlir][Vector] Add support for lowering 0-d transfers to load/store.
Reviewed By: pifon2a
Differential Revision: https://reviews.llvm.org/D111603
Kerry McLaughlin [Mon, 11 Oct 2021 10:06:36 +0000 (11:06 +0100)]
[LoopVectorize] Classify pointer induction updates as scalar only if they have one use
collectLoopScalars collects pointer induction updates in ScalarPtrs, assuming
that the instruction will be scalar after vectorization. This may crash later
in VPReplicateRecipe::execute() if there there is another user of the instruction
other than the Phi node which needs to be widened.
This changes collectLoopScalars so that if there are any other users of
Update other than a Phi node, it is not added to ScalarPtrs.
Reviewed By: david-arm, fhahn
Differential Revision: https://reviews.llvm.org/D111294
Nicolas Vasilache [Tue, 12 Oct 2021 11:37:55 +0000 (11:37 +0000)]
[mlir][Vector] Allow a 0-d for for vector transfer ops.
This revision updates the op semantics, printer, parser and verifier to allow 0-d transfers.
Until 0-d vectors are available, such transfers have a special form that transits through vector<1xt>.
This is a stepping stone towards the longer term work of adding 0-d vectors and will help significantly reduce corner cases in vectorization.
Transformations and lowerings do not yet support this form, extensions will follow.
Differential Revision: https://reviews.llvm.org/D111559
Nicolas Vasilache [Tue, 12 Oct 2021 11:04:11 +0000 (11:04 +0000)]
[mlir][Linalg] NFC - Refactor vector.broadcast op verification logic and make it available as a precondition in Linalg vectorization.
Reviewed By: pifon2a
Differential Revision: https://reviews.llvm.org/D111558
Florian Hahn [Tue, 12 Oct 2021 11:13:45 +0000 (12:13 +0100)]
[LoopPeel] Use any_of & contains instead of for & find.
Using contains was suggested in D108114, but I forgot to include it when
landing the patch.
Nicolas Vasilache [Tue, 12 Oct 2021 10:30:10 +0000 (10:30 +0000)]
[mlir][Vector] Let vector.multi_reduction reduce down to a scalar.
vector.multi_reduction currently does not allow reducing down to a scalar.
This creates corner cases that are hard to handle during vectorization.
This revision extends the semantics and adds the proper transforms, lowerings and canonicalizations to allow lowering out of vector.multi_reduction to other abstractions all the way to LLVM.
In a future, where we will also allow 0-d vectors, scalars will still be relevant: 0-d vector and scalars are not equivalent on all hardware.
In the process, splice out the implementation patterns related to vector.multi_reduce into a new file.
Reviewed By: pifon2a
Differential Revision: https://reviews.llvm.org/D111442
Shraiysh Vaishay [Tue, 12 Oct 2021 10:47:30 +0000 (10:47 +0000)]
[mlir][OpenMP] OpenMP Synchronization Hints stored as IntegerAttr
`hint-expression` is an IntegerAttr, because it can be a combination of multiple values from the enum `omp_sync_hint_t` (Section 2.17.12 of OpenMP 5.0)
Reviewed By: ftynse, kiranchandramohan
Differential Revision: https://reviews.llvm.org/D111360
LLVM GN Syncbot [Tue, 12 Oct 2021 10:50:41 +0000 (10:50 +0000)]
[gn build] Port
f4c1258d5633
Sjoerd Meijer [Tue, 12 Oct 2021 10:03:34 +0000 (11:03 +0100)]
[FuncSpec] Allow ConstExprs that are function pointers
This is a follow up of D110529 that disallowed constexprs. That change
introduced a regression as this also disallowed constexprs that are function
pointers, which is actually one of the motivating use cases that we do want to
support.
Differential Revision: https://reviews.llvm.org/D111567
Florian Hahn [Tue, 12 Oct 2021 10:10:40 +0000 (11:10 +0100)]
[LoopPeel] Peel if it turns invariant loads dereferenceable.
This patch adds a new cost heuristic that allows peeling a single
iteration off read-only loops, if the loop contains a load that
1. is feeding an exit condition,
2. dominates the latch,
3. is not already known to be dereferenceable,
4. and has a loop invariant address.
If all non-latch exits are terminated with unreachable, such loads
in the loop are guaranteed to be dereferenceable after peeling,
enabling hoisting/CSE'ing them.
This enables vectorization of loops with certain runtime-checks, like
multiple calls to `std::vector::at` if the vector is passed as pointer.
Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D108114
Jan Svoboda [Tue, 12 Oct 2021 10:23:38 +0000 (12:23 +0200)]
[clang][deps] Prune unused header search paths
To reduce the number of explicit builds of a single module, we can try to squash multiple occurrences of the module with different command-lines (and context hashes) by removing benign command-line options. The greatest contributors to benign differences between command-lines are the header search paths.
In this patch, the lookup cache in `HeaderSearch` is used to identify paths that were actually used when implicitly building the module during scanning. This information is serialized into the unhashed control block of the implicitly-built PCM. The dependency scanner then loads this and may use it to prune the header search paths before computing the context hash of the module and generating the command-line.
We could also prune the header search paths when serializing `HeaderSearchOptions` into the PCM. That way, we could do it only once instead of every load of the PCM file by dependency scanner. However, that would result in a PCM file whose contents don't produce the same context hash as the original build, which is probably highly surprising.
There is an alternative approach to storing extra information into the PCM: wire up preprocessor callbacks to capture the used header search paths on-the-fly during preprocessing of modularized headers (similar to what we currently do for the main source file and textual headers). Right now, that's not compatible with the fact that we do an actual implicit build producing PCM files during dependency scanning. The second run of dependency scanner loads the PCM from the first run, skipping the preprocessing altogether, which would result in different results between runs. We can revisit this approach when we stop building implicitly during dependency scanning.
Depends on D102923.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D102488
Nico Weber [Tue, 12 Oct 2021 10:34:34 +0000 (06:34 -0400)]
[gn build] (manually) port
f4c1258d5633
Vladislav Vinogradov [Mon, 11 Oct 2021 14:02:03 +0000 (17:02 +0300)]
[mlir] Allow to use vformat utility with MLIR classes
Make `raw_ostream operator<<` follow const correctness semantic,
since it is a requirement of FormatVariadic implementation.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D111547
jacquesguan [Tue, 12 Oct 2021 09:54:40 +0000 (09:54 +0000)]
[RISCV][Clang] Fix RISCV vector header comment.
Reviewed By: khchen
Differential Revision: https://reviews.llvm.org/D111597
Jan Svoboda [Tue, 12 Oct 2021 07:34:43 +0000 (09:34 +0200)]
[clang][lex] Remark on search path usage
For dependency scanning, it would be useful to collect header search paths (provided on command-line via `-I` and friends) that were actually used during preprocessing. This patch adds that feature to `HeaderSearch` along with a new remark that reports such paths as they get used.
Previous version of this patch tried to use the existing `LookupFileCache` to report used paths via `HitIdx`. That doesn't work for `ComputeUserEntryUsage` (which is intended to be called *after* preprocessing), because it indexes used search paths by the file name. This means the values get overwritten when the code contains `#include_next`.
Note that `HeaderSearch` doesn't use `HeaderSearchOptions::UserEntries` directly. Instead, `InitHeaderSearch` pre-processes them (adds platform-specific paths, removes duplicates, removes paths that don't exist) and creates `DirectoryLookup` instances. This means we need a mechanism for translating between those two. It's not possible to go from `DirectoryLookup` back to the original `HeaderSearch`, so `InitHeaderSearch` now tracks the relationships explicitly.
Depends on D111557.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D102923
Louis Dionne [Mon, 23 Aug 2021 19:32:36 +0000 (15:32 -0400)]
[libc++] Add an option to disable wide character support in libc++
Some embedded platforms do not wish to support the C library functionality
for handling wchar_t because they have no use for it. It makes sense for
libc++ to work properly on those platforms, so this commit adds a carve-out
of functionality for wchar_t.
Unfortunately, unlike some other carve-outs (e.g. random device), this
patch touches several parts of the library. However, despite the wide
impact of this patch, I still think it is important to support this
configuration since it makes it much simpler to port libc++ to some
embedded platforms.
Differential Revision: https://reviews.llvm.org/D111265
Caitlyn Cano [Thu, 1 Jul 2021 20:41:51 +0000 (20:41 +0000)]
[mlir] Make ConversionTarget dynamic legality callbacks composable
* Change callback signature `bool(Operation *)` -> `Optional<bool>(Operation *)`
* addDynamicallyLegalOp add callback to the chain
* If callback returned empty `Optional` next callback in chain will be called
Differential Revision: https://reviews.llvm.org/D110487
Andrew Ng [Thu, 7 Oct 2021 16:57:57 +0000 (17:57 +0100)]
[ELF][test] Add testing for dynamic TLS relocations in .debug_info
Differential Revision: https://reviews.llvm.org/D111436
Sven van Haastregt [Tue, 12 Oct 2021 09:45:30 +0000 (10:45 +0100)]
[OpenCL] Add atomic_half type builtins
Add atomic_half types and builtins operating on the types from the
cl_ext_float_atomics extension.
Patch by Haonan Yang.
Differential Revision: https://reviews.llvm.org/D109740
Nimish Mishra [Tue, 12 Oct 2021 09:41:29 +0000 (15:11 +0530)]
[flang][OpenMP] Added test case for OpenMP 5.0 specification based semantic checks for parallel sections construct
Parallel sections directive borrows the semantic checks from both sections directive and parallel directive. Semantic checks for both are merged in main branch; this test case is added to make sure correct semantic checks upon merging the two.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D111438
Vladislav Vinogradov [Mon, 11 Oct 2021 11:52:06 +0000 (14:52 +0300)]
[mlir] Fix AsmPrinter for types with sub elements
Call `printType(subElemType)` instead of `os << subElemType` for them.
It allows to handle type aliases inside complex types.
As a side effect, fixed `test.int` parsing.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D111536
Vladislav Vinogradov [Mon, 20 Sep 2021 14:35:57 +0000 (17:35 +0300)]
[mlir] Clean up boolean flags usage in LIT tests
* Call `llvm_canonicalize_cmake_booleans` for all CMake options,
which are propagated to `lit.local.cfg` files.
* Use Python native boolean values instead of strings for such options.
This fixes the cases, when CMake variables have values other than `ON` (like `TRUE`).
This might happen due to IDE integration or due to CMake preset usage.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D110073
Roger Ferrer Ibanez [Tue, 12 Oct 2021 08:27:01 +0000 (10:27 +0200)]
[SelectionDAG] Fix typo in VPLoadStoreSDNode
There is no code that uses this base class yet, hence the typo went
unnoticed when this class was added in D105871
Differential Revision: https://reviews.llvm.org/D110930
Diana Picus [Wed, 6 Oct 2021 10:56:10 +0000 (10:56 +0000)]
[flang] Add runtime interface for GET_ENVIRONMENT_VARIABLE
Split into 2 entry points, one for the length and one for the value.
Differential Revision: https://reviews.llvm.org/D111392
Qiu Chaofan [Tue, 12 Oct 2021 08:03:17 +0000 (16:03 +0800)]
Pre-commit pre-inc-disable.ll to avoid dead code
The case was added in 728e139, testing it outputs lxsibzx instead of
lbzux. Here we need some minimal update to avoid DCE in future patches.
Jan Svoboda [Tue, 12 Oct 2021 07:55:40 +0000 (09:55 +0200)]
[clang][modules] Default `SourceLocation` parameter in `HeaderSearch::lookupModule`
This fixes an LLDB build failure where the `ImportLoc` argument is missing: https://lab.llvm.org/buildbot#builders/68/builds/19975
This change also makes it possible to drop `SourceLocation()` in `Preprocessor::getCurrentModule`.
Victor Campos [Tue, 12 Oct 2021 07:41:07 +0000 (08:41 +0100)]
[docs] List support for Armv9-A, Armv9.1-A and Armv9.2-A in LLVM and Clang
Reviewed By: pratlucas
Differential Revision: https://reviews.llvm.org/D110241
Jan Svoboda [Tue, 12 Oct 2021 07:04:37 +0000 (09:04 +0200)]
[clang][modules] NFC: Propagate import `SourceLocation` into `HeaderSearch::lookupModule`
This patch propagates the import `SourceLocation` into `HeaderSearch::lookupModule`. This enables remarks on search path usage (implemented in D102923) to point to the source code that initiated header search.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D111557
Valentin Clement [Tue, 12 Oct 2021 07:24:58 +0000 (09:24 +0200)]
[fir][NFC] Add two negative tests for needExternalNameMangling
Add two test for needExternalNameMangling.
- One varibale in a function
- One namelist in a module
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D111544
jacquesguan [Tue, 12 Oct 2021 06:46:46 +0000 (06:46 +0000)]
[RISCV] Rename assembler mnemonic of unordered floating-point reductions for v1.0-rc change
Rename vfredsum and vfwredsum to vfredusum and vfwredusum. Add aliases for vfredsum and vfwredsum.
Reviewed By: luismarques, HsiangKai, khchen, frasercrmck, kito-cheng, craig.topper
Differential Revision: https://reviews.llvm.org/D105690
Lang Hames [Tue, 12 Oct 2021 05:32:07 +0000 (22:32 -0700)]
[ORC] More attempts to work around compiler failures.
Commit
731f991cdc4 seems to have helped, but did not catch all instances (see
https://lab.llvm.org/buildbot/#/builders/193/builds/104). Switch more inner
structs to C++98 initializers to work around the issue. Add FIXMEs to revisit
in the future.
Lang Hames [Tue, 12 Oct 2021 05:19:46 +0000 (22:19 -0700)]
[ORC] Attempt to work around compile failure on some bots.
See e.g. https://lab.llvm.org/buildbot/#/builders/193/builds/98.
I think this failure is related to a C++ standard defect, 1397 --"Class
completeness in non-static data member initializers" [1]. If so, moving
to C++98 initialization should work around the issue.
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1397
Yonghong Song [Mon, 11 Oct 2021 23:37:36 +0000 (16:37 -0700)]
[Clang][Attr] rename btf_tag to btf_decl_tag
Current btf_tag is applied to declaration only.
Per discussion in https://reviews.llvm.org/D111199,
we plan to introduce btf_type_tag attribute for types.
So rename btf_tag to btf_decl_tag to make it easily
differentiable from btf_type_tag.
Differential Revision: https://reviews.llvm.org/D111588
modimo [Tue, 12 Oct 2021 05:03:32 +0000 (22:03 -0700)]
[NFC][LangRef] Update description for FuncFlags
Add the additional flags from D36850 as well as noInline/alwaysInline from previous changes.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D111600
Lang Hames [Tue, 12 Oct 2021 04:59:22 +0000 (21:59 -0700)]
[ORC] Add more explicit narrowing casts.
This should fix the buildbot failure at
https://lab.llvm.org/buildbot/#/builders/187/builds/2140
LLVM GN Syncbot [Tue, 12 Oct 2021 04:51:58 +0000 (04:51 +0000)]
[gn build] Port
962a2479b57f
Lang Hames [Tue, 12 Oct 2021 04:50:46 +0000 (21:50 -0700)]
[ORC] Fix a typo in a variable name.