Alex Lorenz [Thu, 13 Aug 2020 19:05:57 +0000 (12:05 -0700)]
[darwin][driver] fix isMacosxVersionLT minimum supported OS version check
The previous Driver's triple check only worked for -target, but not for -arch -mmacosx-version-min invocations
River Riddle [Thu, 13 Aug 2020 19:05:04 +0000 (12:05 -0700)]
[mlir][docs] Update/Add documentation for MLIRs Pattern Rewrite infrastructure
This infrastructure has evolved a lot over the course of MLIRs lifetime, and has never truly been documented outside of rationale or proposals. This revision aims to document the infrastructure and user facing API, with the rationale specific portions moved to the Rationale folder and updated.
Differential Revision: https://reviews.llvm.org/D85260
River Riddle [Thu, 13 Aug 2020 19:04:57 +0000 (12:04 -0700)]
[mlir][DialectConversion] Update the documentation for dialect conversion
This revision updates the documentation for dialect conversion, as many concepts have changed/evolved over time.
Differential Revision: https://reviews.llvm.org/D85167
Stefan Gränitz [Sun, 2 Aug 2020 12:37:33 +0000 (14:37 +0200)]
[ORC] cloneToNewContext() can work with a const-ref to ThreadSafeModule
Stefan Gränitz [Sun, 2 Aug 2020 12:36:02 +0000 (14:36 +0200)]
[ORC] Fix SymbolLookupSet::containsDuplicates()
shafik [Thu, 13 Aug 2020 17:49:40 +0000 (10:49 -0700)]
[LLDB] Fix how ValueObjectChild handles bit-fields stored in a Scalar in UpdateValue()
When bit-field data was stored in a Scalar in ValueObjectChild during UpdateValue()
it was extracting the bit-field value. Later on in lldb_private::DumpDataExtractor(…)
we were again attempting to extract the bit-field. Which would then not obtain the
correct value. This will remove the extra extraction in UpdateValue().
We hit this specific case when values are passed in registers, which we could only
reproduce in an optimized build.
Differential Revision: https://reviews.llvm.org/D85376
Haowei Wu [Tue, 11 Aug 2020 18:44:22 +0000 (11:44 -0700)]
[elfabi] Move llvm-elfabi related code to InterfaceStub library
This change moves elfabi related code to llvm/InterfaceStub library
so it can be shared by multiple llvm tools without causing cyclic
dependencies.
Differential Revision: https://reviews.llvm.org/D85678
Lang Hames [Thu, 13 Aug 2020 18:44:42 +0000 (11:44 -0700)]
Revert "[llvm-jitlink] Don't demote unreferenced definitions in -harness mode."
This reverts commit
e137b550587a85b0d9c9c539edc79de0122b6946.
This commit broke a test case. Reverting while I investigate.
Stanislav Mekhanoshin [Thu, 13 Aug 2020 18:15:44 +0000 (11:15 -0700)]
[AMDGPU] Inhibit SDWA if target instruction has FI
Differential Revision: https://reviews.llvm.org/D85918
Stanislav Mekhanoshin [Thu, 13 Aug 2020 18:22:01 +0000 (11:22 -0700)]
[AMDGPU] Fix misleading SDWA verifier error. NFC.
The old error from GFX9 shall be updated to GFX9+.
Aditya Kumar [Thu, 13 Aug 2020 07:06:22 +0000 (00:06 -0700)]
Fix PR45442: Bail out when MemorySSA information is not available
Reviewers: sebpop, uabelho, fhahn
Reviewed by: fhahn
Differential Revision: https://reviews.llvm.org/D85881
Dávid Bolvanský [Thu, 13 Aug 2020 18:21:19 +0000 (20:21 +0200)]
[Tests] Removed debug copy command
Dávid Bolvanský [Thu, 13 Aug 2020 18:19:21 +0000 (20:19 +0200)]
[Diagnostics] Skip var decl of structs for -Wstring-concatenation
Lang Hames [Thu, 13 Aug 2020 03:44:05 +0000 (20:44 -0700)]
[llvm-jitlink] Don't demote unreferenced definitions in -harness mode.
Demoting unreferenced externals is unsafe if multiple interdependent test
objects are used, including objects loaded from archives.
Lang Hames [Thu, 13 Aug 2020 00:43:28 +0000 (17:43 -0700)]
[JITLink][MachO] Return an error when MachO TLV relocations are encountered.
MachO TLV relocations aren't supported yet. Error out rather than falling
through to llvm_unreachable.
Sameer Arora [Tue, 28 Jul 2020 16:50:51 +0000 (09:50 -0700)]
[llvm-libtool-darwin] Add support for -arch_only
Add support for -arch_only option for llvm-libtool-darwin. This diff
also adds support for accepting universal files as input and flattening
them to create the required static library. Supports input universal
files contaning both Mach-O object files or archives.
Differences from cctools' libtool:
- `-arch_only` can be specified multiple times
- archives containing universal files are considered invalid (libtool
allows such archives)
Reviewed by jhenderson, smeenai
Differential Revision: https://reviews.llvm.org/D84770
Valentin Clement [Thu, 13 Aug 2020 18:04:43 +0000 (14:04 -0400)]
[flang][openacc] Handle optional end directive in combined construct
OpenACC combined construct can have an optional end directive. This patch handle this
case in the parsing/unparsing with a canonicalization step. Unlike OmpEndLoopDirective,
this doesn't need a special treatment in the pre-fir tree as there is no clause attached to
a AccEndCombinedDirective.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D84481
Sameer Arora [Wed, 29 Jul 2020 14:40:11 +0000 (07:40 -0700)]
[llvm-libtool-darwin] Refactor ArchiveWriter
Refactoring function `writeArchive` in ArchiveWriter. Added a new
function `writeArchiveBuffer` that returns the archive in a memory
buffer instead of writing it out to the disk. This refactor is necessary
so as to allow `llvm-libtool-darwin` to write universal files containing
archives.
Reviewed by jhenderson, MaskRay, smeenai
Differential Revision: https://reviews.llvm.org/D84858
Dávid Bolvanský [Thu, 13 Aug 2020 10:45:14 +0000 (12:45 +0200)]
[BPI] Improve static heuristics for integer comparisons
Similarly as for pointers, even for integers a == b is usually false.
GCC also uses this heuristic.
Reviewed By: ebrevnov
Differential Revision: https://reviews.llvm.org/D85781
Sameer Arora [Mon, 10 Aug 2020 01:58:02 +0000 (18:58 -0700)]
[llvm-install-name-tool] Add more documentation
Add documentation for the remaining options of
`llvm-install-name-tool`.
Reviewed by jhenderson, smeenai
Differential Revision: https://reviews.llvm.org/D85655
peter klausler [Wed, 12 Aug 2020 23:25:26 +0000 (16:25 -0700)]
[flang] Descriptor-based I/O using wrong size for contiguous unformatted I/O
The descriptor-based I/O routine was using the size of the descriptor
rather than the size of the described data for the transfer. Fix,
and add a comment to the relevant API.
Differential Revision: https://reviews.llvm.org/D85863
Simon Pilgrim [Thu, 13 Aug 2020 15:56:08 +0000 (16:56 +0100)]
[X86][SSE] Add HADD combine regression case from rG9bd97d036398
rG9bd97d036398 caused a miscompile of this internal test case
Jonas Devlieghere [Thu, 13 Aug 2020 17:23:52 +0000 (10:23 -0700)]
[lldb] Set the launch flags to GetLaunchInfo().GetLaunchFlags()
Instead of clearing the launch flags, always pass the target's current
launch flags.
Alexander Belyaev [Thu, 13 Aug 2020 16:53:07 +0000 (18:53 +0200)]
[mlir] Test CallOp STD->LLVM conversion.
This exercises the corner case that was fixed in
https://reviews.llvm.org/rG8979a9cdf226066196f1710903d13492e6929563.
The bug can be reproduced when there is a @callee with a custom type argument and @caller has a producer of this argument passed to the @callee.
Example:
func @callee(!test.test_type) -> i32
func @caller() -> i32 {
%arg = "test.type_producer"() : () -> !test.test_type
%out = call @callee(%arg) : (!test.test_type) -> i32
return %out : i32
}
Even though there is a type conversion for !test.test_type, the output IR (before the fix) contained a DialectCastOp:
module {
llvm.func @callee(!llvm.ptr<i8>) -> !llvm.i32
llvm.func @caller() -> !llvm.i32 {
%0 = llvm.mlir.null : !llvm.ptr<i8>
%1 = llvm.mlir.cast %0 : !llvm.ptr<i8> to !test.test_type
%2 = llvm.call @callee(%1) : (!test.test_type) -> !llvm.i32
llvm.return %2 : !llvm.i32
}
}
instead of
module {
llvm.func @callee(!llvm.ptr<i8>) -> !llvm.i32
llvm.func @caller() -> !llvm.i32 {
%0 = llvm.mlir.null : !llvm.ptr<i8>
%1 = llvm.call @callee(%0) : (!llvm.ptr<i8>) -> !llvm.i32
llvm.return %1 : !llvm.i32
}
}
Differential Revision: https://reviews.llvm.org/D85914
David Green [Thu, 13 Aug 2020 17:01:11 +0000 (18:01 +0100)]
[ARM] Mark VMINNMA/VMAXNMA as commutative
These operations take Qda and Rn register operands, which are
commutative so long as the instruction is not predicated.
Differential Revision: https://reviews.llvm.org/D85813
peter klausler [Wed, 12 Aug 2020 23:38:28 +0000 (16:38 -0700)]
[flang] Implement shape analysis of TRANSFER intrinsic function result
The shape (esp. the size) of the result of a call to TRANSFER
is implemented according to the definition in the standard.
Differential Revision: https://reviews.llvm.org/D85866
Jonas Devlieghere [Thu, 13 Aug 2020 16:41:52 +0000 (09:41 -0700)]
[lldb] Skip TestStepScripted with reproducers
Some of the test methods were already skipped because of an unexpected
packet. The test started failing after it was expanded. Skip the whole
test with reproducers so we don't have to add the decorator for every
method.
Cameron McInally [Thu, 13 Aug 2020 16:00:37 +0000 (11:00 -0500)]
[SVE] Lower fixed length vector integer SMIN/SMAX
Differential Revision: https://reviews.llvm.org/D85855
Kadir Cetinkaya [Mon, 6 Jul 2020 13:44:16 +0000 (15:44 +0200)]
[clangd] Move clang-tidy check modifications into ClangdServer
Summary:
This enables sharing the logic between standalone clangd and embedders
of it. The new approach should be same performance-wise, as it is only called
once per addDocument call.
This patch also introduces a blacklisting code path for disabling crashy or
high-noise tests, until we figure out a way to make them work with clangd-setup.
The biggest difference is the way we make use of preambles, hence those checks
can't see directives coming from the preamble section of the file. The second
thing is the fact that code might-not be compiling while clangd is trying to
build an AST, hence some checks might choke on those incomplete ASTs.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, aaron.ballman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83224
Kadir Cetinkaya [Sun, 5 Jul 2020 19:12:11 +0000 (21:12 +0200)]
[clangd] Send EOF before resetting diagnostics consumer
Summary:
Some clang-tidy checkers, e.g. llvm-include-order can emit diagnostics
at this callback (as mentioned in the comments).
Clangd was resetting diag consumer to IgnoreDiags before sending EOF, hence we
were unable to emit diagnostics for such checkers.
This patch changes the order of that reset and preprocosser event to make sure
we emit that diag.
Fixes https://github.com/clangd/clangd/issues/314.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83178
Aditya Kumar [Thu, 13 Aug 2020 07:06:22 +0000 (00:06 -0700)]
Fix PR45442: Bail out when MemorySSA information is not available
Aditya Kumar [Thu, 13 Aug 2020 05:11:50 +0000 (22:11 -0700)]
Add cold attribute to one time construction APIs
_cxa_guard_acquire is used for only one purpose,
namely guarding local static variable initialization,
and since that purpose is definitionally cold,
it should be attributed as cold
Reviewed By: ldionne
Reviewers: mclow.lists, ldionne, jfb, yfeldblum
Differential Revision: https://reviews.llvm.org/D85873
Bjorn Pettersson [Thu, 13 Aug 2020 15:43:12 +0000 (17:43 +0200)]
[VectorCombine] Fix for non-zero addrspace when creating vector load from scalar load
This is a fixup to commit
43bdac290663f4424f9fb, to make sure the
address space from the original load pointer is retained in the
vector pointer.
Resolves problem with
Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
due to address space mismatch.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D85912
Serguei Katkov [Wed, 12 Aug 2020 07:25:18 +0000 (14:25 +0700)]
[InstCombine] Handle gc.relocate(null) in one iteration
InstCombine adds users of transformed instruction to working list to
process on the same iteration. However gc.relocate may have a hidden
user (next gc.relocate) which is connected through gc.statepoint intrinsic and
there is no direct def-use chain between them.
In this case if the next gc.relocation is already processed it will not be added
to worklist and will not be able to be processed on the same iteration.
Let's we have the following case:
A = gc.relocate(null)
B = statepoint(A)
C = gc.relocate(B, hidden(A))
If C is already considered then after replacement of A with null, statepoint B
instruction will be added to the queue but not C.
C can be processed only on the next iteration.
If the chain of relocation is pretty long the many iteration may be required.
This change is to reduce the number of iteration to meet the latest changes
related to reducing infinite loop threshold.
This is a quick (not best) fix. In the follow up patches I plan to move gc relocation
handling into statepoint handler. This should also help to remove unused gc live
entries in statepoint bundle.
Reviewers: reames, dantrushin
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D75598
Sam McCall [Thu, 13 Aug 2020 16:01:47 +0000 (18:01 +0200)]
[clangd] Extract BackgroundIndex::Options struct. NFC
I've dropped the background context parameter, since we in practice just pass the
current context there, and we now have a different way to specify context too.
While here, clean up a couple of comments.
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D83157
Fangrui Song [Thu, 13 Aug 2020 03:50:59 +0000 (20:50 -0700)]
[ELF] --gdb-index: skip SHF_GROUP .debug_info
-gdwarf-5 -fdebug-types-section may produce multiple .debug_info sections. All
except one are type units (.debug_types before DWARF v5). When constructing
.gdb_index, we should ignore these type units. We use a simple heuristic: the
compile unit does not have the SHF_GROUP flag. (This needs to be revisited if
people place compile unit .debug_info in COMDAT groups.)
This issue manifests as a data race: because an object file may have multiple
.debug_info sections, we may concurrently construct `LLDDwarfObj` for the same
file in multiple threads. The threads may access `InputSectionBase::data()`
concurrently on the same input section. `InputSectionBase::data()` does a lazy
uncompress() and rewrites the member variable `rawData`. A thread running zlib
`inflate()` (transitively called by uncompress()) on a buffer with `rawData`
tampered by another thread may fail with `uncompress failed: zlib error: Z_DATA_ERROR`.
Even if no data race occurred in an optimistic run, if there are N .debug_info,
one CU entry and its address ranges will be replicated N times. The result
.gdb_index can be much larger than a correct one.
The new test gdb-index-dwarf5-type-unit.s actually has two compile units. This
cannot be produced with regular approaches (it can be produced with -r
--unique). This is used to demonstrate that the .gdb_index construction code
only considers the last non-SHF_GROUP .debug_info
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D85579
Peter Steinfeld [Thu, 13 Aug 2020 15:07:58 +0000 (08:07 -0700)]
[flang] Fix assert on character literal substrings as arguments
Character literal substrings used as arguments were causing asserts. This
happened when the code was trying to get the DynamicType of the substring. We
were only recording the DynamicType of the Designator on which the substring
was based. For character literal substrings, the Designator was a character
literal, and we weren't handling getting its type.
I fixed this by changing the `GetType()` method for `DynamicType` to check to
see if we were getting the type of a `Substring` and calculating the type of
the substring by getting the number of bytes in an element of the string.
I also changed the test `resolve49.f90` with some tests, one of which causes
the original crash.
Differential Revision: https://reviews.llvm.org/D85908
peter klausler [Wed, 12 Aug 2020 23:35:26 +0000 (16:35 -0700)]
[flang] Correct manipulation of mixed complex expressions
Ensure that mixed complex expressions (one operand complex,
the other not) are properly manipulated; add test.
peter klausler [Wed, 12 Aug 2020 23:20:20 +0000 (16:20 -0700)]
[flang] Ensure Preprocessor::Define saves macro names correctly
This fixes problems with macros defined with -D on the command line
and predefined macros defined in the throwaway driver program.
peter klausler [Wed, 12 Aug 2020 23:09:51 +0000 (16:09 -0700)]
[flang] Correct the default value for PAD= to PAD='YES'.
Sam McCall [Thu, 13 Aug 2020 15:42:58 +0000 (17:42 +0200)]
[clangd] Clean up old test fixture/names a little. NFC
Sanjay Patel [Thu, 13 Aug 2020 14:52:38 +0000 (10:52 -0400)]
[AArch64][x86] add tests for x/sqrt(x); NFC
Fangrui Song [Thu, 13 Aug 2020 03:14:00 +0000 (20:14 -0700)]
[ELF] -r: allow SHT_X86_64_UNWIND to be merged into SHT_PROGBITS
* For .cfi_*, GCC/GNU as emits SHT_PROGBITS type .eh_frame sections.
* Since rL252300, clang emits SHT_X86_64_UNWIND type .eh_frame sections
(originated from Solaris, documented in the x86-64 psABI).
* Some assembly use `.section .eh_frame,"a",@unwind` to generate
SHT_X86_64_UNWIND .eh_frame sections.
In a non-relocatable link, input .eh_frame are combined and there is
only one SyntheticSection .eh_frame in the output section, so the
"section type mismatch" diagnostic does not fire.
In a relocatable link, there is no SyntheticSection .eh_frame. .eh_frame of
mixed types can trigger the diagnostic. This patch fixes it by adding another
special case 0x70000001 (= SHT_X86_64_UNWIND) to canMergeToProgbits().
ld.lld -r gcc.o clang.o => error: section type mismatch for .eh_frame
There was a discussion "RFC: Usefulness of SHT_X86_64_UNWIND" on the x86-64-abi
mailing list. Folks are not wild about making the psABI value 0x70000001 into
gABI, but a few think defining 0x70000001 for .eh_frame may be a good idea for a
new architecture.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D85785
Fangrui Song [Thu, 13 Aug 2020 15:13:26 +0000 (08:13 -0700)]
[llvm-objdump] Change symbol name/PLT decoding errors to warnings
If the referenced symbol of a J[U]MP_SLOT is invalid (e.g. symbol index 0), llvm-objdump -d will bail out:
```
error: 'a': st_name (0x326600) is past the end of the string table of size 0x7
```
where 0x326600 is the st_name field of the first entry past the end of .symtab
Change it to a warning to continue dumping.
`X86/plt.test` uses a prebuilt executable, so I pick `ELF/AArch64/plt.test`
which has a YAML input and can be easily modified.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D85623
Louis Dionne [Thu, 13 Aug 2020 15:10:13 +0000 (11:10 -0400)]
[libc++] Ensure the CI scripts can find Ninja
Ninja isn't necessarily installed on macOS out of the box, so make sure
we use the SDK Ninja instead of relying on one being available on the
system.
Adam Czachorowski [Thu, 13 Aug 2020 14:59:34 +0000 (16:59 +0200)]
[clangd] Revert "[clangd] Fix crash-bug in preamble indexing when using modules."
This reverts commit
4061d9e42cff621462931ac7df9666806c77a237.
Tests are failing in some configuration, likely due to not cleaning up
module cache path before running the test.
Differential Revision: https://reviews.llvm.org/D85907
Valeriy Savchenko [Wed, 12 Aug 2020 08:04:56 +0000 (11:04 +0300)]
[analyzer] Fix crash with pointer to members values
This fix unifies all of the different ways we handled pointer to
members into one. The crash was caused by the fact that the type
of pointer-to-member values was `void *`, and while this works
for the vast majority of cases it breaks when we actually need
to explain the path for the report.
rdar://problem/
64202361
Differential Revision: https://reviews.llvm.org/D85817
Simon Pilgrim [Thu, 13 Aug 2020 14:43:20 +0000 (15:43 +0100)]
Fix unused variable warning. NFC.
Reduce the dyn_cast<> to a isa<> as that's all non-assert builds require, and move the cast<> inside the assert.
Simon Pilgrim [Thu, 13 Aug 2020 13:48:51 +0000 (14:48 +0100)]
rG9bd97d0363987b582 - Revert "[X86][SSE] Fold HOP(SHUFFLE(X),SHUFFLE(Y)) --> SHUFFLE(HOP(X,Y))"
This reverts commit
9bd97d0363987b582e4a92b354b02e86ac068407.
Seeing some codegen issues in internal testing.
Nico Weber [Thu, 13 Aug 2020 14:06:27 +0000 (10:06 -0400)]
clang: Fix minor grammar-o in diag added in
c354b2e3b
Valentin Clement [Wed, 12 Aug 2020 15:48:24 +0000 (11:48 -0400)]
[mlir][openacc] Introduce OpenACC dialect with parallel, data, loop operations
This patch introduces the OpenACC dialect with three operation defined
parallel, data and loop operations with custom parsing and printing.
OpenACC dialect RFC can be find here: https://llvm.discourse.group/t/rfc-openacc-dialect/546/2
Reviewed By: rriddle, kiranchandramohan
Differential Revision: https://reviews.llvm.org/D84268
Louis Dionne [Thu, 13 Aug 2020 13:51:20 +0000 (09:51 -0400)]
[libc++][test] Fix another -Wstring-concatenation warning
avarmapml [Thu, 13 Aug 2020 13:39:22 +0000 (19:09 +0530)]
[MLIR] Support for ReturnOps in memref map layout normalization
-- This commit handles the returnOp in memref map layout normalization.
-- An initial filter is applied on FuncOps which helps us know which functions can be
a suitable candidate for memref normalization which doesn't lead to invalid IR.
-- Handles memref map normalization for external function assuming the external function
is normalizable.
Differential Revision: https://reviews.llvm.org/D85226
LLVM GN Syncbot [Thu, 13 Aug 2020 13:35:44 +0000 (13:35 +0000)]
[gn build] Port
d17437d2bd8
Matt Arsenault [Thu, 13 Aug 2020 00:02:05 +0000 (20:02 -0400)]
DAG: Don't pass 0 alignment value to allowsMisalignedMemoryAccesses
I think not unconditionally passing getDstAlign is broken, but leave
that for another change.
Eduardo Caldas [Thu, 13 Aug 2020 12:27:02 +0000 (12:27 +0000)]
[SyntaxTree] Clean `#includes` in `TreeTestBase.h`
Differential Revision: https://reviews.llvm.org/D85898
Eduardo Caldas [Thu, 13 Aug 2020 10:13:59 +0000 (10:13 +0000)]
[SyntaxTree] Split `TreeTest.cpp`
We extract the test infrastructure into `TreeTestBase.h` and split the
tests into `MutationsTest.cpp` and `BuildTreeTest.cpp`
Roman Lebedev [Thu, 13 Aug 2020 13:04:34 +0000 (16:04 +0300)]
[NFC] Add test case showing the miscompile being fixed by D83507
See https://reviews.llvm.org/D83507
David Stenberg [Thu, 13 Aug 2020 06:55:39 +0000 (08:55 +0200)]
[InstCombine] Fix incorrect Modified status
When removing instructions from unreachable blocks, and only debug info
intrinsics were removed, InstCombine could incorrectly return a false
Modified status.
This is fixed by making removeAllNonTerminatorAndEHPadInstructions()
also return how many debug info intrinsics that were removed, and take
that into account.
This was caught using the check introduced by D80916.
Reviewed By: majnemer
Differential Revision: https://reviews.llvm.org/D85839
Michael Forster [Thu, 13 Aug 2020 12:54:02 +0000 (14:54 +0200)]
Introduce ns_error_domain attribute.
ns_error_domain can be used by, e.g. NS_ERROR_ENUM, in order to
identify a global declaration representing the domain constant.
Introduces the attribute, Sema handling, diagnostics, and test case.
This is cherry-picked from https://github.com/llvm/llvm-project-staging/commit/
a14779f504b02ad0e4dbc39d6d10cadc7ed4cfd0
and adapted to updated Clang APIs.
Reviewed By: gribozavr2, aaron.ballman
Differential Revision: https://reviews.llvm.org/D84005
Carl Ritson [Thu, 13 Aug 2020 11:56:32 +0000 (20:56 +0900)]
[AMDGPU] Fix missed SI_RETURN_TO_EPILOG in pre-emit peephole
SIPreEmitPeephole does not process all terminators, which means
it can fail to handle SI_RETURN_TO_EPILOG if immediately preceeded
by a branch to the early exit block.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D85872
Louis Dionne [Thu, 13 Aug 2020 12:48:12 +0000 (08:48 -0400)]
[libc++][test] Fix -Wstring-concatenation warnings
Aaron Ballman [Thu, 13 Aug 2020 12:47:40 +0000 (08:47 -0400)]
Support the standards-based dates for __has_c_attribute
WG14 N2481 was adopted with minor modifications at the latest WG14 meetings.
The only modification to the paper was to correct the date for the deprecated
attribute to be 201904L (the corrected date value will be present in WG14
N2553 when it gets published).
Louis Dionne [Wed, 12 Aug 2020 21:56:16 +0000 (17:56 -0400)]
[libc++] Use CMake interface targets to setup benchmark flags
This also fixes an issue where the benchmarks were being built with C++14
instead of C++17, as they should be.
Dávid Bolvanský [Thu, 13 Aug 2020 12:37:07 +0000 (14:37 +0200)]
Revert "[BPI] Improve static heuristics for integer comparisons"
This reverts commit
44587e2f7e732604cd6340061d40ac21e7e188e5. Sanitizer tests need to be updated.
Sam McCall [Thu, 13 Aug 2020 12:27:15 +0000 (14:27 +0200)]
[clangd] Express dumpAST in tests as a customAction()
Dávid Bolvanský [Thu, 13 Aug 2020 10:45:14 +0000 (12:45 +0200)]
[BPI] Improve static heuristics for integer comparisons
Similarly as for pointers, even for integers a == b is usually false.
GCC also uses this heuristic.
Reviewed By: ebrevnov
Differential Revision: https://reviews.llvm.org/D85781
Raphael Isemann [Thu, 13 Aug 2020 11:44:25 +0000 (13:44 +0200)]
[lldb][NFC] Use llvm::is_contained instead of std::find in a few places
Simon Pilgrim [Thu, 13 Aug 2020 11:42:43 +0000 (12:42 +0100)]
[X86][SSE] IsElementEquivalent - add HOP(X,X) support
For HADD/HSUB/PACKS ops with repeated operands the lower/upper half element of each lane are known to be equivalent
Paul Walker [Mon, 10 Aug 2020 18:02:02 +0000 (19:02 +0100)]
[SVE] Lower fixed length vector integer shifts.
Differential Revision: https://reviews.llvm.org/D85724
Kerry McLaughlin [Thu, 13 Aug 2020 10:25:43 +0000 (11:25 +0100)]
[SVE][CodeGen] Legalisation of EXTRACT_VECTOR_ELT for scalable vectors
This patch changes SplitVecOp_EXTRACT_VECTOR_ELT to work correctly
for scalable vectors and also fixes an a bug in DAGCombiner where
the scalable property is dropped in visitTRUNCATE when attempting
to fold an extract + a truncate.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D85754
Anna Welker [Thu, 13 Aug 2020 11:22:43 +0000 (12:22 +0100)]
[ARM][MVE] Fix for tail predication for loops containing MVE gather/scatters
Fix to include non-predicated version of write-back gather in special case
treatment for deducting the instruction type.
(This is fixing https://reviews.llvm.org/D85138 for corner cases)
Differential Revision: https://reviews.llvm.org/D85889
Simon Pilgrim [Thu, 13 Aug 2020 11:14:18 +0000 (12:14 +0100)]
BranchFolding.cpp - removes includes already included by BranchFolding.h. NFC.
Florian Hahn [Thu, 13 Aug 2020 10:56:40 +0000 (11:56 +0100)]
[DSE,MSSA] Fix crash when using tryToMergePartialOverlappingStores.
We are re-using tryToMergePartialOverlappingStores, which requires
earlier to domiante Later. In the long run,
tryToMergeParialOverlappingStores should be re-written using MemorySSA.
Fixes PR46513.
Georgii Rymar [Wed, 12 Aug 2020 11:47:15 +0000 (14:47 +0300)]
[llvm-readobj/elf] - Cleanup helpers that are used to print segment types. NFCI.
`getElfSegmentType` and `getElfPtType` are methods that are used for printing
segment types for LLVM and GNU styles accordingly.
This patch does a cleanup and simplification that allows to avoid
the code duplication and to get rid of one macro.
Differential revision: https://reviews.llvm.org/D85830
Paul Walker [Tue, 19 May 2020 19:14:17 +0000 (20:14 +0100)]
[SVE] Lower fixed length vector integer ISD::SETCC operations.
Differential Revision: https://reviews.llvm.org/D85831
Dávid Bolvanský [Thu, 13 Aug 2020 10:58:45 +0000 (12:58 +0200)]
Revert "[BPI] Improve static heuristics for integer comparisons"
This reverts commit
385c9d673f217e176b18e7bf6fe055154ac589c6.
Paul Walker [Thu, 6 Aug 2020 17:14:40 +0000 (18:14 +0100)]
[SVE] Lower fixed length integer extend operations.
Differential Revision: https://reviews.llvm.org/D85640
Georgii Rymar [Wed, 12 Aug 2020 12:49:37 +0000 (15:49 +0300)]
[llvm-readobj/elf][test] - Refine --headers testing and the related code comment.
Specifying --headers is equivalent to setting --file-headers,
--program-headers and --section-headers at the same time.
The existent test case uses a precompiled object and doesn't test the
output properly. This patch fixes it.
Differential revision: https://reviews.llvm.org/D85832
Dávid Bolvanský [Thu, 13 Aug 2020 10:45:14 +0000 (12:45 +0200)]
[BPI] Improve static heuristics for integer comparisons
Similarly as for pointers, even for integers a == b is usually false.
GCC also uses this heuristic.
Reviewed By: ebrevnov
Differential Revision: https://reviews.llvm.org/D85781
Simon Pilgrim [Thu, 13 Aug 2020 10:43:12 +0000 (11:43 +0100)]
SplitKit.cpp - removes includes already included by SplitKit.h. NFC.
Don't duplicate includes already provided by the module header.
Simon Pilgrim [Thu, 13 Aug 2020 10:23:45 +0000 (11:23 +0100)]
DwarfDebug.cpp - removes includes already included by DwarfDebug.h. NFC.
Don't duplicate includes already provided by the module header.
Xing GUO [Thu, 13 Aug 2020 10:37:58 +0000 (18:37 +0800)]
[DWARFYAML] Replace InitialLength with Format and Length. NFC.
This change replaces the InitialLength of pub-tables with Format and
Length. All the InitialLength fields have been removed.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D85880
Raphael Isemann [Thu, 13 Aug 2020 10:28:51 +0000 (12:28 +0200)]
[lldb][NFC] Fix indentation in TCPSocket::CloseListenSockets
Sam McCall [Thu, 13 Aug 2020 08:43:51 +0000 (10:43 +0200)]
[clangd] Add ClangdServer::customAction() extension point
This lets basic AST-consuming actions be defined outside clangdserver.
(it essentially exposes TUScheduler::runWithAST).
Two use cases for now:
- replace ClangdServer::dumpAST, which doesn't really belong in the public
interface (a followup patch will do this)
- allow embedders to add/experiment with extra features
(e.g. I know some who want to try crazy AST+ML code completion...)
Maybe in the future we should use this sort of mechanism to make ClangdServer
less of a monolith, but that's not in scope for now.
This would probably require a richer and more carefully-thought-out API.
Differential Revision: https://reviews.llvm.org/D85883
David Sherwood [Fri, 31 Jul 2020 12:56:02 +0000 (13:56 +0100)]
[SVE][CodeGen] Fix scalable vector issues in DAGTypeLegalizer::GenWidenVectorStores
In DAGTypeLegalizer::GenWidenVectorStores the algorithm assumes it only
ever deals with fixed width types, hence the offsets for each individual
store never take 'vscale' into account. I've changed the main loop in
that function to use TypeSize instead of unsigned for tracking the
remaining store amount and offset increment. In addition, I've changed
the loop to use the new IncrementPointer helper function for updating
the addresses in each iteration, since this handles scalable vector
types.
Whilst fixing this function I also fixed a minor issue in
IncrementPointer whereby we were not adding the no-unsigned-wrap flag
for the add instruction in the same way as the fixed width case does.
Also, I've added a report_fatal_error in GenWidenVectorTruncStores,
since this code currently uses a sequence of element-by-element scalar
stores.
I've added new tests in
CodeGen/AArch64/sve-intrinsics-stores.ll
CodeGen/AArch64/sve-st1-addressing-mode-reg-imm.ll
for the changes in GenWidenVectorStores.
Differential Revision: https://reviews.llvm.org/D84937
David Sherwood [Tue, 14 Jul 2020 12:50:21 +0000 (13:50 +0100)]
[CodeGen] In narrowExtractedVectorLoad bail out for scalable vectors
In narrowExtractedVectorLoad there is an optimisation that tries to
combine extract_subvector with a narrowing vector load. At the moment
this produces warnings due to the incorrect calls to
getVectorNumElements() for scalable vector types. I've got this
working for scalable vectors too when the extract subvector index
is a multiple of the minimum number of elements. I have added a
new variant of the function:
MachineFunction::getMachineMemOperand
that copies an existing MachineMemOperand, but replaces the pointer
info with a null version since we cannot currently represent scaled
offsets.
I've added a new test for this particular case in:
CodeGen/AArch64/sve-extract-subvector.ll
Differential Revision: https://reviews.llvm.org/D83950
Florian Hahn [Thu, 13 Aug 2020 09:19:59 +0000 (10:19 +0100)]
[InstCombine] Precommit tests for PR47149.
Rainer Orth [Thu, 13 Aug 2020 09:12:52 +0000 (11:12 +0200)]
[test] XFAIL two tests with inlining debug info issues on Sparc
Currently only two test failures remain on Sparc, both
`sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`:
LLVM :: DebugInfo/Generic/debug-label-inline.ll
LLVM :: Linker/subprogram-linkonce-weak.ll
They seem related in that debug info isn't generated for instruction
bundles (like `retl+add` in the delay slot).
I've filed separate bugs for both files (Bug 47129 and 47131), though it's
probably the same issue.
This patch `XFAIL`s the tests.
Tested on `sparcv9-sun-solaris2.11` and `amd64-pc-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D85827
Sebastian Neubauer [Thu, 13 Aug 2020 08:40:24 +0000 (10:40 +0200)]
[AMDGPU] Fix typo. NFC
Rainer Orth [Thu, 13 Aug 2020 08:20:52 +0000 (10:20 +0200)]
[compiler-rt][asan][test] Skipt sanitizer_common tests on Sparc
When building on `sparc64-unknown-linux-gnu`, I found that a large number
of `SanitizerCommon-asan-sparc*-Linux` tests were `FAIL`ing, like
SanitizerCommon-asan-sparc-Linux :: Linux/aligned_alloc-alignment.cpp
[...]
SanitizerCommon-asan-sparcv9-Linux :: Linux/aligned_alloc-alignment.cpp
[...]
many of them due to
fatal error: error in backend: Function "_Z14User_OnSIGSEGViP9siginfo_tPv": over-aligned dynamic alloca not supported.
which breaks ASan on Sparc. Currently ASan is only built for the benefit
of `gcc` where it does work. However, when enabling the compilation in
`compiler-rt` to make certain it continues to build, I missed
`compiler-rt/test/sanitizer_common` when disabling ASan testing on Sparc
(it's not yet enabled on Solaris).
This patch fixes the issue.
Tested on `sparcv9-sun-solaris2.11` with the `sanitizer_comon` testsuite enabled.
Differential Revision: https://reviews.llvm.org/D85732
Eduardo Caldas [Wed, 12 Aug 2020 13:51:52 +0000 (13:51 +0000)]
[SyntaxTree] Rename tests following `TestSuite_TestCase` + nits
Eduardo Caldas [Tue, 11 Aug 2020 16:28:00 +0000 (16:28 +0000)]
[SyntaxTree] Split tests for expressions
We do that because:
* Big tests generated big tree dumps that could hardly serve as documentation.
* In most cases the tests didn't share setup, thus there was not much addition in lines of code.
We split tests for:
* `UserDefinedLiteral`
* `NestedBinaryOperator`
* `UserDefinedBinaryOperator`
* `UserDefinedPrefixOperator`
* `QualifiedId`
Differential Revision: https://reviews.llvm.org/D85819
Michael Kruse [Thu, 13 Aug 2020 08:01:29 +0000 (03:01 -0500)]
[flang] Compilation fix.
unlink() was changed to llvm::sys::fs::remove() in f18.cpp, but the same
change also has to be applied to f18-parse-demo.cpp.
Sam McCall [Tue, 11 Aug 2020 22:06:52 +0000 (00:06 +0200)]
[Parser] Suppress -Wempty-translation-unit if this is a header file
This is motivated by tooling (clangd, libclang etc) - headers without
declarations are legitimate even if they're not valid TUs.
The other use -x c-header cases (PCH/modules) are nonstandard anyway and this
warning doesn't seem necessary there either.
Differential Revision: https://reviews.llvm.org/D85789
Saiyedul Islam [Thu, 13 Aug 2020 07:27:15 +0000 (07:27 +0000)]
[OpenMP] Ensure testing for versions 4.5 and default - Part 1
Many OpenMP Clang tests do not RUN for version 4.5 and the default
version. This first patch in the series only handles test cases
which do not require any modifications in the CHECK lines after
adding RUN lines for default version.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D84844
Michael Kruse [Wed, 12 Aug 2020 21:54:41 +0000 (16:54 -0500)]
[flang][msvc] Use platform-independent primitives in temporary f18 driver.
Use functions for process launching, temporary file creation and file deletion from LLVM support library instead of POSIX-specific ones.
This patch is part of the series to [[ http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html | make flang compilable with MS Visual Studio ]].
Reviewed By: DavidTruby
Differential Revision: https://reviews.llvm.org/D85660
Qiu Chaofan [Thu, 13 Aug 2020 07:02:07 +0000 (15:02 +0800)]
[NFC] [PowerPC] Rename SPE strict conversion test
Ali Tamur [Thu, 13 Aug 2020 06:02:17 +0000 (23:02 -0700)]
Revert "[SCEV] Look through single value PHIs."
This reverts commit
e441b7a7a0a72c28daf5a8e594559c667e5b4534.
This patch causes a compile error in tensorflow opensource project. The stack trace looks like:
Point of crash:
llvm/include/llvm/Analysis/LoopInfoImpl.h : line 35
(gdb) ptype *this
type = const class llvm::LoopBase<llvm::BasicBlock, llvm::Loop> [with BlockT = llvm::BasicBlock, LoopT = llvm::Loop]
(gdb) p *this
$1 = {ParentLoop = 0x0, SubLoops = std::vector of length 0, capacity 0, Blocks = std::vector of length 0, capacity 1,
DenseBlockSet = {<llvm::SmallPtrSetImpl<llvm::BasicBlock const*>> = {<llvm::SmallPtrSetImplBase> = {<llvm::DebugEpochBase> = {Epoch = 3}, SmallArray = 0x1b2bf6c8, CurArray = 0x1b2bf6c8,
CurArraySize = 8, NumNonEmpty = 0, NumTombstones = 0}, <No data fields>}, SmallStorage = {0xfffffffffffffffe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}, IsInvalid = true}
(gdb) p *this->DenseBlockSet->CurArray
$2 = (const void *) 0xfffffffffffffffe
I will try to get a case from tensorflow or use creduce to get a small case.
Nadav Rotem [Thu, 13 Aug 2020 05:47:53 +0000 (22:47 -0700)]
[Clang options] Optimize optionMatches() runtime by removing mallocs
The method optionMatches() constructs 9865 std::string instances when comparing different
options. Many of these instances exceed the size of the internal storage and force memory
allocations. This patch adds an early exit check that eliminates most of the string allocations
while keeping the code simple.
Example inputs:
Prefix: /, Name: Fr
Prefix: -, Name: Fr
Prefix: -, Name: fsanitize-address-field-padding=
Prefix: -, Name: fsanitize-address-globals-dead-stripping
Prefix: -, Name: fsanitize-address-poison-custom-array-cookie
Prefix: -, Name: fsanitize-address-use-after-scope
Prefix: -, Name: fsanitize-address-use-odr-indicator
Prefix: -, Name: fsanitize-blacklist=
Differential Revision: D85538