Joseph Huber [Wed, 23 Dec 2020 14:16:55 +0000 (09:16 -0500)]
[OpenMP] Fixing Typo in Documentation
David Penry [Wed, 23 Dec 2020 14:00:59 +0000 (14:00 +0000)]
[ARM] Add bank conflict hazarding
Adds ARMBankConflictHazardRecognizer. This hazard recognizer
looks for a few situations where the same base pointer is used and
then checks whether the offsets lead to a bank conflict. Two
parameters are also added to permit overriding of the target
assumptions:
arm-data-bank-mask=<int> - Mask of bits which are to be checked for
conflicts. If all these bits are equal in the offsets, there is a
conflict.
arm-assume-itcm-bankconflict=<bool> - Assume that there will be bank
conflicts on any loads to a constant pool.
This hazard recognizer is enabled for Cortex-M7, where the Technical
Reference Manual states that there are two DTCM banks banked using bit
2 and one ITCM bank.
Differential Revision: https://reviews.llvm.org/D93054
Simon Moll [Wed, 23 Dec 2020 13:21:41 +0000 (14:21 +0100)]
[NFC] Uniquify 'const' in TargetTransformInfoImpl.h
Some member functions of class TargetTransformInfoImplBase in
TargetTransformInfoImpl.h are marked const while others are not. Yet all
of the should be marked const since they are just providing default TTI
values. This patch fixes the inconsistency.
Authored-by: Jinzheng Tu <b1f6c1c4@gmail.com>
Reviewed By: simoll
Differential revision: https://reviews.llvm.org/D93573
Simon Moll [Wed, 23 Dec 2020 12:27:55 +0000 (13:27 +0100)]
[VE] Vector 'and' isel and tests
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D93709
Alex Zinenko [Tue, 22 Dec 2020 10:22:56 +0000 (11:22 +0100)]
[mlir] Remove static constructors from LLVMType
LLVMType contains numerous static constructors that were initially introduced
for API compatibility with LLVM. Most of these merely forward to arguments to
`SpecificType::get` (MLIR defines classes for all types, unlike LLVM IR), while
some introduce subtle semantics differences due to different modeling of MLIR
types (e.g., structs are not auto-renamed in case of conflicts). Furthermore,
these constructors don't match MLIR idioms and actively prevent us from making
the LLVM dialect type system more open. Remove them and use `SpecificType::get`
instead.
Depends On D93680
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D93681
Nathan James [Wed, 23 Dec 2020 12:08:28 +0000 (12:08 +0000)]
[format] Add overload to parseConfiguration that accept llvm::MemoryBufferRef
This overload should be used for better diagnostics when parsing configurations.
Now a failure to parse will list the filename (or <command-line>) instead of just `YAML`.
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D93633
Adrian Kuegel [Wed, 23 Dec 2020 11:31:52 +0000 (12:31 +0100)]
Revert "PR24076, PR33655, C++ CWG 1558: Consider the instantiation-dependence of"
This reverts commit
d3bf0bb18952d830fe6df6f791a64552b271000b.
This causes compilation in certain cases to fail.
Reproducer TBD.
Christian Sigg [Wed, 23 Dec 2020 10:37:49 +0000 (11:37 +0100)]
[mlir] Rename ConvertToLLVMPattern::isSupportedMemRefType() to isConvertibleAndHasIdentityMaps().
Reviewed By: ftynse, herhut
Differential Revision: https://reviews.llvm.org/D93752
Alex Zinenko [Tue, 8 Dec 2020 15:45:19 +0000 (16:45 +0100)]
[mlir] Add translation of omp.wsloop to LLVM IR
Introduce a translation of OpenMP workshare loop construct to LLVM IR. This is
a minimalist version to enable the pipeline and currently only supports static
loop schedule (default in the specification) on non-collapsed loops. Other
features will be added on per-need basis.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D92055
Christian Sigg [Wed, 23 Dec 2020 09:51:23 +0000 (10:51 +0100)]
[mlir] NFC: Remove ConvertToLLVMPattern::getDataPtr(). All call sites use getStridedElementPtr() now.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D93751
Alex Zinenko [Wed, 23 Dec 2020 10:19:35 +0000 (11:19 +0100)]
[mlir] Modernize std-to-llvm operation conversion doc
This was long overdue. Replace the outdated type syntax with the new syntax,
and update the description of how memref load/stores are handled to reflect the
latest changes in the implementation.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D93555
Sebastian Neubauer [Tue, 22 Dec 2020 12:53:38 +0000 (13:53 +0100)]
[AMDGPU][GlobalISel] Fold flat vgpr + constant addresses
Use getPtrBaseWithConstantOffset in selectFlatOffsetImpl to fold more
vgpr+constant addresses.
Differential Revision: https://reviews.llvm.org/D93692
ShihPo Hung [Tue, 22 Dec 2020 13:30:24 +0000 (05:30 -0800)]
[RISCV] Add intrinsics for vfwmacc, vfwnmacc, vfwmsac, vfwnmsac instructions
This patch defines vfwmacc, vfwnmacc, vfwmsc, vfwnmsac intrinsics
and lower to V instructions.
We work with @rogfer01 from BSC to come out this patch.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: ShihPo Hung <shihpo.hung@sifive.com>
Differential Revision: https://reviews.llvm.org/D93693
Georgii Rymar [Tue, 22 Dec 2020 12:21:26 +0000 (15:21 +0300)]
[llvm-readobj] - Dump the ELF file type better.
Currently llvm-readelf might print "OS Specific/Processor Specific/<unknown>"
hint when dumping the ELF file type. The patch teaches llvm-readobj to do the same.
This fixes https://bugs.llvm.org/show_bug.cgi?id=40868
I am removing `Object/elf-unknown-type.test` test because it is not in the right place,
it is outdated and very limited.
The `readobj/ELF/file-types.test` checks the functionality much better.
Differential revision: https://reviews.llvm.org/D93689
Zakk Chen [Tue, 22 Dec 2020 04:50:58 +0000 (20:50 -0800)]
[RISCV] Define vmerge/vfmerge intrinsics.
Define vmerge/vfmerge intrinsics and lower to V instructions.
Include support for vector-vector vfmerge by vmerge.vvm.
We work with @rogfer01 from BSC to come out this patch.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D93674
Evandro Menezes [Wed, 23 Dec 2020 06:27:38 +0000 (00:27 -0600)]
[RISCV] Define the vfmin, vfmax RVV intrinsics
Define the vfmin, vfmax IR intrinsics for the respective V instructions.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Evandro Menezes <evandro.menezes@sifive.com>
Differential Revision: https://reviews.llvm.org/D93673
Arthur Eubanks [Wed, 23 Dec 2020 05:40:43 +0000 (21:40 -0800)]
[NewPM] Fix objc-arc-apelim pass typo
Kazu Hirata [Wed, 23 Dec 2020 04:13:27 +0000 (20:13 -0800)]
[NewGVN] Remove for_each_found (NFC)
The last use of the function was removed on Sep 30, 2017 in commit
9b926e90d33e0f71c16618365333fc7b330b6bb5.
Thomas Lively [Wed, 23 Dec 2020 04:06:12 +0000 (20:06 -0800)]
[WebAssembly][NFC] Refactor SIMD load/store tablegen defs
Introduce `Vec` records, each bundling all information related to a single SIMD
lane interpretation. This lets TableGen definitions take a single Vec parameter
from which they can extract information rather than taking multiple redundant
parameters. This commit refactors all of the SIMD load and store instruction
definitions to use the new `Vec`s. Subsequent commits will similarly refactor
additional instruction definitions.
Differential Revision: https://reviews.llvm.org/D93660
Kazu Hirata [Wed, 23 Dec 2020 03:58:54 +0000 (19:58 -0800)]
[MemorySSA] Use is_contained (NFC)
Matt Arsenault [Tue, 3 Nov 2020 14:50:17 +0000 (09:50 -0500)]
GlobalISel: Return APInt from getConstantVRegVal
Returning int64_t was arbitrarily limiting for wide integer types, and
the functions should handle the full generality of the IR.
Also changes the full form which returns the originally defined
vreg. Add another wrapper for the common case of just immediately
converting to int64_t (arguably this would be useful for the full
return value case as well).
One possible issue with this change is some of the existing uses did
break without conversion to getConstantVRegSExtVal, and it's possible
some without adequate test coverage are now broken.
Nico Weber [Tue, 22 Dec 2020 20:51:20 +0000 (15:51 -0500)]
[lld/mac] Add --version flag
It's an extension to ld64, but all the other ports have it, and
someone asked for it in PR43721.
While here, change the COFF help text to match the other ports.
Differential Revision: https://reviews.llvm.org/D93491
Matt Arsenault [Fri, 18 Dec 2020 15:51:17 +0000 (10:51 -0500)]
AMDGPU: Use Register
Matt Arsenault [Fri, 18 Dec 2020 16:51:59 +0000 (11:51 -0500)]
AMDGPU: Add spilled CSR SGPRs to entry block live ins
ShihPo Hung [Tue, 22 Dec 2020 12:50:19 +0000 (04:50 -0800)]
[RISCV] Add intrinsics for vf[n]macc/vf[n]msac/vf[n]madd/vf[n]msub instructions
This patch defines vfmadd/vfnmacc, vfmsac/vfnmsac, vfmadd/vfnmadd,
and vfmsub/vfnmsub lower to V instructions.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: ShihPo Hung <shihpo.hung@sifive.com>
Differential Revision: https://reviews.llvm.org/D93691
ShihPo Hung [Tue, 22 Dec 2020 08:01:46 +0000 (00:01 -0800)]
[RISCV] Add intrinsics for vwmacc[u|su|us] instructions
This patch defines vwmacc[u|su|us] intrinsics and lower to V instructions.
We work with @rogfer01 from BSC to come out this patch.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: ShihPo Hung <shihpo.hung@sifive.com>
Differential Revision: https://reviews.llvm.org/D93675
ShihPo Hung [Mon, 21 Dec 2020 02:07:42 +0000 (18:07 -0800)]
[RISCV] Add intrinsics for vslide1up/down, vfslide1up/down instruction
This patch adds intrinsics for vslide1up, vslide1down, vfslide1up, vfslide1down.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: ShihPo Hung <shihpo.hung@sifive.com>
Differential Revision: https://reviews.llvm.org/D93608
Matt Arsenault [Mon, 21 Dec 2020 18:27:32 +0000 (13:27 -0500)]
AMDGPU: Fix assert when checking for implicit operand legality
Matt Arsenault [Thu, 17 Dec 2020 23:47:13 +0000 (18:47 -0500)]
VirtRegMap: Use Register
Arthur O'Dwyer [Mon, 23 Mar 2020 02:20:04 +0000 (22:20 -0400)]
Replace `T(x)` with `reinterpret_cast<T>(x)` everywhere it means reinterpret_cast. NFC.
Differential Revision: https://reviews.llvm.org/D76572
Peter Collingbourne [Tue, 22 Dec 2020 19:48:53 +0000 (11:48 -0800)]
scudo: Move the management of the UseMemoryTagging bit out of the Primary. NFCI.
The primary and secondary allocators will need to share this bit,
so move the management of the bit to the combined allocator and
make useMemoryTagging() a free function.
Differential Revision: https://reviews.llvm.org/D93730
Peter Collingbourne [Tue, 15 Dec 2020 23:32:32 +0000 (15:32 -0800)]
scudo: Replace the Cache argument on MapAllocator with a Config argument. NFCI.
This will allow the secondary allocator to access the
MaySupportMemoryTagging bool.
Differential Revision: https://reviews.llvm.org/D93729
Stanislav Mekhanoshin [Mon, 21 Dec 2020 20:31:06 +0000 (12:31 -0800)]
[AMDGPU][GlobalISel] GlobalISel for flat scratch
It does not seem to fold offsets but this is not specific
to the flat scratch as getPtrBaseWithConstantOffset() does
not return the split for these tests unlike its SDag
counterpart.
Differential Revision: https://reviews.llvm.org/D93670
Stanislav Mekhanoshin [Mon, 21 Dec 2020 23:40:46 +0000 (15:40 -0800)]
[AMDGPU] Support unaligned flat scratch in TLI
Adjust SITargetLowering::allowsMisalignedMemoryAccessesImpl for
unaligned flat scratch support. Mostly needed for global isel.
Differential Revision: https://reviews.llvm.org/D93669
Peter Collingbourne [Tue, 15 Dec 2020 22:26:10 +0000 (14:26 -0800)]
scudo: Move the configuration for the primary allocator to Config. NFCI.
This will allow the primary and secondary allocators to share
the MaySupportMemoryTagging bool.
Differential Revision: https://reviews.llvm.org/D93728
Chris Lattner [Tue, 22 Dec 2020 18:35:15 +0000 (10:35 -0800)]
[IR] Add an ImplicitLocOpBuilder helper class for building IR with the same loc.
One common situation is to create a lot of IR at a well known location,
e.g. when doing a big rewrite from one dialect to another where you're expanding
ops out into lots of other ops.
For these sorts of situations, it is annoying to pass the location into
every create call. As we discused in a few threads on the forum, a way to help
with this is to produce a new sort of builder that holds a location and provides
it to each of the create<> calls automatically.
This patch implements an ImplicitLocOpBuilder class that does this. We've had
good experience with this in the CIRCT project, and it makes sense to upstream to
MLIR.
I picked a random pass to adopt it to show the impact, but I don't think there is
any particular need to force adopt it in the codebase.
Differential Revision: https://reviews.llvm.org/D93717
Joseph Huber [Tue, 22 Dec 2020 20:14:30 +0000 (15:14 -0500)]
[OpenMP] Add OpenMP Documentation for Libomptarget environment variables
Add support to the OpenMP web pages for environment variables supported
by Libomptarget and their usage.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D93723
Alex Zinenko [Tue, 22 Dec 2020 10:22:21 +0000 (11:22 +0100)]
[mlir] Remove instance methods from LLVMType
LLVMType contains multiple instance methods that were introduced initially for
compatibility with LLVM API. These methods boil down to `cast` followed by
type-specific call. Arguably, they are mostly used in an LLVM cast-follows-isa
anti-pattern. This doesn't connect nicely to the rest of the MLIR
infrastructure and actively prevents it from making the LLVM dialect type
system more open, e.g., reusing built-in types when appropriate. Remove such
instance methods and replaces their uses with apporpriate casts and methods on
derived classes. In some cases, the result may look slightly more verbose, but
most cases should actually use a stricter subtype of LLVMType anyway and avoid
the isa/cast.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D93680
Thomas Lively [Tue, 22 Dec 2020 22:29:06 +0000 (14:29 -0800)]
[WebAssembly][SIMD] Rename shuffle, swizzle, and load_splats
These instructions previously used prefixes like v8x16 to signify that they were
agnostic between float and int interpretations. We renamed these instructions to
remove this form of prefix in https://github.com/WebAssembly/simd/issues/297 and
https://github.com/WebAssembly/simd/issues/316 and this commit brings the names
in LLVM up to date.
Differential Revision: https://reviews.llvm.org/D93722
Sam McCall [Tue, 22 Dec 2020 21:58:39 +0000 (22:58 +0100)]
[clangd] Release notes for
b8c37153d5393aad96
Christian Sigg [Tue, 22 Dec 2020 16:42:59 +0000 (17:42 +0100)]
[mlir] Lower gpu.memcpy to GPU runtime calls.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D93204
Sam McCall [Tue, 22 Dec 2020 20:36:41 +0000 (21:36 +0100)]
[clangd] Use atomics instead of locks to track periodic memory trimming
Instead of always locking/unlocking a contended mutex, we now do one atomic read
in the common case, and one read + one exchange if the timer has expried.
Also use this for memory profiling which has similar/compatible requirements.
Differential Revision: https://reviews.llvm.org/D93726
Sanjay Patel [Tue, 22 Dec 2020 19:54:09 +0000 (14:54 -0500)]
[SLP] add reduction tests for maxnum/minnum intrinsics; NFC
Sanjay Patel [Tue, 22 Dec 2020 19:13:39 +0000 (14:13 -0500)]
[SLP] use operand index abstraction for number of operands
I think this is NFC currently, but the bug would be exposed
when we allow binary intrinsics (maxnum, etc) as candidates
for reductions.
The code in matchAssociativeReduction() is using
OperationData::getNumberOfOperands() when comparing whether
the "EdgeToVisit" iterator is in-bounds, so this code must
use the same (potentially offset) operand value to set
the "EdgeToVisit".
Nico Weber [Tue, 22 Dec 2020 16:00:57 +0000 (11:00 -0500)]
glld/mac] Don't add names of unreferenced symbols to string table
Before this, a hello world program would contain many many unnecessary
entries in its string table.
No behavior change, just makes the string table in the output smaller
and more like ld64's.
Differential Revision: https://reviews.llvm.org/D93711
Stephen Kelly [Tue, 22 Dec 2020 20:25:10 +0000 (20:25 +0000)]
Try to fix build on Windows
Craig Topper [Tue, 22 Dec 2020 19:40:51 +0000 (11:40 -0800)]
[RISCV] Remove unneeded !eq comparing a single bit value to 0/1 in RISCVInstrInfoVPseudos.td. NFC
Instead we can either use the bit directly. If it was checking for
0 we need to swap the operands or use !not.
Johannes Doerfert [Tue, 22 Dec 2020 19:05:45 +0000 (13:05 -0600)]
[OpenMP][Docs] Fix Typo
Shilei Tian [Tue, 22 Dec 2020 19:05:46 +0000 (14:05 -0500)]
[OpenMP][Docs] Fixed a typo in the doc that can mislead users to a CMake error
When setting `LLVM_ENABLE_RUNTIMES`, lower case word should be used;
otherwise, it can cause a CMake error that specific path is not found.
Reviewed By: ye-luo
Differential Revision: https://reviews.llvm.org/D93719
Johannes Doerfert [Tue, 22 Dec 2020 18:49:11 +0000 (12:49 -0600)]
[OpenMP][Docs] Add FAQ entry about math and complex on GPUs
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D93718
Arnold Schwaighofer [Tue, 15 Dec 2020 21:28:52 +0000 (13:28 -0800)]
Add a llvm.coro.end.async intrinsic
The llvm.coro.end.async intrinsic allows to specify a function that is
to be called as the last action before returning. This function will be
inlined after coroutine splitting.
This function can contain a 'musttail' call to allow for guaranteed tail
calling as the last action.
Differential Revision: https://reviews.llvm.org/D93568
Stanislav Mekhanoshin [Fri, 18 Dec 2020 00:48:04 +0000 (16:48 -0800)]
[AMDGPU] Folding of FI operand with flat scratch
Differential Revision: https://reviews.llvm.org/D93501
Stephen Kelly [Tue, 27 Oct 2020 23:24:20 +0000 (23:24 +0000)]
[clang-tidy] Handle template instantiations in container size check
readability-container-size-empty currently modifies source code based on
AST nodes in template instantiations, which means that it makes
transformations based on substituted types. This can lead to
transforming code to be broken.
Change the matcher implementation to ignore template instantiations
explicitly, and add a matcher to explicitly handle template declarations
instead of instantiations.
Differential Revision: https://reviews.llvm.org/D91302
Arthur Eubanks [Tue, 22 Dec 2020 18:33:09 +0000 (10:33 -0800)]
Revert "[LLDB] Unbreak the build after recent clang changes"
This reverts commit
430d5d8429473c2b10b109991d7577a3cea41140.
Depends on a reverted change.
Arthur Eubanks [Tue, 22 Dec 2020 18:31:21 +0000 (10:31 -0800)]
Revert "[clangd] zap a few warnings"
This reverts commit
95c7b6cadbc9a3d4376ef44edbeb3c8bb5b8d7fc.
Depends on a reverted change.
sameeran joshi [Tue, 22 Dec 2020 18:16:51 +0000 (23:46 +0530)]
Revert "[Flang][openmp][5.0] Add task_reduction clause."
This reverts commit
9a7895dc20852b662a66976d06871ec2a0b968c8.
Reverting due to missing Co-author attribution.
https://reviews.llvm.org/D93105
Arthur Eubanks [Tue, 22 Dec 2020 18:12:44 +0000 (10:12 -0800)]
Revert "DR2064: decltype(E) is only a dependent type if E is type-dependent, not"
This reverts commit
638867afd4bce4a2c56dea041299428af3727d61.
This is part of 5 commits being reverted due to https://crbug.com/
1161059. See bug for repro.
Arthur Eubanks [Tue, 22 Dec 2020 18:12:40 +0000 (10:12 -0800)]
Revert "Following up on PR48517, fix handling of template arguments that refer"
This reverts commit
8c1f2d15b826591cdf6bd6b468b8a7d23377b29e.
This is part of 5 commits being reverted due to https://crbug.com/
1161059. See bug for repro.
Arthur Eubanks [Tue, 22 Dec 2020 18:12:37 +0000 (10:12 -0800)]
Revert "[c++20] P1907R1: Support for generalized non-type template arguments of scalar type."
This reverts commit
9e08e51a20d0d2b1c5724bb17e969d036fced4cd.
This is part of 5 commits being reverted due to https://crbug.com/
1161059. See bug for repro.
Arthur Eubanks [Tue, 22 Dec 2020 18:12:33 +0000 (10:12 -0800)]
Revert "Fix MSVC "not all control paths return a value" warnings. NFCI."
This reverts commit
7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0.
This is part of 5 commits being reverted due to https://crbug.com/
1161059. See bug for repro.
Arthur Eubanks [Tue, 22 Dec 2020 18:11:31 +0000 (10:11 -0800)]
Revert "Fix memory leak complicated non-type template arguments."
This reverts commit
ed13d8c66781b50ff007cb089c5905f9bb9e8af2.
This is part of 5 commits being reverted due to https://crbug.com/
1161059. See bug for repro.
Shilei Tian [Tue, 22 Dec 2020 18:14:34 +0000 (13:14 -0500)]
[OpenMP][Docs] Updated the faq about building an OpenMP offloading capable compiler
After some issues about building runtimes along with LLVM were fixed,
building an OpenMP offloading capable compiler is pretty simple. This patch updates
the FAQ part in the doc.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D93671
Andy Yankovsky [Tue, 22 Dec 2020 18:07:44 +0000 (10:07 -0800)]
[lldb] Add SBType::GetEnumerationIntegerType method
Add a method for getting the enumeration underlying type.
Differential revision: https://reviews.llvm.org/D93696
Andy Yankovsky [Tue, 22 Dec 2020 18:06:46 +0000 (10:06 -0800)]
[lldb] Add SBType::IsScopedEnumerationType method
Add a method to check if the type is a scoped enumeration (i.e. "enum
class/struct").
Differential revision: https://reviews.llvm.org/D93690
Nathan James [Tue, 22 Dec 2020 18:06:19 +0000 (18:06 +0000)]
[ADT] Fix some tests after
5d10b8ad
Some bots were failing due to signed/unsigned comparison.
Florian Hahn [Tue, 22 Dec 2020 17:48:01 +0000 (17:48 +0000)]
[LoopDeletion] Add test case where outer loop needs to be deleted.
In the test case @test1, the inner loop cannot be removed, because it
has a live-out value. But the outer loop is a no-op and can be removed.
Philip Reames [Tue, 22 Dec 2020 17:47:11 +0000 (09:47 -0800)]
[tests] precommit a test mentioned in review for D93317
Nathan James [Tue, 22 Dec 2020 17:18:59 +0000 (17:18 +0000)]
[ADT] Add resize_for_overwrite method to SmallVector.
Analagous to the std::make_(unqiue|shared)_for_overwrite added in c++20.
If T is POD, and the container gets larger, any new values added wont be initialized.
This is useful when using SmallVector as a buffer where its planned to overwrite any potential new values added.
If T is not POD, `new (Storage) T` functions identically to `new (Storage) T()` so this will function identically to `resize(size_type)`.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D93532
Paul Walker [Tue, 22 Dec 2020 17:05:02 +0000 (17:05 +0000)]
Fix some misnamed variables in sve-fixed-length-int-minmax.ll.
Jonas Devlieghere [Mon, 21 Dec 2020 21:41:57 +0000 (13:41 -0800)]
[lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC)
This patch introduces a LLDB_SCOPED_TIMER macro to hide the needlessly
repetitive creation of scoped timers in LLDB. It's similar to the
LLDB_LOG(F) macro.
Differential revision: https://reviews.llvm.org/D93663
Kamau Bridgeman [Tue, 22 Dec 2020 17:04:57 +0000 (12:04 -0500)]
[PowerPC][Power10] Exploit store rightmost vector element instructions
Using the store rightmost vector element instructions to do vector
element extraction and store. The rightmost vector element on little
endian is the zeroth vector element, with these patterns that element
can be extracted and stored in one instruction for all vector types.
Differential Revision: https://reviews.llvm.org/D89195
sameeran joshi [Tue, 22 Dec 2020 16:27:26 +0000 (21:57 +0530)]
[Flang][openmp][5.0] Add task_reduction clause.
See OMP-5.0 2.19.5.5 task_reduction Clause.
To add a positive test case we need `taskgroup` directive which is not added hence skipping the test.
This is a dependency for `taskgroup` construct.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D93105
Paul Walker [Fri, 18 Dec 2020 18:42:58 +0000 (18:42 +0000)]
[SVE] Lower vector BITREVERSE and BSWAP operations.
These operations are lowered to RBIT and REVB instructions
respectively. In the case of fixed-length support using SVE we
also lower BITREVERSE operating on NEON sized vectors as this
results in fewer instructions.
Differential Revision: https://reviews.llvm.org/D93606
Christian Sigg [Tue, 22 Dec 2020 16:39:00 +0000 (17:39 +0100)]
[mlir] Add gpu.memcpy op.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D93197
Prateek Gupta [Tue, 22 Dec 2020 16:10:17 +0000 (21:40 +0530)]
[MLIR] Fix lowering of affine operations with return values
This commit addresses the issue of lowering affine.for and
affine.parallel having return values. Relevant test cases are also
added.
Signed-off-by: Prateek Gupta <prateek@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D93090
Nandor Licker [Wed, 25 Nov 2020 14:01:19 +0000 (14:01 +0000)]
[RISCV] Basic jump table lowering
This patch enables jump table lowering in the RISC-V backend.
In addition to the test case included, the new lowering was
tested by compiling the OCaml runtime and running it under qemu.
Differential Revision: https://reviews.llvm.org/D92097
clementval [Tue, 22 Dec 2020 14:59:50 +0000 (09:59 -0500)]
[openacc][openmp][NFC] Fix typo in comments
Florian Hahn [Tue, 22 Dec 2020 14:44:09 +0000 (14:44 +0000)]
[LV] Use ScalarEvolution::getURemExpr to reduce duplication.
ScalarEvolution should be able to handle both constant and variable trip
counts using getURemExpr, so we do not have to handle them separately.
This is a small simplification of
a56280094e08.
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D93677
Paul C. Anagnostopoulos [Tue, 15 Dec 2020 17:47:27 +0000 (12:47 -0500)]
[MCInstrDesc] [TableGen] Reduce size of MCOperandInfo instances.
Differential Revision: https://reviews.llvm.org/D93326
Jan Svoboda [Mon, 21 Dec 2020 12:50:09 +0000 (13:50 +0100)]
[clang] NFC: Refactor custom class into a lambda in CompilerInvocation
Change `makeFlagToValueNormalizer` so that one specialization converts all integral/enum arguments into `uint64_t` and forwards them to the more generic version.
This makes it easy to replace the custom `FlagToValueNormalizer` struct with a lambda, which is the common approach in other (de)normalizers.
Finally, drop custom `is_int_convertbile` in favor of `llvm::is_integral_or_enum`.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D93628
Andrzej Warzynski [Tue, 22 Dec 2020 13:38:13 +0000 (13:38 +0000)]
[flang][driver] Fix formatting in a test (nfc)
Jan Svoboda [Mon, 21 Dec 2020 13:28:09 +0000 (14:28 +0100)]
[clang][cli] Implement `getAllArgValues` marshalling
This infrastructure can be used ~30 more command line options.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D93631
Andrzej Warzynski [Tue, 22 Dec 2020 11:07:58 +0000 (11:07 +0000)]
[flang][driver] Refactor unit tests for frontend actions (nfc)
These patch implements a few non-functional-changes:
* switch to using test fixtures for better code sharing
* rename some variables (e.g. to communicate their purpose a bit better)
This patch doesn't change _what_ is being tested.
Differential Revision: https://reviews.llvm.org/D93544
mydeveloperday [Tue, 22 Dec 2020 12:44:57 +0000 (12:44 +0000)]
[clang-format] NFC keep the code clang-formatted
Sjoerd Meijer [Tue, 22 Dec 2020 12:10:43 +0000 (12:10 +0000)]
[AArch64] Add a test for MachineLICM SinkIntoLoop. NFC.
Stephen Kelly [Sun, 20 Dec 2020 01:32:50 +0000 (01:32 +0000)]
[ASTMatchers] Traverse-ignore range-for implementation details
Differential Revision: https://reviews.llvm.org/D93596
Alex Richardson [Tue, 22 Dec 2020 11:43:48 +0000 (11:43 +0000)]
[compiler-rt] Fix atomic_test.c on macOS
The macOS name mangling adds another underscore. Therefore, on macOS
the __atomic_* functions are actually ___atomic_* in libcompiler_rt.dylib.
To handle this case, prepend the asm() argument with __USER_LABEL_PREFIX__
in the same way that atomic.c does.
Reviewed By: ldionne
Differential Revision: https://reviews.llvm.org/D92833
Alex Richardson [Tue, 22 Dec 2020 11:42:07 +0000 (11:42 +0000)]
[libc++] Add a 'is-lockfree-runtime-function' lit feature
On macOS 10.14 /usr/lib/system/libcompiler_rt.dylib contains all the
`__atomic_load*`, etc. functions but does not include the `__atomic_is_lock_free`
function. The lack of this function causes the non-lockfree-atomics feature
to be set to false even though large atomic operations are actually
supported, it's just the is_lock_free() function that is missing.
This is required so that the !non-lockfree-atomics feature can be used
to XFAIL tests that require runtime library support (D88818).
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D91911
Nico Weber [Tue, 22 Dec 2020 11:51:19 +0000 (06:51 -0500)]
Revert "-fstack-clash-protection: Return an actual error when used on unsupported OS"
This reverts commit
4d59c8fdb955ea0d668b854f467e12bce05a8857.
Breaks tens of thousands of tests, and had pending review comments, see
comments on https://reviews.llvm.org/D92245 (and e.g.
http://lab.llvm.org:8011/#/builders/109/builds/5236 for failures).
Nemanja Ivanovic [Tue, 22 Dec 2020 11:43:33 +0000 (05:43 -0600)]
[PowerPC] Restore stack ptr from base ptr when available
On subtargets that have a red zone, we will copy the stack pointer to the base
pointer in the prologue prior to updating the stack pointer. There are no other
updates to the base pointer after that. This suggests that we should be able to
restore the stack pointer from the base pointer rather than loading it from the
back chain or adding the frame size back to either the stack pointer or the
frame pointer.
This came about because functions that call setjmp need to restore the SP from
the FP because the back chain might have been clobbered
(see https://reviews.llvm.org/D92906). However, if the stack is realigned, the
restored SP might be incorrect (which is what caused the failures in the two
ASan test cases).
This patch was tested quite extensivelly both with sanitizer runtimes and
general code.
Differential revision: https://reviews.llvm.org/D93327
Nico Weber [Tue, 22 Dec 2020 11:35:40 +0000 (06:35 -0500)]
[gn build] (manually) port
b8c37153d5393
Nathan James [Tue, 22 Dec 2020 11:30:55 +0000 (11:30 +0000)]
[clangd] Reuse buffer for JSONTransport::sendMessage
Allocate a Buffer in the JSONTransport to be used when sending messages to the client.
This gets reused each time a message is sent, reducing in fewer malloc, which is always a bonus.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D93531
David Spickett [Thu, 17 Dec 2020 10:52:37 +0000 (10:52 +0000)]
[llvm][Arm/AArch64] Format extension flags in CPU test failures
Previously you just two hex numbers you had to decode manually.
This change adds a predicate formatter for extension flags
to produce failure messages like:
```
[ RUN ] AArch64CPUTests/AArch64CPUTestFixture.testAArch64CPU/2
<...>llvm/unittests/Support/TargetParserTest.cpp:862:
Failure
Expected extension flags: +fp-armv8, +crc, +crypto (0xe)
Got extension flags: +fp-armv8, +neon, +crc, +crypto (0x1e)
[ FAILED ] AArch64CPUTests/AArch64CPUTestFixture.testAArch64CPU/2,
where GetParam() = "cortex-a34", "armv8-a", <...>
```
From there you can take the feature name and map it back
to the enum in ARM/AArch64TargetParser.def.
(which isn't perfect but you've probably got both files
open if you're editing these tests)
Note that AEK_NONE is not meant to be user facing in the compiler
but here it is part of the tests. So failures may show an
extension "none" where the normal target parser wouldn't.
The formatter is implemented as a template on ARM::ISAKind
because the predicate formatters assume all parameters are used
for comparison.
(e.g. PRED_FORMAT3 is for comparing 3 values, not having 3
arguments in general)
Reviewed By: MarkMurrayARM
Differential Revision: https://reviews.llvm.org/D93448
Sylvestre Ledru [Mon, 30 Nov 2020 17:29:55 +0000 (18:29 +0100)]
-fstack-clash-protection: Return an actual error when used on unsupported OS
$ clang-12: error: -fstack-clash-protection is not supported on Windows or Mac OS X
Differential Revision: https://reviews.llvm.org/D92245
Siddhesh Poyarekar [Tue, 22 Dec 2020 09:51:41 +0000 (10:51 +0100)]
Fold comparison of __builtin_object_size expression with -1 for non-const size
When __builtin_dynamic_object_size returns a non-constant expression, it cannot
be -1 since that is an invalid return value for object size. However since
passes running after the substitution don't know this, they are unable to
optimize away the comparison and hence the comparison and branch stays in there.
This change generates an appropriate call to llvm.assume to help the optimizer
folding the test.
glibc is considering adopting __builtin_dynamic_object_size for additional
protection[1] and this change will help reduce branching overhead in fortified
implementations of all of the functions that don't have the __builtin___*_chk
type builtins, e.g. __ppoll_chk.
Also remove the test limit-max-iterations.ll because it was deemed unnecessary
during review.
[1] https://sourceware.org/pipermail/libc-alpha/2020-November/120191.html
Differential Revision: https://reviews.llvm.org/D93015
Florian Hahn [Tue, 22 Dec 2020 09:20:47 +0000 (09:20 +0000)]
[VPlan] Make VPInstruction a VPDef
This patch turns updates VPInstruction to manage the value it defines
using VPDef. The VPValue is used during VPlan construction and
codegeneration instead of the plain IR reference where possible.
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D90565
Sjoerd Meijer [Tue, 22 Dec 2020 09:13:51 +0000 (09:13 +0000)]
[MachineLICM] Add llvm debug messages to SinkIntoLoop. NFC.
I am investigating sinking instructions back into the loop under high
register pressure. This is just a first NFC step to add some debug
messages that allows tracing of the decision making.
Pavel Labath [Tue, 24 Nov 2020 09:24:29 +0000 (10:24 +0100)]
[DebugInfo] Don't use DW_OP_implicit_value for fragments
Currently using DW_OP_implicit_value in fragments produces invalid DWARF
expressions. (Such a case can occur in complex floats, for example.)
This problem manifests itself as a missing DW_OP_piece operation after
the last fragment. This happens because the function for printing
constant float value skips printing the accompanying DWARF expression,
as that would also print DW_OP_stack_value (which is not desirable in
this case). However, this also results in DW_OP_piece being skipped.
The reason that DW_OP_piece is missing only for the last piece is that
the act of printing the next fragment corrects this. However, it does
that for the wrong reason -- the code emitting this DW_OP_piece thinks
that the previous fragment was missing, and so it thinks that it needs
to skip over it in order to be able to print itself.
In a simple scenario this works out, but it's likely that in a more
complex setup (where some pieces are in fact missing), this logic would
go badly wrong. In a simple setup gdb also seems to not mind the fact
that the DW_OP_piece is missing, but it would also likely not handle
more complex use cases.
For this reason, this patch disables the usage of DW_OP_implicit_value
in the frament scenario (we will use DW_OP_const*** instead), until we
figure out the right way to deal with this. This guarantees that we
produce valid expressions, and gdb can handle both kinds of inputs
anyway.
Differential Revision: https://reviews.llvm.org/D92013
Pavel Labath [Fri, 18 Dec 2020 20:26:25 +0000 (21:26 +0100)]
[lldb/test] Add GdbRemoteTestCaseFactory to avoid duplication in lldb-server tests
This uses the same approach as the debug info tests to avoid needing to
explicitly spell out the two kinds of tests. I convert a handful of
tests to the new mechanism. The rest will be converted in follow-up
patches.
David Spickett [Tue, 15 Dec 2020 15:49:26 +0000 (15:49 +0000)]
[llvm][ARM/AArch64] Convert Target Parser CPU tests to fixtures
Also convert the test function to use EXPECT_EQ and
remove the special case for the AEK_NONE extension.
This means that each test is marked as failing separatley
and the accumultated EXPECT failures are printed next
to that test, with its parameters.
Before they would be hidden by the "pass &=" pattern
and failures would print in one block since it was a
"single" test.
Example of the new failure messages:
```
ARMCPUTestsPart1/ARMCPUTestFixture.ARMCPUTests/6
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ARMCPUTestsPart1/ARMCPUTestFixture
[ RUN ] ARMCPUTestsPart1/ARMCPUTestFixture.ARMCPUTests/6
/work/open_source/nightly-llvm/llvm-project/llvm/unittests/Support/TargetParserTest.cpp:66:
Failure
Expected: params.ExpectedFlags
Which is:
3405705229
To be equal to: default_extensions
Which is: 1
[ FAILED ] ARMCPUTestsPart1/ARMCPUTestFixture.ARMCPUTests/6, where
GetParam() = "arm8", "armv4", "none", 0xcafef00d, "4" (0 ms)
```
Reviewed By: MarkMurrayARM
Differential Revision: https://reviews.llvm.org/D93392