Kai Luo [Fri, 11 Jun 2021 23:21:40 +0000 (23:21 +0000)]
[AIX][compiler-rt] Fix cmake build of libatomic for cmake-3.16+
cmake-3.16+ for AIX changes the default behavior of building a `SHARED` library which breaks AIX's build of libatomic, i.e., cmake-3.16+ builds `SHARED` as an archive of dynamic libraries. To fix it, we have to build `libatomic.so.1` as `MODULE` which keeps `libatomic.so.1` as an normal dynamic library.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D103786
Adrian Prantl [Fri, 11 Jun 2021 22:18:25 +0000 (15:18 -0700)]
Allow signposts to take advantage of deferred string substitution
One nice feature of the os_signpost API is that format string
substitutions happen in the consumer, not the logging
application. LLVM's current Signpost class doesn't take advantage of
this though and instead always uses a static "Begin/End %s" format
string.
This patch uses variadic macros to allow the API to be used as
intended. Unfortunately, the primary use-case I had in mind (the
LLDB_SCOPED_TIMER() macro) does not get much better from this, because
__PRETTY_FUNCTION__ is *not* a macro, but a static string, so
signposts created by LLDB_SCOPED_TIMER() still use a static "%s"
format string. At least LLDB_SCOPED_TIMERF() works as intended.
This reapplies the previsously reverted patch with support for
platforms where signposts are unavailable.
Differential Revision: https://reviews.llvm.org/D103575
Jez Ng [Fri, 11 Jun 2021 23:49:54 +0000 (19:49 -0400)]
[lld-macho] Have dead-stripping work with literal sections
Literal sections are not atomically live or dead. Rather,
liveness is tracked for each individual literal they contain. CStrings
have their liveness tracked via a `live` bit in StringPiece, and
fixed-width literals have theirs tracked via a BitVector.
The live-marking code now needs to track the offset within each section
that is to be marked live, in order to identify the literal at that
particular offset.
Numbers for linking chromium_framework on my 3.2 GHz 16-Core Intel Xeon W
with both `-dead_strip` and `--deduplicate-literals`, with and without this diff
applied:
```
N Min Max Median Avg Stddev
x 20 4.32 4.44 4.375 4.372 0.
03105174
+ 20 4.3 4.39 4.36 4.3595 0.
023277502
No difference proven at 95.0% confidence
```
This gives us size savings of about 0.4%.
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D103979
Jez Ng [Fri, 11 Jun 2021 23:49:53 +0000 (19:49 -0400)]
[lld-macho][nfc] Have InputSection ctors take some parameters
This is motivated by an upcoming diff in which the
WordLiteralInputSection ctor sets itself up based on the value of its
section flags. As such, it needs to be passed the `flags` value as part
of its ctor parameters, instead of having them assigned after the fact
in `parseSection()`. While refactoring code to make that possible, I
figured it would make sense for the other InputSections to also take
their initial values as ctor parameters.
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D103978
Jez Ng [Fri, 11 Jun 2021 23:49:52 +0000 (19:49 -0400)]
[lld-macho][nfc] Move liveness-tracking fields into ConcatInputSection
These fields currently live in the parent InputSection class,
but they should be specific to ConcatInputSection, since the other
InputSection classes (that contain literals) aren't atomically live or
dead -- rather their component string/int literals should have
individual liveness states. (An upcoming diff will add liveness bits for
StringPieces and fixed-sized literals.)
I also factored out some asserts for isCoalescedWeak() in MarkLive.cpp.
We now avoid putting coalesced sections in the `inputSections` vector,
so we don't have to check/assert against it everywhere.
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D103977
Jez Ng [Fri, 11 Jun 2021 23:49:50 +0000 (19:49 -0400)]
[lld-macho] Deduplicate fixed-width literals
Conceptually, the implementation is pretty straightforward: we put each
literal value into a hashtable, and then write out the keys of that
hashtable at the end.
In contrast with ELF, the Mach-O format does not support variable-length
literals that aren't strings. Its literals are either 4, 8, or 16 bytes
in length. LLD-ELF dedups its literals via sorting + uniq'ing, but since
we don't need to worry about overly-long values, we should be able to do
a faster job by just hashing.
That said, the implementation right now is far from optimal, because we
add to those hashtables serially. To parallelize this, we'll need a
basic concurrent hashtable (only needs to support concurrent writes w/o
interleave reads), which shouldn't be to hard to implement, but I'd like
to punt on it for now.
Numbers for linking chromium_framework on my 3.2 GHz 16-Core Intel Xeon W:
N Min Max Median Avg Stddev
x 20 4.27 4.39 4.315 4.3225 0.
033225703
+ 20 4.36 4.82 4.44 4.4845 0.
13152846
Difference at 95.0% confidence
0.162 +/- 0.0613971
3.74783% +/- 1.42041%
(Student's t, pooled s = 0.0959262)
This corresponds to binary size savings of 2MB out of 335MB, or 0.6%.
It's not a great tradeoff as-is, but as mentioned our implementation can
be signficantly optimized, and literal dedup will unlock more
opportunities for ICF to identify identical structures that reference
the same literals.
Reviewed By: #lld-macho, gkm
Differential Revision: https://reviews.llvm.org/D103113
Adrian Prantl [Fri, 11 Jun 2021 23:46:10 +0000 (16:46 -0700)]
Revert "Allow signposts to take advantage of deferred string substitution"
I forgot to make the LLDB macro conditional on Linux.
This reverts commit
541ccd1c1bb23e1e20a382844b35312c0caffd79.
Andrew Litteken [Fri, 11 Jun 2021 23:15:29 +0000 (18:15 -0500)]
[IRSim] Strip out the findSimilarity call from the constructor
Both doInitialize and runOnModule were running the entire analysis
due to the actual work being done in the constructor. Strip it out here
and only get the similarity during runOnModule.
Author: lanza
Reviewers: AndrewLitteken, paquette, plofti
Differential Revision: https://reviews.llvm.org/D92524
Adrian Prantl [Fri, 11 Jun 2021 22:51:35 +0000 (15:51 -0700)]
Disambiguate usage of struct mach_header and other MachO definitions.
Unfortunately the Darwin signpost header also pulls in the system
MachO header and so we need to make sure to use the LLVM versions of
those definitions.
Adrian Prantl [Fri, 11 Jun 2021 22:18:25 +0000 (15:18 -0700)]
Allow signposts to take advantage of deferred string substitution
One nice feature of the os_signpost API is that format string
substitutions happen in the consumer, not the logging
application. LLVM's current Signpost class doesn't take advantage of
this though and instead always uses a static "Begin/End %s" format
string.
This patch uses variadic macros to allow the API to be used as
intended. Unfortunately, the primary use-case I had in mind (the
LLDB_SCOPED_TIMER() macro) does not get much better from this, because
__PRETTY_FUNCTION__ is *not* a macro, but a static string, so
signposts created by LLDB_SCOPED_TIMER() still use a static "%s"
format string. At least LLDB_SCOPED_TIMERF() works as intended.
Differential Revision: https://reviews.llvm.org/D103575
Alexander Shaposhnikov [Fri, 11 Jun 2021 23:34:59 +0000 (16:34 -0700)]
[llvm-objcopy][MachO] Do not strip symbols with the flag REFERENCED_DYNAMICALLY set
Do not strip symbols having the flag REFERENCED_DYNAMICALLY set.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D104092
Reid Kleckner [Fri, 11 Jun 2021 23:12:07 +0000 (16:12 -0700)]
[ASan/Win] Hide index from compiler to avoid new clang warning
Arthur Eubanks [Fri, 11 Jun 2021 22:59:20 +0000 (15:59 -0700)]
[NFC][OpaquePtr] Make getMemoryParamAllocType() compatible with opaque pointers
These ABI attributes now always require the type parameter.
sret was missing from the first set of checks but was covered by the
second set.
Sanjay Patel [Fri, 11 Jun 2021 17:57:56 +0000 (13:57 -0400)]
[InstCombine] add tests for bit manipulation intrinsics with bool values; NFC
Sanjay Patel [Fri, 11 Jun 2021 17:43:34 +0000 (13:43 -0400)]
[InstCombine] update test checks; NFC
Kevin Athey [Fri, 11 Jun 2021 20:39:35 +0000 (13:39 -0700)]
[sanitizer] Remove numeric values from -asan-use-after-return flag. (NFC)
for issue: https://github.com/google/sanitizers/issues/1394
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D104152
Kevin Athey [Fri, 11 Jun 2021 19:46:15 +0000 (12:46 -0700)]
[sanitizer] Replace -mllvm -asan-use-after-return in compile-rt tests with -fsanitize-address-use-after-return (NFC)
for issue: https://github.com/google/sanitizers/issues/1394
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D104146
Andrew Litteken [Fri, 11 Jun 2021 20:41:36 +0000 (15:41 -0500)]
[IRSim] Don't copy the Mapper for createCandidatesFromSuffixTree
Every invocation this was copying the Mapper for no reason. Take a const
ref instead.
Author: lanza
Reviewers: AndrewLitteken, plofti, paquette,
Differential Review: https://reviews.llvm.org/D92532
Raphael Isemann [Fri, 11 Jun 2021 20:43:38 +0000 (22:43 +0200)]
[lldb] Remove GCC XFAIL for TestCPPAuto and TestClassTemplateParameterPack
Both tests are passing for GCC>8 on Linux so let's mark them as passing.
TestCPPAuto was originally disabled due to "an problem with debug info generation"
in
ea35dbeff29f3095df3ad1d77cce3d9e5b197e7c .
TestClassTemplateParameterPack was disabled without explanation in
0f01fb39e3fe3d8e99df1dd185e75ad584b777b3 .
Roman Lebedev [Fri, 11 Jun 2021 20:26:17 +0000 (23:26 +0300)]
[NFC][X86][Codegen] Megacommit: mass-regenerate all check lines that were already autogenerated
The motivation is that the update script has at least two deviations
(`<...>@GOT`/`<...>@PLT`/ and not hiding pointer arithmetics) from
what pretty much all the checklines were generated with,
and most of the tests are still not updated, so each time one of the
non-up-to-date tests is updated to see the effect of the code change,
there is a lot of noise. Instead of having to deal with that each
time, let's just deal with everything at once.
This has been done via:
```
cd llvm-project/llvm/test/CodeGen/X86
grep -rl "; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py" | xargs -L1 <...>/llvm-project/llvm/utils/update_llc_test_checks.py --llc-binary <...>/llvm-project/build/bin/llc
```
Not all tests were regenerated, however.
Daniil Fukalov [Tue, 8 Jun 2021 16:53:28 +0000 (19:53 +0300)]
[NFC][CostModel] Fixed comment that comparisons work regardless of the state.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D104068
Andrew Litteken [Fri, 11 Jun 2021 20:44:08 +0000 (15:44 -0500)]
Revert "[IRSim] Adding basic implementation of llvm-sim."
This reverts commit
f47d00c54b52bd8adf9b8725912ea1cd0f1873d5.
Philip Reames [Fri, 11 Jun 2021 20:30:10 +0000 (13:30 -0700)]
Allow ptrtoint/inttoptr of non-integral pointer types in IR
I don't like landing this change, but it's an acknowledgement of a practical reality. Despite not having well specified semantics for inttoptr and ptrtoint involving non-integral pointer types, they are used in practice. Here's a quick summary of the current pragmatic reality:
* I happen to know that the main external user of non-integral pointers has effectively disabled the verifier rules.
* RS4GC (the lowering pass for abstract GC machine model which is the key motivation for non-integral pointers), even supports them. We just have all the tests using an integral pointer space to let the verifier run.
* Certain idioms (such as alignment checks for alignment N, where any relocation is guaranteed to be N byte aligned) are fine in practice.
* As implemented, inttoptr/ptrtoint are CSEd and are not control dependent. This means that any code which is intending to check a particular bit pattern at site of use must be wrapped in an intrinsic or external function call.
This change allows them in the Verifier, and updates the LangRef to specific them as implementation dependent. This allows us to acknowledge current reality while still leaving ourselves room to punt on figuring out "good" semantics until the future.
Alex Lorenz [Fri, 11 Jun 2021 20:23:44 +0000 (13:23 -0700)]
[clang][ObjC] allow the use of NSAttributedString * argument type with format attribute
This is useful for APIs that want to accept an attributed NSString as their format string
rdar://
79163229
Andrew Litteken [Mon, 7 Jun 2021 15:57:39 +0000 (10:57 -0500)]
[IRSim] Adding basic implementation of llvm-sim.
This is a similarity visualization tool that accepts a Module and
passes it to the IRSimilarityIdentifier. The resulting SimilarityGroups
are output in a JSON file.
Tests are found in test/tools/llvm-sim and check for the file not found,
a bad module, and that the JSON is created correctly.
Reviewers: paquette, jroelofs, MaskRay
Recommit of:
15645d044bcfe2a0f63156048b302f997a717688 to fix linking
errors.
Differential Revision: https://reviews.llvm.org/D86974
Arthur Eubanks [Fri, 11 Jun 2021 19:51:25 +0000 (12:51 -0700)]
[docs][OpaquePtr] Add some specific examples of what needs to be done
Marius Brehler [Fri, 11 Jun 2021 17:28:30 +0000 (19:28 +0200)]
[mlir][docs] Reorder PassWrapper arguments
Fixes the order of template arguments passed to the `PassWrapper`.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D104132
Peter Steinfeld [Fri, 11 Jun 2021 16:28:26 +0000 (09:28 -0700)]
[flang] Handle multiple USE statements for the same module
It's possible to have several USE statements for the same module that
have different mixes of rename clauses and ONLY clauses. The presence
of a rename cause has the effect of hiding a previously associated name,
and the presence of an ONLY clause forces the name to be visible even in
the presence of a rename.
I fixed this by keeping track of the names that appear on rename and ONLY
clauses. Then, when processing the USE association of a name, I check to see
if it previously appeared in a rename clause and not in a USE clause. If so, I
remove its USE associated symbol. Also, when USE associating all of the names
in a module, I do not USE associate names that have appeared in rename clauses.
I also added a test.
Differential Revision: https://reviews.llvm.org/D104130
Kevin Athey [Fri, 11 Jun 2021 17:13:10 +0000 (10:13 -0700)]
[clang-cl][sanitizer] Add -fsanitize-address-use-after-return to clang.
Also:
- add driver test (fsanitize-use-after-return.c)
- add basic IR test (asan-use-after-return.cpp)
- (NFC) cleaned up logic for generating table of __asan_stack_malloc
depending on flag.
for issue: https://github.com/google/sanitizers/issues/1394
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D104076
Arthur Eubanks [Tue, 18 May 2021 22:09:06 +0000 (15:09 -0700)]
[NFC][OpaquePtr] Explicitly pass GEP source type in optimizeGatherScatterInst()
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D103480
John Paul Adrian Glaubitz [Fri, 11 Jun 2021 18:44:04 +0000 (19:44 +0100)]
[compiler-rt] Add platform detection support for x32
Currently, the compiler-rt build system checks only whether __X86_64
is defined to determine whether the default compiler-rt target arch
is x86_64. Since x32 defines __X86_64 as well, we must also check that
the default pointer size is eight bytes and not four bytes to properly
detect a 64-bit x86_64 compiler-rt default target arch.
Reviewed By: hvdijk, vitalybuka
Differential Revision: https://reviews.llvm.org/D99988
LLVM GN Syncbot [Fri, 11 Jun 2021 18:04:01 +0000 (18:04 +0000)]
[gn build] Port
7eba4856c702
zoecarver [Thu, 6 May 2021 20:19:13 +0000 (13:19 -0700)]
[libcxx][ranges] Add class ref_view.
Differential Revision: https://reviews.llvm.org/D102020
Matt Arsenault [Thu, 10 Jun 2021 21:39:51 +0000 (17:39 -0400)]
AMDGPU/GlobalISel: Remove leftover hack for argument memory sizes
Since the call lowering code now tries to respect the tablegen
reported argument types, this is no longer necessary.
Matt Arsenault [Thu, 10 Jun 2021 16:00:36 +0000 (12:00 -0400)]
AMDGPU/GlobalISel: Fix indentation
Matt Arsenault [Thu, 10 Jun 2021 01:22:00 +0000 (21:22 -0400)]
GlobalISel: Reduce indentation and remove dead path
Matt Arsenault [Tue, 8 Jun 2021 21:10:51 +0000 (17:10 -0400)]
CodeGen: Fix missing const
eahcmrh [Tue, 8 Jun 2021 17:00:42 +0000 (19:00 +0200)]
[Sema] Address-space sensitive check for unbounded arrays (v2)
Check applied to unbounded (incomplete) arrays and pointers to spot
cases where the computed address is beyond the largest possible
addressable extent of the array, based on the address space in which the
array is delcared, or which the pointer refers to.
Check helps to avoid cases of nonsense pointer math and array indexing
which could lead to linker failures or runtime exceptions. Of
particular interest when building for embedded systems with small
address spaces.
This is version 2 of this patch -- version 1 had some testing issues
due to a sign error in existing code. That error is corrected and
lit test for this chagne is extended to verify the fix.
Originally reviewed/accepted by: aaron.ballman
Original revision: https://reviews.llvm.org/D86796
Reviewed By: aaron.ballman, ebevhan
Differential Revision: https://reviews.llvm.org/D88174
Denys Shabalin [Fri, 11 Jun 2021 15:53:45 +0000 (17:53 +0200)]
Introduce alloca_scope op
## Introduction
This proposal describes the new op to be added to the `std` (and later moved `memref`)
dialect called `alloca_scope`.
## Motivation
Alloca operations are easy to misuse, especially if one relies on it while doing
rewriting/conversion passes. For example let's consider a simple example of two
independent dialects, one defines an op that wants to allocate on-stack and
another defines a construct that corresponds to some form of looping:
```
dialect1.looping_op {
%x = dialect2.stack_allocating_op
}
```
Since the dialects might not know about each other they are going to define a
lowering to std/scf/etc independently:
```
scf.for … {
%x_temp = std.alloca …
… // do some domain-specific work using %x_temp buffer
… // and store the result into %result
%x = %result
}
```
Later on the scf and `std.alloca` is going to be lowered to llvm using a
combination of `llvm.alloca` and unstructured control flow.
At this point the use of `%x_temp` is bound to either be either optimized by
llvm (for example using mem2reg) or in the worst case: perform an independent
stack allocation on each iteration of the loop. While the llvm optimizations are
likely to succeed they are not guaranteed to do so, and they provide
opportunities for surprising issues with unexpected use of stack size.
## Proposal
We propose a new operation that defines a finer-grain allocation scope for the
alloca-allocated memory called `alloca_scope`:
```
alloca_scope {
%x_temp = alloca …
...
}
```
Here the lifetime of `%x_temp` is going to be bound to the narrow annotated
region within `alloca_scope`. Moreover, one can also return values out of the
alloca_scope with an accompanying `alloca_scope.return` op (that behaves
similarly to `scf.yield`):
```
%result = alloca_scope {
%x_temp = alloca …
…
alloca_scope.return %myvalue
}
```
Under the hood the `alloca_scope` is going to lowered to a combination of
`llvm.intr.stacksave` and `llvm.intr.strackrestore` that are going to be invoked
automatically as control-flow enters and leaves the body of the `alloca_scope`.
The key value of the new op is to allow deterministic guaranteed stack use
through an explicit annotation in the code which is finer-grain than the
function-level scope of `AutomaticAllocationScope` interface. `alloca_scope`
can be inserted at arbitrary locations and doesn’t require non-trivial
transformations such as outlining.
## Which dialect
Before memref dialect is split, `alloca_scope` can temporarily reside in `std`
dialect, and later on be moved to `memref` together with the rest of
memory-related operations.
## Implementation
An implementation of the op is available [here](https://reviews.llvm.org/D97768).
Original commits:
* Add initial scaffolding for alloca_scope op
* Add alloca_scope.return op
* Add no region arguments and variadic results
* Add op descriptions
* Add failing test case
* Add another failing test
* Initial implementation of lowering for std.alloca_scope
* Fix backticks
* Fix getSuccessorRegions implementation
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D97768
Jonas Devlieghere [Wed, 10 Feb 2021 03:52:11 +0000 (19:52 -0800)]
[lldb] Support new objective-c hash table layout
Update LLDB for thew new Objective-C hash table layout in the dyld
shared cache found in macOS Monterey.
rdar://
72863911
Jonas Devlieghere [Fri, 11 Jun 2021 17:24:01 +0000 (10:24 -0700)]
[lldb] Enable TestRuntimeTypes on Apple Silicon
Valery N Dmitriev [Fri, 11 Jun 2021 16:35:08 +0000 (09:35 -0700)]
[SLP][NFC] Fix condition that was supposed to save a bit of compile time.
It was found by chance revealing discrepancy between comment (few lines above),
the condition and how re-ordering of instruction is done inside the if statement
it guards. The condition was always evaluated to true.
Differential Revision: https://reviews.llvm.org/D104064
LLVM GN Syncbot [Fri, 11 Jun 2021 16:57:34 +0000 (16:57 +0000)]
[gn build] Port
c54d3050f7b9
Louis Dionne [Thu, 10 Jun 2021 17:38:55 +0000 (13:38 -0400)]
[libc++] NFC: Move indirect_concepts.h to __iterator/concepts.h
There's no fundamental reason to separate those from the other iterator
concepts.
Differential Revision: https://reviews.llvm.org/D104048
Guozhi Wei [Fri, 11 Jun 2021 16:43:52 +0000 (09:43 -0700)]
[X86FixupLEAs] Sub register usage of LEA dest should block LEA/SUB optimization
In function searchALUInst, sub register usage of LEA dest should also block LEA/SUB optimization, otherwise the sub register usage gets an undefined value.
This patch fixes https://bugs.llvm.org/show_bug.cgi?id=50615.
Differential Revision: https://reviews.llvm.org/D103922
Louis Dionne [Tue, 16 Feb 2021 16:24:27 +0000 (11:24 -0500)]
[libc++] Enable the synchronization library on Apple platforms
The synchronization library was marked as disabled on Apple platforms
up to now because we were not 100% sure that it was going to be ABI
stable. However, it's been some time since we shipped it in upstream
libc++ now and there's been no changes so far. This patch enables the
synchronization library on Apple platforms, and hence commits the ABI
stability as far as that vendor is concerned.
Differential Revision: https://reviews.llvm.org/D96790
LLVM GN Syncbot [Fri, 11 Jun 2021 16:34:49 +0000 (16:34 +0000)]
[gn build] Port
9106047ee3dd
zoecarver [Mon, 3 May 2021 21:37:42 +0000 (14:37 -0700)]
[libcxx][ranges] Add range.subrange.
Basically the title.
Differential Revision: https://reviews.llvm.org/D102006
Adam Nemet [Fri, 11 Jun 2021 15:50:07 +0000 (08:50 -0700)]
[Matrix] In transpose opts, handle a^t * a^t
Without the fix the testcase crashes because we remove the same instruction
twice.
Differential Revision: https://reviews.llvm.org/D104127
Aaron En Ye Shi [Thu, 10 Jun 2021 21:24:38 +0000 (21:24 +0000)]
[HIP] Fix --hip-version flag with 0 as component
Allow the usage of minor version 0, for hip versions
such as 4.0. Change the default values when performing
version checks.
Reviewed By: yaxunl
Differential Revision: https://reviews.llvm.org/D104062
Ayush Sahay [Fri, 11 Jun 2021 15:52:15 +0000 (21:22 +0530)]
[lldb-vscode] Synchronize calls to SendTerminatedEvent
If an inferior exits prior to the processing of a disconnect request,
then the threads executing EventThreadFunction and request_discontinue
respectively may call SendTerminatedEvent simultaneously, in turn,
testing and/or setting g_vsc.sent_terminated_event without any
synchronization. In case the thread executing EventThreadFunction sets
it before the thread executing request_discontinue has had a chance to
test it, the latter would move ahead to issue a response to the
disconnect request. Said response may be dispatched ahead of the
terminated event compelling the client to terminate the debug session
without consuming any console output that might've been generated by
the execution of terminateCommands.
Reviewed By: clayborg, wallace
Differential Revision: https://reviews.llvm.org/D103609
Aaron Ballman [Fri, 11 Jun 2021 16:06:21 +0000 (12:06 -0400)]
Update the C status page somewhat.
This adds implementation information for N2607,
clarifies that C17 only resolved defect reports,
and adds -std= information for the different versions.
Tomas Matheson [Tue, 20 Apr 2021 18:03:09 +0000 (19:03 +0100)]
[CodeGen][regalloc] Don't align stack slots if the stack can't be realigned
Register allocation may spill virtual registers to the stack, which can
increase alignment requirements of the stack frame. If the the function
did not require stack realignment before register allocation, the
registers required to do so may not be reserved/available. This results
in a stack frame that requires realignment but can not be realigned.
Instead, only increase the alignment of the stack if we are still able
to realign.
The register SpillAlignment will be ignored if we can't realign, and the
backend will be responsible for emitting the correct unaligned loads and
stores. This seems to be the assumed behaviour already, e.g.
ARMBaseInstrInfo::storeRegToStackSlot and X86InstrInfo::storeRegToStackSlot
are both `canRealignStack` aware.
Differential Revision: https://reviews.llvm.org/D103602
Alexey Bataev [Wed, 9 Jun 2021 19:37:34 +0000 (12:37 -0700)]
[SLP]Allow reordering of insertelements.
After we added support for non-ordered insertelements, we can allow
their reordering.
Differential Revision: https://reviews.llvm.org/D104057
eahcmrh [Fri, 11 Jun 2021 15:44:06 +0000 (17:44 +0200)]
Revert "[Sema] Address-space sensitive check for unbounded arrays (v2)"
This reverts commit
e42a347b74400b7212ceaaea6d39562a0435df42.
eahcmrh [Tue, 8 Jun 2021 17:00:42 +0000 (19:00 +0200)]
[Sema] Address-space sensitive check for unbounded arrays (v2)
Check applied to unbounded (incomplete) arrays and pointers to spot
cases where the computed address is beyond the largest possible
addressable extent of the array, based on the address space in which the
array is delcared, or which the pointer refers to.
Check helps to avoid cases of nonsense pointer math and array indexing
which could lead to linker failures or runtime exceptions. Of
particular interest when building for embedded systems with small
address spaces.
This is version 2 of this patch -- version 1 had some testing issues
due to a sign error in existing code. That error is corrected and
lit test for this chagne is extended to verify the fix.
Originally reviewed/accepted by: aaron.ballman
Original revision: https://reviews.llvm.org/D86796
Reviewed By: aaron.ballman, ebevhan
Differential Revision: https://reviews.llvm.org/D88174
Matt Morehouse [Fri, 11 Jun 2021 15:19:36 +0000 (08:19 -0700)]
[HWASan] Add basic stack tagging support for LAM.
Adds the basic instrumentation needed for stack tagging.
Currently does not support stack short granules or TLS stack histories,
since a different code path is followed for the callback instrumentation
we use.
We may simply wait to support these two features until we switch to
a custom calling convention.
Patch By: xiangzhangllvm, morehouse
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D102901
Nico Weber [Fri, 11 Jun 2021 15:15:11 +0000 (11:15 -0400)]
[lld/mac] Use sectionType() more
Not sure sectionType() carries its weight, but while we have it
we should use it consistently.
No behavior change.
Differential Revision: https://reviews.llvm.org/D104027
Alexey Bataev [Fri, 11 Jun 2021 12:13:31 +0000 (05:13 -0700)]
[SLP]Remove unnecessary UndefValue in CreateShuffle.
No need to use UndefValue in CreateShuffle call.
Differential Revision: https://reviews.llvm.org/D104113
Alexey Bataev [Fri, 11 Jun 2021 15:00:15 +0000 (08:00 -0700)]
[SLP][NFC]Add a test for unordered stores, NFC.
thomasraoux [Fri, 11 Jun 2021 14:39:01 +0000 (07:39 -0700)]
[mlir][VectorToGPU] First step to convert vector ops to GPU MMA ops
This is the first step to convert vector ops to MMA operations in order to
target GPUs tensor core ops. This currently only support simple cases,
transpose and element-wise operation will be added later.
Differential Revision: https://reviews.llvm.org/D102962
Raphael Isemann [Fri, 11 Jun 2021 14:24:58 +0000 (16:24 +0200)]
[lldb] Remove GCC XFAIL for TestTypedefArray
This passes with GCC>8.5 and ToT LLDB.
Raphael Isemann [Fri, 11 Jun 2021 14:20:57 +0000 (16:20 +0200)]
[lldb] Fix compilation after removal of APInt::toString
Raphael Isemann [Fri, 11 Jun 2021 14:06:39 +0000 (16:06 +0200)]
[lldb] Unmark TestInlines as XFAIL for gcc
This works for GCC>8.5 and ToT LLDB.
LLVM GN Syncbot [Fri, 11 Jun 2021 14:01:11 +0000 (14:01 +0000)]
[gn build] Port
9907746f5db7
Sjoerd Meijer [Fri, 11 Jun 2021 13:43:49 +0000 (14:43 +0100)]
Move Function Specialization to its correct location. NFC.
As a follow up of rGc4a0969b9c14, and as part of D104102, move it to
the IPO transformations directory.
Zahira Ammarguellat [Wed, 2 Jun 2021 14:59:07 +0000 (07:59 -0700)]
Referencing a static function defined in an opnemp clause, is
generating an erroneous warning.
See here: https://godbolt.org/z/ajKPc36M7
Zahira Ammarguellat [Fri, 28 May 2021 20:15:26 +0000 (13:15 -0700)]
Fix for error "'Run' overrides a member function but is not marked
'override' [-Werror,-Wsuggest-override]" occuring during windows
debug self-build.
Tobias Gysi [Fri, 11 Jun 2021 13:21:32 +0000 (13:21 +0000)]
[mlir][linalg] Prepare pad to static bounding box for scalar operands.
Adapt pad to static bounding box to support structured ops taking scalar operands.
Differential Revision: https://reviews.llvm.org/D103891
Simon Pilgrim [Fri, 11 Jun 2021 13:50:03 +0000 (14:50 +0100)]
Fix extraneous ')' error.
Sanjay Patel [Fri, 11 Jun 2021 13:33:32 +0000 (09:33 -0400)]
[SimplifyCFG] avoid crash on degenerate loop
The problematic code pattern in the test is based on:
https://llvm.org/PR50638
If the IfCond is itself the phi that we are trying to remove,
then the loop around line 2835 can end up with something like:
%cmp = select i1 %cmp, i1 false, i1 true
That can then lead to a use-after-free and assert (although
I'm still not seeing that locally in my release + asserts build).
I think this can only happen with unreachable code.
Differential Revision: https://reviews.llvm.org/D104063
Simon Pilgrim [Fri, 11 Jun 2021 13:27:04 +0000 (14:27 +0100)]
StringExtrasTest.cpp - add missing newline at the end of file. NFCI.
Simon Pilgrim [Fri, 11 Jun 2021 12:44:30 +0000 (13:44 +0100)]
Fix Wdocumentation missing parameter warnings. NFCI.
Tobias Gysi [Fri, 11 Jun 2021 12:53:21 +0000 (12:53 +0000)]
[mlir][linalg] Prepare drop unit dims for scalar operands.
Adapt drop unit dims for structured ops taking scalar operands.
Differential Revision: https://reviews.llvm.org/D103890
Raphael Isemann [Fri, 11 Jun 2021 12:51:17 +0000 (14:51 +0200)]
Revert "[lldb] Add support for evaluating expressions in static member functions"
This reverts commit
00764c36edf88ae9806e8d57a6addb782e6ceae8 and the
follow up
d2223c7a49973a61cc2de62992662afa8d19065a.
The original patch broke that one could use static member variables while
inside a static member functions without having a running target. It seems that
LLDB currently requires that static variables are only found via the global
variable lookup so that they can get materialized and mapped to the argument
struct of the expression.
After
00764c36edf88ae9806e8d57a6addb782e6ceae8 static variables of the current
class could be found via Clang's lookup which LLDB isn't observing. This
resulting in expressions actually containing these variables as normal
globals that can't be rewritten to a member of the argument struct.
More specifically, in the test TestCPPThis, the expression
`expr --j false -- s_a` is now only passing if we have a runnable target.
I'll revert the patch as the possible fixes aren't trivial and it degrades
the debugging experience more than the issue that the revert patch addressed.
The underlying bug can be reproduced before/after this patch by stopping
in `TestCPPThis` main function and running: `e -j false -- my_a; A<int>::s_a`.
The `my_a` will pull in the `A<int>` class and the second expression will
be resolved by Clang on its own (which causes LLDB to not materialize the
static variable).
Note: A workaround is to just do `::s_a` which will force LLDB to take the global
variable lookup.
Tobias Gysi [Fri, 11 Jun 2021 12:13:27 +0000 (12:13 +0000)]
[mlir][[linalg] Remove deprecated structured op interface methods.
Cleanup the refactoring started by https://reviews.llvm.org/D103394.
Differential Revision: https://reviews.llvm.org/D104025
patacca [Fri, 11 Jun 2021 11:13:07 +0000 (13:13 +0200)]
[Polly][Isl] Removing explicit operator bool() from isl C++ bindings. NFC.
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.
Changes made:
- Removing explicit operator bool() from all the classes in the isl C++ bindings.
- Replace each call to operator bool() to method `is_null()`.
- isl-noexceptions.h has been generated by this https://github.com/patacca/isl/commit/
27396daac5a5ee8228d25511a12f4a814c92ba8f
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D103976
Simon Pilgrim [Fri, 11 Jun 2021 12:39:14 +0000 (13:39 +0100)]
[lldb] DumpDataExtractor.cpp - replace APInt::toString() with llvm::toString(APInt)
APInt::toString() was removed rG61cdaf66fe22be2b5942ddee4f46a998b4f3ee29
Simon Pilgrim [Fri, 11 Jun 2021 12:34:02 +0000 (13:34 +0100)]
APInt.h - add missing <utility> header.
Some buildbots are complaining about std::move() after rG61cdaf66fe22be2b5942ddee4f46a998b4f3ee29
Sam McCall [Thu, 10 Jun 2021 22:16:14 +0000 (00:16 +0200)]
[AST] Include the TranslationUnitDecl when traversing with TraversalScope
Given `int foo, bar;`, TraverseAST reveals this tree:
TranslationUnitDecl
- foo
- bar
Before this patch, with the TraversalScope set to {foo}, TraverseAST yields:
foo
After this patch it yields:
TranslationUnitDecl
- foo
Also, TraverseDecl(TranslationUnitDecl) now respects the traversal scope.
---
The main effect of this today is that clang-tidy checks that match the
translationUnitDecl(), either in order to traverse it or check
parentage, should work.
Differential Revision: https://reviews.llvm.org/D104071
Simon Pilgrim [Fri, 11 Jun 2021 12:19:00 +0000 (13:19 +0100)]
[ADT] Remove APInt/APSInt toString() std::string variants
<string> is currently the highest impact header in a clang+llvm build:
https://commondatastorage.googleapis.com/chromium-browser-clang/llvm-include-analysis.html
One of the most common places this is being included is the APInt.h header, which needs it for an old toString() implementation that returns std::string - an inefficient method compared to the SmallString versions that it actually wraps.
This patch replaces these APInt/APSInt methods with a pair of llvm::toString() helpers inside StringExtras.h, adjusts users accordingly and removes the <string> from APInt.h - I was hoping that more of these users could be converted to use the SmallString methods, but it appears that most end up creating a std::string anyhow. I avoided trying to use the raw_ostream << operators as well as I didn't want to lose having the integer radix explicit in the code.
Differential Revision: https://reviews.llvm.org/D103888
Fraser Cormack [Fri, 11 Jun 2021 11:38:01 +0000 (12:38 +0100)]
[VP][NFC] Format comment to 80 columns
Haojian Wu [Fri, 11 Jun 2021 11:07:14 +0000 (13:07 +0200)]
[clangd] don't rename if the triggering loc is not actually being renamed.
See context: https://github.com/clangd/clangd/issues/765
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D101816
Max Kazantsev [Fri, 11 Jun 2021 11:40:44 +0000 (18:40 +0700)]
[Test] One more elaborate test with selects for loop deletion
Jingu Kang [Fri, 11 Jun 2021 11:31:25 +0000 (12:31 +0100)]
precommit tests for D104042
Alex Zinenko [Thu, 10 Jun 2021 17:00:34 +0000 (19:00 +0200)]
[mlir] Provide minimal Python bindings for the math dialect
Reviewed By: ulysseB
Differential Revision: https://reviews.llvm.org/D104045
Zarko Todorovski [Thu, 10 Jun 2021 20:49:51 +0000 (16:49 -0400)]
[PowerPC] Allow wa inline asm to also accept floating point arguments
GCC documentation for the `wa` constraint states that:
```
wa
A VSX register (VSR), vs0…vs63. This is either an FPR (vs0…vs31 are f0…f31)
or a VR (vs32…vs63 are v0…v31).
```
This technically means that we could accept floating point parameters. In fact,
gcc itself does. The following testcase compiles and runs on all PPC platforms with GCC,
whereas clang/llc will assert:
```
#include <stdio.h>
double foo ( vector double a ) {
double b, c;
asm("xvabsdp %x0, %x2 \n"
"xxsldwi %x1, %x0, %x0, 2 \n"
: "+wa" (b),
"=wa" (c)
: "wa" (a)
);
return b+c;
}
int main(void) {
vector double a = {-3., -4.};
double t = foo( a );
printf("%g\n", t);
}
```
This patch allows clang/llc to build and run this testcase.
Reviewed By: nemanjai, #powerpc
Differential Revision: https://reviews.llvm.org/D103409
Max Kazantsev [Fri, 11 Jun 2021 10:42:33 +0000 (17:42 +0700)]
[Test] Add loop deletion test with switch
Haojian Wu [Thu, 10 Jun 2021 15:12:12 +0000 (17:12 +0200)]
[clang-tidy] NarrowingConversionsCheck should support inhibiting conversions of
mixed integer and floating point types with WarnOnEquivalentBitWidth=0.
Also standardize control flow of handleX conversion functions to make it easier to be consistent.
Patch by Stephen Concannon!
Differential Revision: https://reviews.llvm.org/D103894
Simon Pilgrim [Fri, 11 Jun 2021 11:00:21 +0000 (12:00 +0100)]
[ADT] Consistently use StringExtrasTest for the test suite filter. NFCI.
Noticed while updating D103888 - some of the tests were using "StringExtras" for the test_suite_name instead of the expected "StringExtrasTest"
Nathan Sidwell [Thu, 10 Jun 2021 15:07:47 +0000 (08:07 -0700)]
[clang][NFC] Avoid assignment in condition
Refactor to avoid assignment inside condition by using 'if
(init-decl)'. Also remove some unnecessary braces on a separate
if-nest.
Differential Revision: https://reviews.llvm.org/D104039
Koutheir Attouchi [Fri, 11 Jun 2021 10:37:16 +0000 (11:37 +0100)]
Do not generate calls to the 128-bit function __multi3() on 32-bit ARM
Re-applying this patch after bots failures. Should be fine now.
The function __multi3() is undefined on 32-bit ARM, so a call to it should
never be emitted. Instead, plain instructions need to be generated to
perform 128-bit multiplications.
Differential Revision: https://reviews.llvm.org/D103906
Rosie Sumpter [Wed, 9 Jun 2021 09:00:16 +0000 (10:00 +0100)]
[CostModel][AArch64] Improve the cost estimate of CTPOP intrinsic
Added a case for CTPOP to AArch64TTIImpl::getIntrinsicInstrCost so that
the cost estimate matches the codegen in
test/CodeGen/AArch64/arm64-vpopcnt.ll
Differential Revision: https://reviews.llvm.org/D103952
Ole Strohm [Fri, 11 Jun 2021 09:42:41 +0000 (10:42 +0100)]
[OpenCL] Fix overloading resolution of addrspace constructors
This fixes the prioritization of address spaces when choosing a
constructor, stopping them from being considered equally good,
which made the construction of types that could be constructed
by more than one of the constructors.
It does this by preferring the most specific address space,
which is decided by seeing if one of the address spaces is
a superset of the other, and preferring the other.
Fixes: PR50329
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D102850
Martin Probst [Fri, 11 Jun 2021 09:43:00 +0000 (11:43 +0200)]
clang-format: [JS] don't sort named imports if off.
The previous implementation would accidentally still sort the individual
named imports, even if the module reference was in a clang-format off
block.
Differential Revision: https://reviews.llvm.org/D104101
Simon Pilgrim [Fri, 11 Jun 2021 09:56:05 +0000 (10:56 +0100)]
[llvm-stress] Fix dead code preventing us generating per-element vector selects
This has been reported several times by the PVS Studio team as well as coming up in some static analysis.
getRandom() % 1 always returns 0 so we never actually test this codepath, (git blame suggests this has always been like this) - given that we have plenty of other "getRandom() & 1" the typo is pretty obvious, and matches the intention in the comment above - with this change we generate a nice mixture of scalar/vector condition selects of vectors.
I don't know llvm-stress that well - but I don't think we guarantee that the same seed value will always generate the same IR for later versions of the program - just that the same binary would.
Differential Revision: https://reviews.llvm.org/D104022
Valeriy Savchenko [Thu, 3 Jun 2021 17:39:25 +0000 (20:39 +0300)]
[analyzer] Refactor trackExpressionValue to accept TrackingOptions
Differential Revision: https://reviews.llvm.org/D103633
Valeriy Savchenko [Thu, 3 Jun 2021 16:51:19 +0000 (19:51 +0300)]
[analyzer] Turn TrackControlDependencyCond into a tracking visitor
Differential Revision: https://reviews.llvm.org/D103631
Valeriy Savchenko [Thu, 3 Jun 2021 16:32:04 +0000 (19:32 +0300)]
[analyzer] Refactor trackRValueExpression into ExpressionHandler
Differential Revision: https://reviews.llvm.org/D103630
Valeriy Savchenko [Thu, 3 Jun 2021 16:09:43 +0000 (19:09 +0300)]
[analyzer] Turn ReturnVisitor into a tracking visitor
Whenever Tracker spawns a visitor that needs to call tracker
back, we have to use TrackingBugReporterVisitor in order to maintain
all the hooks that the checker might've used.
Differential Revision: https://reviews.llvm.org/D103628