Craig Topper [Thu, 10 Dec 2020 15:32:08 +0000 (07:32 -0800)]
[RISCV][LegalizeDAG] Expand SETO and SETUO comparisons. Teach LegalizeDAG to expand SETUO expansion when UNE isn't legal.
If SETUNE isn't legal, UO can use the NOT of the SETO expansion.
Removes some complex isel patterns. Most of the test changes are
from using XORI instead of SEQZ.
Differential Revision: https://reviews.llvm.org/D92008
Florian Hahn [Thu, 10 Dec 2020 16:58:16 +0000 (16:58 +0000)]
[CallBase] Add hasRetAttr version that takes StringRef.
This makes it slightly easier to deal with custom attributes and
CallBase already provides hasFnAttr versions that support both AttrKind
and StringRef arguments in a similar fashion.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D92567
Florian Hahn [Thu, 10 Dec 2020 16:34:55 +0000 (16:34 +0000)]
[Clang] Add vcmla and rotated variants for Arm ACLE.
This patch adds vcmla and the rotated variants as defined in
"Arm Neon Intrinsics Reference for ACLE Q3 2020" [1]
The *_lane_* are still missing, but they can be added separately.
This patch only adds the builtin mapping for AArch64.
[1] https://developer.arm.com/documentation/ihi0073/latest
Reviewed By: t.p.northover
Differential Revision: https://reviews.llvm.org/D92930
Anastasia Stulova [Fri, 27 Nov 2020 15:37:08 +0000 (15:37 +0000)]
[OpenCL] Implement extended subgroups fully in headers.
Extended subgroups are library style extensions and therefore
they require no changes in the frontend. This commit:
1. Moves extension macro definitions to the internal headers.
2. Removes extension pragmas because they are not needed.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D92231
Raphael Isemann [Thu, 10 Dec 2020 14:38:21 +0000 (15:38 +0100)]
[lldb] Remove assumption from Clang-based data formatters that their types are in the scratch AST
Several data formatters assume their types are in the Target's scratch AST and
build new types from that scratch AST instance. However, types from different
ASTs shouldn't be mixed, so this (unchecked) assumption may lead to problems if
we ever have more than one scratch AST or someone somehow invokes data
formatters on a type that are not in the scratch AST.
Instead we can use in all the formatters just the TypeSystem of the type we're
formatting. That's much simpler and avoids all the headache of finding the right
TypeSystem that matches the one of the formatted type.
Right now LLDB only has one scratch TypeSystemClang instance and we format only
types that are in the scratch AST, so this doesn't change anything in the
current way LLDB works. The intention here is to allow follow up refactorings
that introduce multiple scratch ASTs with the same Target.
Differential Revision: https://reviews.llvm.org/D92757
Irina Dobrescu [Fri, 16 Oct 2020 16:36:12 +0000 (17:36 +0100)]
[flang]Add Parser Support for Allocate Directive
Differential Revision: https://reviews.llvm.org/D89562
Matt Morehouse [Thu, 10 Dec 2020 15:42:11 +0000 (07:42 -0800)]
[DFSan] Add custom wrapper for getsockname.
The wrapper clears shadow for any bytes written to addr or addrlen.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D92964
Utkarsh Saxena [Thu, 10 Dec 2020 13:21:18 +0000 (14:21 +0100)]
[clangd] Find relations in Dex exploration tool.
Reviewed By: hokein
Differential Revision: https://reviews.llvm.org/D93029
Peter Steinfeld [Wed, 9 Dec 2020 16:38:59 +0000 (08:38 -0800)]
[flang] Fix bogus message on index-names in the presence of associated entities
The semantic analysis of index-names of FORALL statements looks up symbols with
the same name as the index-name. This is needed to exclude symbols that are
not objects. But if the symbol found is host-, use-, or construct-associated
with another entity, the check fails.
I fixed this by getting the root symbol of the symbol found and doing the check
on the root symbol. This required creating a non-const version of
"GetAssociationRoot()".
Differential Revision: https://reviews.llvm.org/D92970
clementval [Thu, 10 Dec 2020 15:34:59 +0000 (10:34 -0500)]
Revert "[openmp] Remove clause from OMPKinds.def and use OMP.td info"
This reverts commit
a7b2847216b4f7a84ef75461fd47a5adfbb63e27.
failing buildbot on warnings
Nuno Lopes [Thu, 10 Dec 2020 14:53:02 +0000 (14:53 +0000)]
AA: make AliasAnalysis.h compatible with C++20 (NFC)
can't mix arithmetic with different enums
Nico Weber [Thu, 10 Dec 2020 15:28:00 +0000 (10:28 -0500)]
[gn build] fix build after
a7b2847216b4f7
Ports
6e42a417bacb since it's now needed, and undo an accidental
deletion from
d69762c404ded while here (this part is not needed to fix
the build, it's just in the vicinity).
Pavel Labath [Thu, 10 Dec 2020 14:25:55 +0000 (15:25 +0100)]
[lldb/test] Change base class of lldb-server tests
lldb-server tests are a very special subclass of "api" tests. As they
communicate with lldb-server directly, they don't actually need most of
facilities provided by our TestBase class. In particular, they don't
need the ability to fork debug info flavours of tests (but they could
use debug server flavours).
This makes them inherit from "Base" instead. This avoids the need to
explicitly mark these tests as NO_DEBUG_INFO_TEST_CASE. Two additional
necessary tweaks were:
- move run_platform_command to the base (Base) class. This is used in
one test, and can be generally useful when running tests remotely.
- add a "build" method, forwarding to buildDefault. This is to avoid
updating each test case to use buildDefault (also, "build" sounds
better). It might be interesting to refactor the (Test)Base classes so
that all debug info flavour handling happens in TestBase, and the Base
class provides a simple build method automatically.
Pavel Labath [Thu, 10 Dec 2020 13:52:20 +0000 (14:52 +0100)]
[lldb/test] Replace ad-hoc server test choice with test categories
This makes things consistent, and enables further simplifications down
the road.
Valentin Clement [Thu, 10 Dec 2020 15:18:22 +0000 (10:18 -0500)]
[openmp] Remove clause from OMPKinds.def and use OMP.td info
Remove the OpenMP clause information from the OMPKinds.def file and use the
information from the new OMP.td file. There is now a single source of truth for the
directives and clauses.
To avoid generate lots of specific small code from tablegen, the macros previously
used in OMPKinds.def are generated almost as identical. This can be polished and
possibly removed in a further patch.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D92955
Nathan James [Thu, 10 Dec 2020 14:59:16 +0000 (14:59 +0000)]
[clangd][NFC] Remove unnecessary vector.
As pointed out in D92788.
Reviewed By: kbobyrev
Differential Revision: https://reviews.llvm.org/D92986
Nathan James [Thu, 10 Dec 2020 14:52:44 +0000 (14:52 +0000)]
[clang-tidy] Use a MemoryBufferRef when parsing configuration files.
Using a MemoryBufferRef, If there is an error parsing, we can point the user to the location of the file.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D93024
Krzysztof Parzyszek [Thu, 10 Dec 2020 14:17:07 +0000 (08:17 -0600)]
[Hexagon] Fix gcc6 compilation issue
Michał Górny [Tue, 8 Dec 2020 18:54:55 +0000 (19:54 +0100)]
[lldb] [docs] Add a manpage for lldb-server
Differential Revision: https://reviews.llvm.org/D92872
Kerry McLaughlin [Thu, 10 Dec 2020 11:45:45 +0000 (11:45 +0000)]
[SVE][CodeGen] Extend index of masked gathers
This patch changes performMSCATTERCombine to also promote the indices of
masked gathers where the element type is i8 or i16, and adds various tests
for gathers with illegal types.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D91433
Haojian Wu [Thu, 10 Dec 2020 13:51:50 +0000 (14:51 +0100)]
Fix a -Wunused-variable warning in release build.
Kazushi (Jam) Marukawa [Wed, 9 Dec 2020 15:20:23 +0000 (00:20 +0900)]
[VE] Add vector reduce intrinsic instructions
Add vrmax, vrmin, vfrmax, vfrmin, vrand, vror, and vrxor intrinsic
instructions and regression tests.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D92941
Sjoerd Meijer [Thu, 10 Dec 2020 12:48:20 +0000 (12:48 +0000)]
[AArch64] Cortex-R82: remove crypto
Remove target features crypto for Cortex-R82, because it doesn't have any, and
add LSE which was missing while we are at it.
This also removes crypto from the v8-R architecture description because that
aligns better with GCC and so far none of the R-cores have implemented crypto,
so is probably a more sensible default.
Differential Revision: https://reviews.llvm.org/D91994
Jan Kratochvil [Thu, 10 Dec 2020 12:45:10 +0000 (13:45 +0100)]
[lldb/Docs] Fix lldb-x86_64-fedora URL as it is still a silent bot
Peter Waller [Thu, 10 Dec 2020 12:34:00 +0000 (12:34 +0000)]
[AArch64][Driver][SVE] Push missing SVE feature error from driver to frontend
... and give more guidance to users.
If specifying -msve-vector-bits on a non-SVE target, clang would say:
error: '-msve-vector-bits' is not supported without SVE enabled
1. The driver lacks logic for "implied features".
This would result in this error being raised for -march=...+sve2,
even though +sve2 implies +sve.
2. Feature implication is well modelled in LLVM, so push the error down
the stack.
3. Hint to the user what flag they need to consider setting.
Now clang fails later, when the feature is used, saying:
aarch64-sve-vector-bits.c:42:41: error: 'arm_sve_vector_bits' attribute is not supported on targets missing 'sve'; specify an appropriate -march= or -mcpu=
typedef svint32_t noflag __attribute__((arm_sve_vector_bits(256)));
Move clang/test/Sema/{neon => arm}-vector-types-support.c and put tests for
this warning together in one place.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D92487
Raphael Isemann [Thu, 10 Dec 2020 11:31:29 +0000 (12:31 +0100)]
[lldb] Fix that symbols.clang-modules-cache-path is never initialized
LLDB is supposed to ask the Clang Driver what the default module cache path is
and then use that value as the default for the
`symbols.clang-modules-cache-path` setting. However, we use the property type
`String` to change `symbols.clang-modules-cache-path` even though the type of
that setting is `FileSpec`, so the setter will simply do nothing and return
`false`. We also don't check the return value of the setter, so this whole code
ends up not doing anything at all.
This changes the setter to use the correct property type and adds an assert that
we actually successfully set the default path. Also adds a test that checks that
the default value for this setting is never unset/empty path as this would
effectively disable the import-std-module feature from working by default.
Reviewed By: JDevlieghere, shafik
Differential Revision: https://reviews.llvm.org/D92772
Kirill Bobyrev [Thu, 10 Dec 2020 12:36:35 +0000 (13:36 +0100)]
[clangd] NFC: Use SmallVector<T> where possible
SmallVector<T> with default size is now the recommended version (D92522).
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D92788
David Green [Thu, 10 Dec 2020 12:14:23 +0000 (12:14 +0000)]
[ARM][RegAlloc] Add t2LoopEndDec
We currently have problems with the way that low overhead loops are
specified, with LR being spilled between the t2LoopDec and the t2LoopEnd
forcing the entire loop to be reverted late in the backend. As they will
eventually become a single instruction, this patch introduces a
t2LoopEndDec which is the combination of the two, combined before
registry allocation to make sure this does not fail.
Unfortunately this instruction is a terminator that produces a value
(and also branches - it only produces the value around the branching
edge). So this needs some adjustment to phi elimination and the register
allocator to make sure that we do not spill this LR def around the loop
(needing to put a spill after the terminator). We treat the loop very
carefully, making sure that there is nothing else like calls that would
break it's ability to use LR. For that, this adds a
isUnspillableTerminator to opt in the new behaviour.
There is a chance that this could cause problems, and so I have added an
escape option incase. But I have not seen any problems in the testing
that I've tried, and not reverting Low overhead loops is important for
our performance. If this does work then we can hopefully do the same for
t2WhileLoopStart and t2DoLoopStart instructions.
This patch also contains the code needed to convert or revert the
t2LoopEndDec in the backend (which just needs a subs; bne) and the code
pre-ra to create them.
Differential Revision: https://reviews.llvm.org/D91358
Martin Storsjö [Thu, 3 Dec 2020 09:20:57 +0000 (11:20 +0200)]
[llvm-rc] Handle driveless absolute windows paths when loading external files
When llvm-rc loads an external file, it looks for it relative to
a number of include directories and the current working directory.
If the path is considered absolute, llvm-rc tries to open the
filename as such, and doesn't try to open it relative to other
paths.
On Windows, a path name like "\dir\file" isn't considered absolute
as it lacks the drive name, but by appending it on top of the search
dirs, it's not found.
LLVM's sys::path::append just appends such a path (same with a properly
absolute posix path) after the paths it's supposed to be relative to.
This fix doesn't handle the case if the resource script and the
external file are on a different drive than the current working
directory; to fix that, we'd have to make LLVM's sys::path::append
handle appending fully absolute and partially absolute paths (ones
lacking a drive prefix but containing a root directory), or switch
to C++17's std::filesystem.
Differential Revision: https://reviews.llvm.org/D92558
Alexey Lapshin [Tue, 15 Sep 2020 18:12:10 +0000 (21:12 +0300)]
[dsymutil][DWARFLinker][NFC] Make interface of AddressMap more general.
Current interface of AddressMap assumes that relocations exist.
That is correct for not-linked object file but is not correct
for linked executable. This patch changes interface in such way
that AddressMap could be used not only with not-linked object files:
hasValidRelocationAt()
replaced with:
hasLiveMemoryLocation()
hasLiveAddressRange()
Differential Revision: https://reviews.llvm.org/D87723
Mirko Brkusanin [Thu, 10 Dec 2020 11:40:49 +0000 (12:40 +0100)]
[AMDGPU] Resolve issues when picking between ds_read/write and ds_read2/write2
Both ds_read_b128 and ds_read2_b64 are valid for 128bit 16-byte aligned
loads but the one that will be selected is determined either by the order in
tablegen or by the AddedComplexity attribute. Currently ds_read_b128 has
priority.
While ds_read2_b64 has lower alignment requirements, we cannot always
restrict ds_read_b128 to 16-byte alignment because of unaligned-access-mode
option. This was causing ds_read_b128 to be selected for 8-byte aligned
loads regardles of chosen access mode.
To resolve this we use two patterns for selecting ds_read_b128. One
requires alignment of 16-byte and the other requires
unaligned-access-mode option.
Same goes for ds_write2_b64 and ds_write_b128.
Differential Revision: https://reviews.llvm.org/D92767
Nathan James [Thu, 10 Dec 2020 11:34:57 +0000 (11:34 +0000)]
[clang-tidy][NFC] Use moves instead of copies when constructing OptionsProviders.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D92267
Raphael Isemann [Thu, 10 Dec 2020 09:09:06 +0000 (10:09 +0100)]
[lldb] Allow LLDB to automatically retry a failed expression with an imported std C++ module
By now LLDB can import the 'std' C++ module to improve expression evaluation,
but there are still a few problems to solve before we can do this by default.
One is that importing the C++ module is slightly slower than normal expression
evaluation (mostly because the disk access and loading the initial lookup data
is quite slow in comparison to the barebone Clang setup the rest of the LLDB
expression evaluator is usually doing). Another problem is that some complicated
types in the standard library aren't fully supported yet by the ASTImporter, so
we end up types that fail to import (which usually appears to the user as if the
type is empty or there is just no result variable).
To still allow people to adopt this mode in their daily debugging, this patch
adds a setting that allows LLDB to automatically retry failed expression with a
loaded C++ module. All success expressions will behave exactly as they would do
before this patch. Failed expressions get a another parse attempt if we find a
usable C++ module in the current execution context. This way we shouldn't have
any performance/parsing regressions in normal debugging workflows, while the
debugging workflows involving STL containers benefit from the C++ module type
info.
This setting is off by default for now with the intention to enable it by
default on macOS soon-ish.
The implementation is mostly just extracting the existing parse logic into its
own function and then calling the parse function again if the first evaluation
failed and we have a C++ module to retry the parsing with.
Reviewed By: shafik, JDevlieghere, aprantl
Differential Revision: https://reviews.llvm.org/D92784
mydeveloperday [Thu, 10 Dec 2020 11:24:12 +0000 (11:24 +0000)]
[clang-format] NFC Add release note for IndentPragmas
Add additional release note to announce new clang-format option added during {D92753}
mydeveloperday [Thu, 10 Dec 2020 11:17:33 +0000 (11:17 +0000)]
[clang-format] Add IndentPragma style to eliminate common clang-format off scenario
A quick search of github.com, shows one common scenario for excessive use of //clang-format off/on is the indentation of #pragma's, especially around the areas of loop optimization or OpenMP
This revision aims to help that by introducing an `IndentPragmas` style, the aim of which is to keep the pragma at the current level of scope
```
for (int i = 0; i < 5; i++) {
// clang-format off
#pragma HLS UNROLL
// clang-format on
for (int j = 0; j < 5; j++) {
// clang-format off
#pragma HLS UNROLL
// clang-format on
....
```
can become
```
for (int i = 0; i < 5; i++) {
#pragma HLS UNROLL
for (int j = 0; j < 5; j++) {
#pragma HLS UNROLL
....
```
This revision also support working alongside the `IndentPPDirective` of `BeforeHash` and `AfterHash` (see unit tests for examples)
Reviewed By: curdeius
Differential Revision: https://reviews.llvm.org/D92753
mydeveloperday [Thu, 10 Dec 2020 11:13:22 +0000 (11:13 +0000)]
[clang-format] PR42434 Remove preprocessor and pragma lines from ObjectiveC guess
clang-format see the `disable:` in __pragma(warning(disable:)) as ObjectiveC method call
Remove any line starting with `#` or __pragma line from being part of the ObjectiveC guess
https://bugs.llvm.org/show_bug.cgi?id=42434
Reviewed By: curdeius, krasimir
Differential Revision: https://reviews.llvm.org/D92922
mydeveloperday [Thu, 10 Dec 2020 11:06:48 +0000 (11:06 +0000)]
[clang-format] [NFC] Fix spelling and grammatical errors in IncludeBlocks text
Fix spelling mistake
Leave space after `.` and before beginning of next sentence
Reword it slightly to try and make it more readable.
Ensure RST is updated correctly (it generated a change)
Reviewed By: HazardyKnusperkeks, curdeius
Differential Revision: https://reviews.llvm.org/D92822
David Green [Thu, 10 Dec 2020 10:49:00 +0000 (10:49 +0000)]
[ARM] Additional test for Min loop. NFC
David Green [Thu, 10 Dec 2020 10:30:31 +0000 (10:30 +0000)]
[ARM] Remove copies from low overhead phi inductions.
The phi created in a low overhead loop gets created with a default
register class it seems. There are then copied inserted between the low
overhead loop pseudo instructions (which produce/consume GPRlr
instructions) and the phi holding the induction. This patch removes
those as a step towards attempting to make t2LoopDec and t2LoopEnd a
single instruction, and appears useful in it's own right as shown in the
tests.
Differential Revision: https://reviews.llvm.org/D91267
Alex Zinenko [Tue, 8 Dec 2020 15:09:20 +0000 (16:09 +0100)]
[mlir] Explicitly track branch instructions in translation to LLVM IR
The current implementation of the translation to LLVM IR relies on the
existence of a one-to-one mapping between MLIR blocks and LLVM IR basic blocks
in order to configure PHI nodes with appropriate source blocks. The one-to-one
mapping model is broken in presence of OpenMP operations that use LLVM's
OpenMPIRBuilder, which produces multiple blocks under the hood. This can lead
to invalid LLVM IR being emitted if OpenMPIRBuilder moved the branch operation
into a basic block different from the one it was originally created in;
specifically, a block that is not a direct predecessor could be used in the PHI
node. Instead, keep track of the mapping between MLIR LLVM dialect branch
operations and their LLVM IR counterparts and take the parent basic block of
the LLVM IR instruction at the moment of connecting the PHI nodes to
predecessors.
This behavior cannot be triggered as of now, but will be once we introduce the
conversion of OpenMP workshare loops.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D92845
Jun Ma [Tue, 8 Dec 2020 07:46:12 +0000 (15:46 +0800)]
[TruncInstCombine] Remove scalable vector restriction
Differential Revision: https://reviews.llvm.org/D92819
Benjamin Kramer [Thu, 10 Dec 2020 09:57:14 +0000 (10:57 +0100)]
Remove Shapet assignment operator that's identical to the default. NFC.
Raphael Isemann [Thu, 10 Dec 2020 09:56:46 +0000 (10:56 +0100)]
[lldb][NFC] Fix a typo in TestCppMultipleInheritance
Benjamin Kramer [Thu, 10 Dec 2020 09:53:56 +0000 (10:53 +0100)]
[Hexagon] Fold single-use variables into assert. NFCI.
Silences unused variable warnings in Release builds.
Benjamin Kramer [Wed, 9 Dec 2020 11:06:51 +0000 (12:06 +0100)]
[mlir][Shape] Make sure tensor_cast(constant_shape) folding uses the correct type
This is still subtle, but I think the test cases are sufficient to show
that it works.
Differential Revision: https://reviews.llvm.org/D92927
David Green [Thu, 10 Dec 2020 09:17:34 +0000 (09:17 +0000)]
[ARM] MVE vcreate tests, for dual lane moves. NFC
LLVM GN Syncbot [Thu, 10 Dec 2020 09:13:09 +0000 (09:13 +0000)]
[gn build] Port
f80b29878b0
Haojian Wu [Thu, 10 Dec 2020 09:11:15 +0000 (10:11 +0100)]
[AST] Fix a constexpr-evaluator crash on error-dependent returnstmt.
When the evaluator encounters an error-dependent returnstmt, before this patch
it returned a ESR_Returned without setting the result, the callsides think this
is a successful execution, and try to access the Result which causes the crash.
The fix is to always return failed as we don't know the result of the
error-dependent return stmt.
Differential Revision: https://reviews.llvm.org/D92969
Luo, Yuanke [Sun, 6 Sep 2020 02:17:22 +0000 (10:17 +0800)]
[X86] AMX programming model.
This patch implements amx programming model that discussed in llvm-dev
(http://lists.llvm.org/pipermail/llvm-dev/2020-August/144302.html).
Thank Hal for the good suggestion in the RA. The fast RA is not in the patch yet.
This patch implemeted 7 components.
1. The c interface to end user.
2. The AMX intrinsics in LLVM IR.
3. Transform load/store <256 x i32> to AMX intrinsics or split the
type into two <128 x i32>.
4. The Lowering from AMX intrinsics to AMX pseudo instruction.
5. Insert psuedo ldtilecfg and build the def-use between ldtilecfg to amx
intruction.
6. The register allocation for tile register.
7. Morph AMX pseudo instruction to AMX real instruction.
Change-Id: I935e1080916ffcb72af54c2c83faa8b2e97d5cb0
Differential Revision: https://reviews.llvm.org/D87981
Adrian Kuegel [Wed, 9 Dec 2020 09:41:33 +0000 (10:41 +0100)]
Add sqrt lowering from standard to ROCDL
Add a lowering for sqrt from standard dialect to ROCDL.
Differential Revision: https://reviews.llvm.org/D92921
Lang Hames [Wed, 9 Dec 2020 01:37:50 +0000 (12:37 +1100)]
[JITLink][ELF] Reformat/add debug logging in ELF_x86_64.cpp.
Moves symbol name to the end of the output and makes other columns fixed width
so that they line up.
Marek Kurdej [Thu, 10 Dec 2020 07:38:41 +0000 (08:38 +0100)]
[libc++] [P1164] [C++20] Make fs::create_directory() error if there is already a non-directory.
Also mark LWG2935 and LWG3079 as complete.
Applied retroactively to previous standards too, as it's a DR.
* https://wg21.link/P1164
* https://wg21.link/lwg2935
* https://wg21.link/lwg3079
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D92769
Marek Kurdej [Thu, 10 Dec 2020 07:37:21 +0000 (08:37 +0100)]
[libc++] Add a script to automatize updating test for a new header.
Idea from D92525.
This script globs include/ directory and updates the tests in test/libcxx.
This patch does not generate module.modulemap nor CMakeLists.txt.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D92656
Kazu Hirata [Thu, 10 Dec 2020 07:34:07 +0000 (23:34 -0800)]
[Tablegen] Use llvm::is_contained (NFC)
Sergey Dmitriev [Thu, 10 Dec 2020 06:51:58 +0000 (22:51 -0800)]
[llvm-link][NFC] Minor cleanup
llvm::Linker::linkModules() is a static member, so there is no need
to pass reference to llvm::Linker instance to loadArFile() function.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D92918
Kazushi (Jam) Marukawa [Thu, 10 Dec 2020 06:10:01 +0000 (15:10 +0900)]
[VE][NFC] Disable VP tests
VP tests recently added don't work on Release mode. They work on
Debug mode, so I disable them on Release mode to make tests work.
Arthur Eubanks [Thu, 10 Dec 2020 06:04:59 +0000 (22:04 -0800)]
[test] Fix coro-retcon.ll under NPM
The full aa-pipeline is required to remove the extra store.
Sam Clegg [Thu, 10 Dec 2020 04:46:37 +0000 (20:46 -0800)]
[lld][WebAssembly] Don't emit names for data segments that we omit
Followup to https://reviews.llvm.org/D92909
Differential Revision: https://reviews.llvm.org/D92997
Jonas Devlieghere [Thu, 10 Dec 2020 02:39:29 +0000 (18:39 -0800)]
[lldb] Kill the inferior instead of detaching during test suite runs
Kill (rather than detach) form the inferior if debugserver loses its
connection to lldb to prevent zombie processes.
Differential revision: https://reviews.llvm.org/D92908
Yuanfang Chen [Thu, 10 Dec 2020 02:16:45 +0000 (18:16 -0800)]
[NFCI] Add a missing triple in clang/test/CodeGen/ppc64le-varargs-f128.c
Richard Smith [Thu, 10 Dec 2020 02:07:52 +0000 (18:07 -0800)]
MSABI: Basic mangling for access to member subobjects in a class
non-type template parameter.
The mangling information used here comes from private communication with
Jon Caves at Microsoft.
Nico Weber [Thu, 10 Dec 2020 02:04:22 +0000 (21:04 -0500)]
[lld/mac] Use xxhash instead of MD5 for computing the UUID
15% faster for linking Chromium's base_unittests.txt, according to ministat:
```
N Min Max Median Avg Stddev
x 10 0.650213 0.
69287586 0.
65793395 0.
66127126 0.
012365407
+ 10 0.
54993701 0.
59006906 0.
55885506 0.
56146643 0.
013215349
Difference at 95.0% confidence
-0.0998048 +/- 0.0120244
-15.0929% +/- 1.81838%
(Student's t, pooled s = 0.0127974)
```
And matches what we do on the other ports.
Differential Revision: https://reviews.llvm.org/D92736
Alina Sbirlea [Sat, 5 Dec 2020 02:04:24 +0000 (18:04 -0800)]
[MemorySSA/docs] Extend MemorySSA documentation.
Fangrui Song [Thu, 10 Dec 2020 01:53:37 +0000 (17:53 -0800)]
[ELF] Rename --[no-]lto-new-pass-manager to --[no-]lto-legacy-pass-manager
Normally we should not delete options. However, the Clang driver passes
`-plugin-opt={new,legacy}-pass-manager` instead of
`--[no-]lto-legacy-pass-manager` (`-plugin-opt=new-pass-manager` has been used
since 7.0), and it is unlikely anyone will use the `--lto-*` style options directly.
So let's rename them to be consistent with the Clang driver option names.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D92988
Arthur Eubanks [Tue, 8 Dec 2020 23:15:10 +0000 (15:15 -0800)]
[LTO][NPM] Default to using NPM under ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER
This affects users of LTO that don't explicitly set UseNewPM.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D92894
Fangrui Song [Thu, 10 Dec 2020 01:26:21 +0000 (17:26 -0800)]
[test] Fix test/Driver/ve-toolchain.cpp
It should specify --sysroot to test the paths of crt1.o/crti.o/crtbegin.o.
For a user who enable VE but do not actually have VE sysroot,
the "nld" command line will have bare "crt1.o" "crti.o" ... "crtbegin.o"
Fangrui Song [Thu, 10 Dec 2020 01:17:28 +0000 (17:17 -0800)]
[test] Fix Misc/time-passes.c
Hansang Bae [Thu, 10 Dec 2020 00:25:26 +0000 (18:25 -0600)]
[OpenMP] Use RTM lock for OMP lock with synchronization hint
This patch introduces a new RTM lock type based on spin lock which is
used for OMP lock with speculative hint on supported architecture.
Differential Revision: https://reviews.llvm.org/D92615
Nico Weber [Thu, 10 Dec 2020 01:11:19 +0000 (20:11 -0500)]
Revert "[clangd] Extract per-dir CDB cache to its own threadsafe class. NFC"
This reverts commit
634a377bd8cbaa515a58295cfd85dcb6a21381c1.
Breaks tests on Windows, see https://reviews.llvm.org/D92381#2443407
Fangrui Song [Thu, 10 Dec 2020 01:10:17 +0000 (17:10 -0800)]
Default CodeGenOptions::LegacyPassManager to !LLVM_ENABLE_NEW_PASS_MANAGER
Fixes test/CodeGen/flatten.c
Duncan P. N. Exon Smith [Thu, 10 Dec 2020 00:56:08 +0000 (16:56 -0800)]
clangd: Migrate to FileEntryRef in TweakTests, NFC
Fangrui Song [Thu, 10 Dec 2020 00:57:36 +0000 (16:57 -0800)]
[Driver] Add -f[no-]legacy-pass-manager to supersede -f[no-]experimental-new-pass-manager
The new PM is considered stable and many downstream groups have adopted it (some
have adopted it for more than two years). Add -f[no-]legacy-pass-manager to reflect the
fact that it is no longer experimental and the legacy pass manager is something we strive to retire.
In the future, when the legacy PM eventually goes away,
-fno-experimental-new-pass-manager and -flegacy-pass-manager will be removed.
This patch also changes -f[no-]legacy-pass-manager to pass `-plugin-opt={new,legacy}-pass-manager` to the linker (supported by both ld.lld and LLVMgold.so) when -flto/-flto=thin is specified
Reviewed By: aeubanks, rsmith
Differential Revision: https://reviews.llvm.org/D92915
Fangrui Song [Thu, 10 Dec 2020 00:43:30 +0000 (16:43 -0800)]
Rename -plugin-opt=no-new-pass-manager to -plugin-opt=legacy-pass-manager
Stanislav Mekhanoshin [Wed, 9 Dec 2020 23:51:21 +0000 (15:51 -0800)]
[AMDGPU] Fix expansion of 192 bit spills in PEI
Differential Revision: https://reviews.llvm.org/D92979
Artem Belevich [Thu, 3 Dec 2020 21:48:37 +0000 (13:48 -0800)]
[DWARF] Allow toolchain to adjust specified DWARF version.
This is needed for CUDA compilation where NVPTX back-end only supports DWARF2,
but host compilation should be allowed to use newer DWARF versions.
Differential Revision: https://reviews.llvm.org/D92617
Duncan P. N. Exon Smith [Thu, 10 Dec 2020 00:31:38 +0000 (16:31 -0800)]
Tooling: Migrate to FileEntryRef in clang::tooling::applyAllReplacements, NFC
Migrate to the `FileEntryRef` overload of `SourceManager::createFileID`.
Duncan P. N. Exon Smith [Thu, 10 Dec 2020 00:15:07 +0000 (16:15 -0800)]
Frontend: Use a getVirtualFileRef for a named pipe main file, NFC
Krzysztof Parzyszek [Wed, 9 Dec 2020 23:52:03 +0000 (17:52 -0600)]
[Hexagon] Silence warnings about unused objects
Krzysztof Parzyszek [Wed, 9 Dec 2020 23:39:13 +0000 (17:39 -0600)]
[Hexagon] Fix build: move template specialization into namespace scope
Scott Linder [Wed, 9 Dec 2020 23:13:15 +0000 (23:13 +0000)]
[MC] Fix ICE with non-newline terminated input
There is an explicit option for the lexer to support this, but we crash
when `-preserve-comments` is enabled because it checks for
`getTok().getString().empty()` to detect the case. This doesn't
work currently because the lexer reports this case as a string of length
1, containing a null byte.
Change the lexer to instead report this case via an empty string, as the
null terminator isn't logically a part of the textual input, and the
check for `.empty()` seems natural and obvious in the calling code.
Reviewed By: niravd
Differential Revision: https://reviews.llvm.org/D92681
River Riddle [Wed, 9 Dec 2020 23:33:49 +0000 (15:33 -0800)]
[mlir][Interfaces] Tidy up the documentation for interfaces
The documentation has become a bit stale with age, and doesn't include great documentation for some newer concepts. This revision tidies up a majority of it, with some more cleanup to come in the future. The documentation for the declarative specification is also moved from OpDefinitions.md to Interfaces.md, which is a much more logical place for it to live.
Differential Revision: https://reviews.llvm.org/D92895
LLVM GN Syncbot [Wed, 9 Dec 2020 23:12:27 +0000 (23:12 +0000)]
[gn build] Port
f5d07a05bbd
Krzysztof Parzyszek [Mon, 7 Sep 2020 19:26:48 +0000 (14:26 -0500)]
[Hexagon] Realign HVX vectors wherever possible
Introduce HexagonVectorCombine as a helper class for vector-related
optimizations.
Duncan P. N. Exon Smith [Wed, 9 Dec 2020 22:50:07 +0000 (14:50 -0800)]
clang-format: Migrate createInMemoryFile to FileEntryRef, NFC
Saleem Abdulrasool [Wed, 9 Dec 2020 22:47:50 +0000 (22:47 +0000)]
X86: use a data driven configuration of Windows x86 libcalls (NFC)
Rather than creating a series of associated calls and ensuring that
everything is lined up, use a table driven approach that ensures that
they two always stay in sync.
Nawrin Sultana [Mon, 30 Nov 2020 23:41:53 +0000 (17:41 -0600)]
[OpenMP] Add strict mode in num_tasks and grainsize
This patch adds new API __kmpc_taskloop_5 to accomadate strict
modifier (introduced in OpenMP 5.1) in num_tasks and grainsize
clause.
Differential Revision: https://reviews.llvm.org/D92352
Duncan P. N. Exon Smith [Thu, 5 Nov 2020 17:37:41 +0000 (12:37 -0500)]
Remove RemappedFiles param from ASTUnit::LoadFromASTFile, NFC
This parameter is always set to `None`. Remove it.
Differential Revision: https://reviews.llvm.org/D90889
Matt Morehouse [Wed, 9 Dec 2020 22:29:28 +0000 (14:29 -0800)]
[DFSan] Add custom wrapper for getsockopt.
The wrapper clears shadow for optval and optlen when written.
Reviewed By: stephan.yichao.zhao, vitalybuka
Differential Revision: https://reviews.llvm.org/D92961
Rahul Joshi [Wed, 9 Dec 2020 17:23:30 +0000 (09:23 -0800)]
[MLIR] Minor cleanup for Shape dialect.
- Remove some unused types from the Shape dialect
- Fix from_extent_tensor to only allow 1D index tensors
- Fix assuming_yield to only allow shape.assuming as the parent op.
- Fix some documentation typos and reword some things.
Differential Revision: https://reviews.llvm.org/D92901
Jason Molenda [Wed, 9 Dec 2020 22:12:15 +0000 (14:12 -0800)]
Ignore DBGArchitecture from dsymForUUID's plist
When the architecture from the returned plist differs from the
architecture lldb will pick when loading the binary file, lldb will
reject the binary as not matching. We are working with UUID's in
this case, so an architecture is not disambiguating anything; it
just opens this possibility for failing to load the specified binary.
Stop reading the architecture from the plist.
<rdar://problem/
71612561>
Differential revision: https://reviews.llvm.org/D92692
Duncan P. N. Exon Smith [Fri, 4 Dec 2020 01:32:32 +0000 (17:32 -0800)]
ARCMigrate: Migrate ObjCMT.cpp over to FileEntryRef
Migrate ObjCMT.cpp from using `const FileEntry*` to `FileEntryRef`. This
is one of the blockers for changing `SourceManager` to use
`FileEntryRef`.
This adds an initial version of `SourceManager::getFileEntryRefForID`,
which uses to `FileEntry::getLastRef`; after `SourceManager` switches,
`SourceManager::getFileEntryForID` will need to call this function.
This also adds uses of `FileEntryRef` as a key in a `DenseMap`, and a
call to `hash_value(Optional)` in `DenseMapInfo<EditEntry>`; support for
these were added in prep commits.
Differential Revision: https://reviews.llvm.org/D92678
Peter Collingbourne [Wed, 9 Dec 2020 21:30:52 +0000 (13:30 -0800)]
scudo: Shrink secondary header and cache entry size by a word on Linux. NFCI.
Normally compilers will allocate space for struct fields even if the
field is an empty struct. Use the [[no_unique_address]] attribute to
suppress that behavior. This attribute that was introduced in C++20,
but compilers that do not support [[no_unique_address]] will ignore
it since it uses C++11 attribute syntax.
Differential Revision: https://reviews.llvm.org/D92966
Scott Linder [Wed, 9 Dec 2020 21:20:28 +0000 (21:20 +0000)]
[MC][AMDGPU] Consume EndOfStatement in asm parser
Avoids spurious newlines showing up in the output when emitting assembly
via MC.
Reviewed By: MaskRay, arsenm
Differential Revision: https://reviews.llvm.org/D92690
Craig Topper [Wed, 9 Dec 2020 18:21:40 +0000 (10:21 -0800)]
[X86] Use APInt::isSignedIntN instead of isIntN for 64-bit ANDs in X86DAGToDAGISel::IsProfitableToFold
Pretty sure we meant to be checking signed 32 immediates here
rather than unsigned 32 bit. I suspect I messed this up because
in MathExtras.h we have isIntN and isUIntN so isIntN differs in
signedness depending on whether you're using APInt or plain integers.
This fixes a case where we didn't fold a constant created
by shrinkAndImmediate. Since shrinkAndImmediate doesn't topologically
sort constants it creates, we can fail to convert the Constant
to a TargetConstant. This leads to very strange behavior later.
Fixes PR48458.
Reid Kleckner [Wed, 9 Dec 2020 21:30:22 +0000 (13:30 -0800)]
Avoid a possible one-byte OOB read off of .drectve sections
Pointed out by Ryan Prichard
Tres Popp [Wed, 9 Dec 2020 20:54:58 +0000 (21:54 +0100)]
[mlir] Allow RegionBranchOps in dependence analysis
This is to prevent assertion failures on scf.if and shape.assuming
operations where this is not enough information currently to handle any
aliasing information.
Differential Revision: https://reviews.llvm.org/D92963
Fangrui Song [Wed, 9 Dec 2020 21:31:03 +0000 (13:31 -0800)]
[LLD][gold] Add -plugin-opt=no-new-pass-manager
-DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=on configured LLD and LLVMgold.so
will use the new pass manager by default. Add an option to
use the legacy pass manager. This will also be used by the Clang driver
when -fno-new-pass-manager (D92915) / -fno-experimental-new-pass-manager is set.
Reviewed By: aeubanks, tejohnson
Differential Revision: https://reviews.llvm.org/D92916
Duncan P. N. Exon Smith [Fri, 4 Dec 2020 20:30:48 +0000 (12:30 -0800)]
Frontend: Migrate to FileEntryRef in CompilerInstance::InitializeSourceManager, NFC
Use `FileManager::getVirtualFileRef` to get the virtual file for stdin,
and add an overload of `SourceManager::overrideFileContents` that takes
a `FileEntryRef`, migrating `CompilerInstance::InitializeSourceManager`.
Differential Revision: https://reviews.llvm.org/D92680
Yuanfang Chen [Wed, 9 Dec 2020 21:10:39 +0000 (13:10 -0800)]
[NFCI] Add missing triple to several LTO tests
Also remove the module triple of clang/test/CodeGenObjC/arc.ll, the
commandline tripe is all it needs.
Scott Linder [Wed, 9 Dec 2020 20:44:20 +0000 (20:44 +0000)]
[AMDGPU][MC] Restore old error position for "too few operands"
Revert part of https://reviews.llvm.org/D92084 to make it simpler to
start consuming the EndOfStatement token within AMDGPU's
ParseInstruction in a future patch. This also brings us back to what
every other target currently does.
A future change to move the position back to the end of the statement
would likely need to audit all of the AMDGPUOperand SMLoc ranges, and
determine the SMLoc for the last character of the last operand.
Reviewed By: dp
Differential Revision: https://reviews.llvm.org/D92960