Kirill Shmakov [Fri, 20 Aug 2021 12:27:37 +0000 (15:27 +0300)]
[lldb] Fix typo in the description of breakpoint options
LLVM GN Syncbot [Sat, 21 Aug 2021 09:44:22 +0000 (09:44 +0000)]
[gn build] Port
7f99337f9bcf
Lang Hames [Fri, 20 Aug 2021 05:52:42 +0000 (15:52 +1000)]
[ORC] Add EPCGenericMemoryAccess: generic executor memory access via EPC calls.
All ExecutorProcessControl subclasses must provide an
ExecutorProcessControl::MemoryAccess object that can be used to access executor
memory from the JIT process. The EPCGenericMemoryAccess class provides an
off-the-shelf MemoryAccess implementation for JITs that do not need (or cannot
provide) a specialized MemoryAccess implementation. This simplifies the process
of creating new ExecutorProcessControl implementations.
eopXD [Thu, 19 Aug 2021 06:15:38 +0000 (23:15 -0700)]
[NFC][LoopIdiom] Let processLoopStoreOfLoopLoad take StoreSize as SCEV instead of unsigned
Letting it take SCEV allows further modification on the function to optimize
if the StoreSize / Stride is runtime determined.
The plan is to let memcpy / memmove deal with runtime-determined sizes, just
like what D107353 did to memset.
Reviewed By: bmahjour
Differential Revision: https://reviews.llvm.org/D108289
Siva Chandra Reddy [Mon, 21 Jun 2021 06:05:29 +0000 (06:05 +0000)]
[libc] Add a new suite called "libc-long-running-tests".
This suite is helpful is adding long running tests which take a long
time to finish that they can be run on the public builders. They
will probably be run on special builders in future.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D104816
Kazu Hirata [Sat, 21 Aug 2021 02:19:54 +0000 (19:19 -0700)]
[CodeGen] Remove unused declaration setLiveInsUsed (NFC)
The corresponding definition was removed on Jan 20, 2017 in commit
710a4c1f3ddba3aa9313c72c43f9619afbc3e259.
Joseph Huber [Fri, 20 Aug 2021 20:43:31 +0000 (16:43 -0400)]
[OpenMP] Correctly add member expressions to OpenMP info
Mapping expressions that have `this` as their base expression aren't
considered a valid base variable and the rest of the runtime expects
this. However, if we have an expression with no value declaration we can
try to extract it manually to provide more helpful debuggin information.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D108483
Amara Emerson [Sat, 21 Aug 2021 00:04:36 +0000 (17:04 -0700)]
[AArch64][GlobalISel] Add legalizer support for the @llvm.get.dynamic.area.offset intrinsic.
This is just 0 on AArch64.
Geoffrey Martin-Noble [Fri, 20 Aug 2021 23:53:46 +0000 (16:53 -0700)]
[Bazel] Fix version defines
Some of these were the wrong version and some of them were the wrong
format. Did some hunting around to figure out what exactly they're
supposed to be. Since basically everything is derived from the LLVM
version we should probably make this a bit less hardcoded, but just
fixing the values for now.
Sources:
https://github.com/llvm/llvm-project/blob/
b686fc7a1bea/clang/include/clang/Basic/Version.inc.in
https://github.com/llvm/llvm-project/blob/
b686fc7a1bea/clang/CMakeLists.txt#L353-L363
https://github.com/llvm/llvm-project/blob/
b686fc7a1bea/llvm/CMakeLists.txt#L13-L29
https://github.com/llvm/llvm-project/blob/
b686fc7a1bea/lld/CMakeLists.txt#L131-L138
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D108500
Fangrui Song [Fri, 20 Aug 2021 23:36:42 +0000 (16:36 -0700)]
[Driver] Remove discouraged -gcc-toolchain
Space separated driver options are uncommon but Clang traditionally
did not do a good job. --gcc-toolchain= is the preferred form.
This discourage form appears to be rare, so we can just drop it.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D108494
Amara Emerson [Fri, 20 Aug 2021 23:23:23 +0000 (16:23 -0700)]
[AArch64][GlobalISel] Don't contract cross-bank copies into truncating stores.
Truncating stores with GPR bank sources shouldn't be mutated into using FPR bank
sources, since those aren't supported.
Ideally this should be a selection failure in the tablegen patterns, but for now
avoid generating them.
Geoffrey Martin-Noble [Fri, 20 Aug 2021 22:58:49 +0000 (15:58 -0700)]
[Bazel] Reduce quote escaping
There's a lot of unnecessary backslashes here that we can avoid to
reduce confusion.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D108495
William S. Moses [Thu, 19 Aug 2021 23:45:58 +0000 (19:45 -0400)]
[MLIR][OMP] Ensure nested scf.parallel execute all iterations
Presently, the lowering of nested scf.parallel loops to OpenMP creates one omp.parallel region, with two (nested) OpenMP worksharing loops on the inside. When lowered to LLVM and executed, this results in incorrect results. The reason for this is as follows:
An OpenMP parallel region results in the code being run with whatever number of threads available to OpenMP. Within a parallel region a worksharing loop divides up the total number of requested iterations by the available number of threads, and distributes accordingly. For a single ws loop in a parallel region, this works as intended.
Now consider nested ws loops as follows:
omp.parallel {
A: omp.ws %i = 0...10 {
B: omp.ws %j = 0...10 {
code(%i, %j)
}
}
}
Suppose we ran this on two threads. The first workshare loop would decide to execute iterations 0, 1, 2, 3, 4 on thread 0, and iterations 5, 6, 7, 8, 9 on thread 1. The second workshare loop would decide the same for its iteration. This means thread 0 would execute i \in [0, 5) and j \in [0, 5). Thread 1 would execute i \in [5, 10) and j \in [5, 10). This means that iterations i in [5, 10), j in [0, 5) and i in [0, 5), j in [5, 10) never get executed, which is clearly wrong.
This permits two options for a remedy:
1) Change the semantics of the omp.wsloop to be distinct from that of the OpenMP runtime call or equivalently #pragma omp for. This could then allow some lowering transformation to remedy the aforementioned issue. I don't think this is desirable for an abstraction standpoint.
2) When lowering an scf.parallel always surround the wsloop with a new parallel region (thereby causing the innermost wsloop to use the number of threads available only to it).
This PR implements the latter change.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D108426
Fangrui Song [Fri, 20 Aug 2021 22:24:58 +0000 (15:24 -0700)]
[test] Migrate -gcc-toolchain with space separator to --gcc-toolchain=
Space separated driver options are uncommon but Clang traditionally
did not do a good job. --gcc-toolchain= is the preferred form.
Jessica Paquette [Wed, 18 Aug 2021 23:48:04 +0000 (16:48 -0700)]
[AArch64][GlobalISel] Legalize non-register-sized scalar G_BITREVERSE
Clamp types to [s32, s64] and make them a power of 2.
This matches SDAG's behaviour.
https://godbolt.org/z/vTeGqf4vT
Differential Revision: https://reviews.llvm.org/D108344
Jessica Paquette [Tue, 17 Aug 2021 20:58:58 +0000 (13:58 -0700)]
[AArch64][GlobalISel] Legalize 32-bit + narrow G_SMULO + G_UMULO
SDAG lowers 32-bit and 64-bit G_SMULO + G_UMULO. We were missing the 32-bit
case.
For other sizes, make the 0th type a power of 2 and clamp it to either 32 bits
or 64 bits.
Right now, this will allow us to handle narrow types (e.g. s4, s24, etc.). The
LegalizerHelper doesn't support narrowing G_SMULO or G_UMULO right now. I think
we want clamping behaviour either way, so we might as well include it now to
be explicit.
Differential Revision: https://reviews.llvm.org/D108240
Jessica Paquette [Fri, 20 Aug 2021 21:00:17 +0000 (14:00 -0700)]
[AArch64][GlobalISel] Clamp vectors of p0 when legalizing G_LOAD/G_STORE
We had a rule for <n x s64> but not one for <n x p0>. As a result, we'd fall
back on like <5 x p0> or whatever.
Differential Revision: https://reviews.llvm.org/D108484
Jessica Paquette [Thu, 19 Aug 2021 22:53:39 +0000 (15:53 -0700)]
[AArch64][GlobalISel] Add regbankselect support for G_LROUND
Destination is always a GPR, since the result is always an integer.
Source is always a FPR, since the source is always floating point.
Differential Revision: https://reviews.llvm.org/D108419
Fangrui Song [Fri, 20 Aug 2021 21:26:27 +0000 (14:26 -0700)]
[libunwind] Add UNW_AARCH64_* beside UNW_ARM64_*
The original libunwind project defines UNW_AARCH64_* instead of UNW_ARM64_*.
Rename the enum members to match. This allows some applications with simple
`unw_init_local` usage to migrate to llvm-project libunwind.
Note: the canonical names of `UNW_ARM_D{0..31}` are now `UNW_AARCH64_V{0..31}`,
to match the original libunwind.
UNW_ARM64_* are kept for now for compatibility. Some may be unneeded and can be
cleaned up in the future.
Reviewed By: #libunwind, compnerd
Differential Revision: https://reviews.llvm.org/D107996
Jessica Paquette [Thu, 19 Aug 2021 23:06:15 +0000 (16:06 -0700)]
[AArch64][GlobalISel] Mark G_LROUND as legal for s64 dst + s32/s64 src.
Matches SDAG's behaviour for these types.
Differential Revision: https://reviews.llvm.org/D108420
Arthur Eubanks [Fri, 20 Aug 2021 21:18:30 +0000 (14:18 -0700)]
[NFC] addAttribute(FunctionIndex) => addFnAttribute()
Jessica Paquette [Fri, 20 Aug 2021 00:39:30 +0000 (17:39 -0700)]
[GlobalISel] Add G_LLROUND
Basically the same as G_LROUND. Handles the llvm.llround family of intrinsics.
Also add a helper function to the MachineVerifier for checking if all of the
(virtual register) operands of an instruction are scalars. Seems like a useful
thing to have.
Differential Revision: https://reviews.llvm.org/D108429
Nikita Popov [Thu, 19 Aug 2021 18:56:09 +0000 (20:56 +0200)]
[LoopPassManager] Assert that MemorySSA is preserved if used
Currently it's possible to silently use a loop pass that does not
preserve MemorySSA in a loop-mssa pass manager, as we don't
statically know which loop passes preserve MemorySSA (as was the
case with the legacy pass manager).
However, we can at least add a check after the fact that if
MemorySSA is used, then it should also have been preserved.
Hopefully this will reduce confusion as seen in
https://bugs.llvm.org/show_bug.cgi?id=51020.
Differential Revision: https://reviews.llvm.org/D108399
Mircea Trofin [Fri, 20 Aug 2021 19:50:20 +0000 (12:50 -0700)]
[NFC][MLGO] Use std::move when moving protobufs
Because of an odd linking problem, we need to temporarily support
building with TF C API 1.15 + tensorflow 2.50 pip package in
'development' mode scenarios. Protobuf Message 'Swap' is partially
implemented in the header (2.50) and relies on a symbol not found in TF
C API 1.15. std::move avoids that, at no semantic cost.
Florian Hahn [Fri, 20 Aug 2021 20:22:59 +0000 (21:22 +0100)]
Revert "[LoopVectorize][AArch64] Enable ordered reductions by default for AArch64"
This reverts commit
f4122398e7c195147cde120d070f9b72905d7c91 to
investigate a crash exposed by it.
The patch breaks building the code below with `clang -O2 --target=aarch64-linux`
int a;
double b, c;
void d() {
for (; a; a++) {
b += c;
c = a;
}
}
Yonghong Song [Fri, 20 Aug 2021 19:52:51 +0000 (12:52 -0700)]
[DebugInfo] convert btf_tag attrs to DI annotations for record fields
Generate btf_tag annotations for record fields. The annotations
are represented as an DINodeArray in DebugInfo.
Differential Revision: https://reviews.llvm.org/D106616
Rob Suderman [Thu, 12 Aug 2021 23:20:56 +0000 (16:20 -0700)]
[mlir][linalg] Finish refactor of TC ops to YAML
Multiple operations were still defined as TC ops that had equivalent versions
as YAML operations. Reducing to a single compilation path guarantees that
frontends can lower to their equivalent operations without missing the
optimized fastpath.
Some operations are maintained purely for testing purposes (mainly conv{1,2,3}D
as they are included as sole tests in the vectorizaiton transforms.
Differential Revision: https://reviews.llvm.org/D108169
Daniel Paoliello [Fri, 20 Aug 2021 18:38:50 +0000 (21:38 +0300)]
Fix SEH table addresses for Windows
Issue Details:
The addresses for SEH tables for Windows are incorrect as 1 was unconditionally being added to all addresses. +1 is required for the SEH end address (as it is exclusive), but the SEH start addresses is inclusive and so should be used as-is.
In the IP2State tables, the addresses are +1 for AMD64 to handle the return address for a call being after the actual call instruction but are as-is for ARM and ARM64 as the `StateFromIp` function in the VC runtime automatically takes this into account and adjusts the address that is it looking up.
Fix Details:
* Split the `getLabel` function into two: `getLabel` (used for the SEH start address and ARM+ARM64 IP2State addresses) and `getLabelPlusOne` (for the SEH end address, and AMD64 IP2State addresses).
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D107784
Craig Topper [Fri, 20 Aug 2021 19:08:42 +0000 (12:08 -0700)]
[TypePromotion] Remove unused IRBuilder object. NFC
Yonghong Song [Mon, 19 Jul 2021 07:12:15 +0000 (00:12 -0700)]
[DebugInfo] generate btf_tag annotations for DIDerived types
Generate btf_tag annotations for DIDrived types. More specifically,
clang frontend generates the btf_tag annotations for record
fields. The annotations are represented as an DINodeArray
in DebugInfo. The following example illustrate how
annotations are encoded in IR:
distinct !DIDerivedType(tag: DW_TAG_member, ..., annotations: !10)
!10 = !{!11, !12}
!11 = !{!"btf_tag", !"a"}
!12 = !{!"btf_tag", !"b"}
Differential Revision: https://reviews.llvm.org/D106616
Louis Dionne [Fri, 20 Aug 2021 15:42:38 +0000 (11:42 -0400)]
[libc++] Remove test-suite annotations for unsupported Clang versions
Differential Revision: https://reviews.llvm.org/D108471
Joe Loser [Fri, 20 Aug 2021 19:02:03 +0000 (15:02 -0400)]
[libc++] Include <__iterator/distance.h> instead of <iterator> in a few algorithm headers
A few headers in algorithm include `<iterator>` when
`<__iterator/distance.h>` would suffice. Change them
to just include `<__iterator.distance.h>`.
Differential Revision: https://reviews.llvm.org/D108393
Christian Fetzer [Fri, 20 Aug 2021 18:24:44 +0000 (13:24 -0500)]
[Coverage][llvm-cov] Correctly export branch coverage in LCOV format
Commit
9f2967bcfe2f7d1fc02281f0098306c90c2c10a5 introduced support for
branch coverage including export to the LCOV format.
This commit corrects the LCOV field name for branches from BFH to BRH.
The mistake seems to have slipped in as typo because the correct field
name BRH is used in the comment section at the beginning of the file.
Differential Revision: https://reviews.llvm.org/D108358
Aditya Kumar [Fri, 20 Aug 2021 02:03:41 +0000 (19:03 -0700)]
PR46874: Reset stack after visiting a node
When the stack is not reset it keeps previously visited Basic Block
which results in bugs where an instruction is hoisted to a
predecessor where the instruction was not fully anticipable.
Differential Revision: https://reviews.llvm.org/D108425
Aart Bik [Fri, 20 Aug 2021 16:41:28 +0000 (09:41 -0700)]
[mlir][sparse] add test for DimOp folding
Folding in the MLIR uses the order of the type directly
but folding in the underlying implementation must take
the dim ordering into account. These tests clarify that
behavior and verify it is done right.
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D108474
Muiez Ahmed [Fri, 20 Aug 2021 18:03:03 +0000 (14:03 -0400)]
[SystemZ][z/OS] Avoid assumption for character value in futures tests
The aim of this patch is to remove the assumption that the character 'a' is always 97. In turn, this patch explicitly uses the character values to account for the EBCDIC 'a' that is not 97.
Differential Revision: https://reviews.llvm.org/D108321
Michael Jones [Thu, 19 Aug 2021 21:07:46 +0000 (21:07 +0000)]
[libc] make the scudo integration test run
adds a custom command for libc-scudo-integration-test that makes it run
when it is built.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D108409
Arthur Eubanks [Fri, 20 Aug 2021 17:28:32 +0000 (10:28 -0700)]
[NFC] Cleanup/remove some AttributeList setter methods
Arthur Eubanks [Fri, 20 Aug 2021 17:23:27 +0000 (10:23 -0700)]
[NFC] Remove unused CallBase::addDereferenceableOrNullAttr()
Patrick Holland [Fri, 20 Aug 2021 03:04:03 +0000 (20:04 -0700)]
[MCA] Fixing bug that was causing LSUnit not to realize an instruction finished executing when the instruction has 0 latency.
Differential Revision: https://reviews.llvm.org/D108443
Ivan Zhechev [Fri, 20 Aug 2021 17:14:59 +0000 (18:14 +0100)]
Make test_symbols.py compare files line-by-line
We currently feed full files to Python's unified_diff.
It's not quite what we want though -
line-by-line comparison makes more sense
(we want to be able to identify missing/unnecessary lines)
and is also easier to parse for humans.
This patch makes sure that we compare one line at a time.
This change pretties up the output formatting in the script.
Output before:
```
!DEF:/m/s/xINTENT(IN)(Implicit)ObjectEntityREAL(4)
!DEF:/m/s/yINTENT(INOUT)(Implicit)ObjectEntityREAL(4)
-!-D-E-F-:-f-o-o-b-a-r-
puresubroutines(x,y)bind(c)
!REF:/m/s/x
intent(in)::x
```
Proposed output after:
```
!DEF:/m/s/xINTENT(IN)(Implicit)ObjectEntityREAL(4)
!DEF:/m/s/yINTENT(INOUT)(Implicit)ObjectEntityREAL(4)
-!DEF:foobar
puresubroutines(x,y)bind(c)
!REF:/m/s/x
intent(in)::x
```
Reviewed By: Meinersbur, awarzynski
Differential Revision: https://reviews.llvm.org/D107954
Louis Dionne [Fri, 20 Aug 2021 15:39:46 +0000 (11:39 -0400)]
[libc++] Remove more test-suite workarounds for unsupported GCC versions
Differential Revision: https://reviews.llvm.org/D108466
Albion Fung [Fri, 20 Aug 2021 17:23:32 +0000 (13:23 -0400)]
[libc++][PowerPC] Fix a test case failure when compiled with libcxx
The test case is not ran unless libcxx is used, and a macro
may be undefined. This patch checks for the definition of the
macro before using it.
Fixes http://llvm.org/PR51430
Differential Revision: https://reviews.llvm.org/D108352
Jon Chesterfield [Fri, 20 Aug 2021 17:17:27 +0000 (18:17 +0100)]
Revert "[openmp][nfc] Refactor GridValues"
Failed a nvptx codegen test
This reverts commit
2a47a84b40115b01e03e4d89c1d47ba74beb7bf3.
Shoaib Meenai [Fri, 20 Aug 2021 16:20:28 +0000 (09:20 -0700)]
[cmake] Fix native tooling when cross-compiling on Linux
At least as of CMake 3.20.3, the CMake platform file for Linux doesn't
define the file type prefix and suffix variables, relying on them being
implicitly empty when they're unset. If we're cross-compiling targeting
Windows on a Linux machine, the values of these prefixes and suffixes
populated by the Windows platform file will still be set after including
the Linux platform file, so we'll incorrectly assume the ".exe" suffix
for the host machine. Explicitly unset the variables before including
the platform file, to prevent any previous values from leaking. Thanks
@beanz for suggesting the fix.
Reviewed By: beanz
Differential Revision: https://reviews.llvm.org/D108473
Arthur Eubanks [Thu, 19 Aug 2021 21:41:25 +0000 (14:41 -0700)]
[NFC] Simplify some CallBase attribute methods
Arthur Eubanks [Thu, 19 Aug 2021 21:38:06 +0000 (14:38 -0700)]
[NFC] Remove some unused functions
Andrea Di Biagio [Wed, 18 Aug 2021 19:35:57 +0000 (20:35 +0100)]
[X86][SchedModels] Fix missing ReadAdvance for MULX and ADCX/ADOX (PR51494)
Before this patch, instructions MULX32rm and MULX64rm were missing a ReadAdvance
for the implicit read of register EDX/RDX. This patch fixes the issue, and it
also introduces a new SchedWrite for the two variants of MULX. The general idea
behind this last change is to eventually decrease the number of InstRW in the
scheduling models.
This patch also adds a ReadAdvance for the implicit read of EFLAGS in ADCX/ADOX.
Differential Revision: https://reviews.llvm.org/D108372
Craig Topper [Fri, 20 Aug 2021 16:34:03 +0000 (09:34 -0700)]
[X86] Add missing __inline__ to functions in amxintrin.h
Sanjay Patel [Fri, 20 Aug 2021 16:20:04 +0000 (12:20 -0400)]
[AggressiveInstCombine] guard against applying instruction flags with constant folding
This is a minimized version of a crash reported in:
D108201
Thomas Lively [Fri, 20 Aug 2021 16:21:31 +0000 (09:21 -0700)]
[WebAssembly] Restore builtins and intrinsics for pmin/pmax
Partially reverts
85157c007903, which had removed these builtins and intrinsics
in favor of normal codegen patterns. It turns out that it is possible for the
patterns to be split over multiple basic blocks, however, which means that DAG
ISel is not able to select them to the pmin/pmax instructions. To make sure the
SIMD intrinsics generate the correct instructions in these cases, reintroduce
the clang builtins and corresponding LLVM intrinsics, but also keep the normal
pattern matching as well.
Differential Revision: https://reviews.llvm.org/D108387
Aart Bik [Thu, 19 Aug 2021 22:50:24 +0000 (15:50 -0700)]
[mlir][sparse][python] migrate more code from boilerplate into proper numpy land
The boilerplate was setting up some arrays for testing. To fully illustrate
python - MLIR potential, however, this data should also come from numpy land.
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D108336
Louis Dionne [Fri, 20 Aug 2021 16:09:41 +0000 (12:09 -0400)]
[libc++][NFC] Fix minor errors and inconsistencies in the test suite
Thomas Lively [Fri, 20 Aug 2021 16:10:36 +0000 (09:10 -0700)]
[WebAssembly] Make shift values unsigned in wasm_simd128.h
On some platforms, negative shift values mean to shift in the opposite
direction, but this is not true with WebAssembly. To avoid confusion, make the
shift values in the shift intrinsics unsigned.
Differential Revision: https://reviews.llvm.org/D108415
Aaron Ballman [Fri, 20 Aug 2021 16:04:09 +0000 (12:04 -0400)]
Replace an unnecessary null check with an assert; NFC
Thomas Lively [Fri, 20 Aug 2021 15:56:51 +0000 (08:56 -0700)]
[WebAssembly] Add SIMD intrinsics using unsigned integers
For each SIMD intrinsic function that takes or returns a scalar signed integer
value, ensure there is a corresponding intrinsic that returns or an
unsigned value. This is a convenience for users who use -Wsign-conversion so
they don't have to insert explicit casts, especially when the intrinsic
arguments are integer literals that fit into the unsigned integer type but not
the signed type.
Differential Revision: https://reviews.llvm.org/D108412
Jon Chesterfield [Fri, 20 Aug 2021 15:41:25 +0000 (16:41 +0100)]
[openmp][nfc] Refactor GridValues
Remove redundant fields and replace pointer with virtual function
Of fourteen fields, three are dead and four can be computed from the
remainder. This leaves a couple of currently dead fields in place as
they are expected to be used from the deviceRTL shortly. Two of the
fields that can be computed are only used from codegen and require a
log2() implementation so are inlined into codegen instead.
This change leaves the new methods in the same location in the struct
as the previous fields for convenience at review.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D108380
Corentin Jabot [Fri, 20 Aug 2021 15:10:53 +0000 (11:10 -0400)]
Make wide multi-character character literals ill-formed
This implements P2362, which has not yet been approved by the
C++ committee, but because wide-multi character literals are
implementation defined, clang might not have to wait for WG21.
This change is also being applied in C mode as the behavior is
implementation-defined in C as well and there's no benefit to
having different rules between the languages.
The other part of P2362, making non-representable character
literals ill-formed, is already implemented by clang
Aaron Ballman [Fri, 20 Aug 2021 15:08:58 +0000 (11:08 -0400)]
Use DeclContext::getNonTransparentContext(); NFC
Ben Shi [Tue, 17 Aug 2021 08:40:16 +0000 (16:40 +0800)]
[RISCV] Optimize add in the zba extension with SH*ADD
Optimize (add x, c) to (SH*ADD (c>>b), x) if c is not simm12
while (c>>b) is simm12 and c has b trailing zeros.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D108193
Louis Dionne [Fri, 20 Aug 2021 14:17:21 +0000 (10:17 -0400)]
[libc++] Fix XFAIL annotation
The triple can sometimes be arm64-apple-macos, where the previous XFAIL
annotation wouldn't match (and hence the test would fail unexpectedly).
Kirill Stoimenov [Thu, 19 Aug 2021 18:11:10 +0000 (18:11 +0000)]
[asan] Implemented getAddressSanitizerParams used by the ASan callback optimization code.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D108397
Jacques Pienaar [Fri, 20 Aug 2021 14:01:54 +0000 (07:01 -0700)]
[mlir][ods] Skip adding TOC in doc gen when present
Enables adding a TOC in the description to be able to interleave
documentation before and after the TOC.
Alexander Potapenko [Fri, 20 Aug 2021 13:50:47 +0000 (15:50 +0200)]
[msan] Hotfix clang/test/CodeGen/sanitize-memory-disable.c
Because KMSAN is not supported on many architectures, explicitly build
the test with -target x86_64-linux-gnu.
Fixes the 'unsupported architecture' and 'unsupported operating system'
errors reported by the clang-armv7-quick (https://lab.llvm.org/buildbot#builders/171/builds/2595)
and llvm-clang-x86_64-sie-ubuntu-fast (https://lab.llvm.org/buildbot#builders/139/builds/9079)
builders.
Differential Revision: https://reviews.llvm.org/D108465
Sanjay Patel [Fri, 20 Aug 2021 13:27:26 +0000 (09:27 -0400)]
[CVP] add tests for unreachable switch default; NFC
Goes with the proposal at D106056.
Jeremy Morse [Fri, 20 Aug 2021 13:48:45 +0000 (14:48 +0100)]
[DebugInfo][InstrRef] Correctly ignore DBG_VALUE_LIST in InstrRef mode
This patch makes InstrRefBasedLDV "safe" to work with DBG_VALUE_LISTs. It
doesn't actually interpret them, but it recognises that they specify
variable locations and avoids propagating false locations, which is better
than the current state. Observe the attached tes
* We avoid propagating DBG_VALUE_LISTs into successor blocks, as they're
not "currently" supported,
* We don't propagate other variable locations across DBG_VALUE_LISTs,
because we know that the variable location is terminated by the
DBG_VALUE_LIST.
Differential Revision: https://reviews.llvm.org/D108143
Aaron Ballman [Fri, 20 Aug 2021 13:49:07 +0000 (09:49 -0400)]
Fix assertion when generating diagnostic for inline namespaces
When calculating the name to display for inline namespaces, we have
custom logic to try to hide redundant inline namespaces from the
diagnostic. Calculating these redundancies requires performing a lookup
in the parent declaration context, but that lookup should not try to
look through transparent declaration contexts, like linkage
specifications. Instead, loop up the declaration context chain until we
find a non-transparent context and use that instead.
This fixes PR49954.
Simon Pilgrim [Fri, 20 Aug 2021 13:30:48 +0000 (14:30 +0100)]
[CostModel][X86] Add costs for f32/f64 scalar and vector types.
The f16 half types are still pretty useless as we don't have it as a legal type (we treat them as i16 most of the time)
Simon Pilgrim [Fri, 20 Aug 2021 12:59:55 +0000 (13:59 +0100)]
MainSwitch::isValidSelectInst - don't dereference dyn_cast<> results.
We've already checked that the pointer isa<PHINode>, so we can use cast<Instruction> safely.
Fixes static analyser warning.
Simon Pilgrim [Fri, 20 Aug 2021 12:49:58 +0000 (13:49 +0100)]
ClangOffloadBundler - getCompatibleOffloadTargets - Fix unknown parameter Wdocumentation warnings. NFC.
Jeremy Morse [Fri, 20 Aug 2021 13:13:37 +0000 (14:13 +0100)]
[DebugInfo][InstrRef] Remove a faulty assertion
This patch removes an assertion, and adds a regression test showing why the
assertion is broken.
For context, LocIdx is a key/index number for machine locations, so that we
can describe locations as a single integer and ignore whether they're on
the stack, in registers or otherwise. Back when InstrRefBasedLDV was added,
I happened to bake in a "special" zero number for various reasons, which
Vedant identified as undesirable in this review comment:
https://reviews.llvm.org/D83047#inline-765495 . I subsequently removed that
special zero number, but it looks like I didn't delete this assertion at
the time, which assumes that a zero LocIdx is invalid.
The attached test shows that this assertion is reachable on valid code --
on x86 $rsp always gets the LocIdx number zero, and if you transfer a
variable value into it, InstrRefBasedLDV crashes on that assertion. The
code might be a bit wild to be storing variables to $rsp like that, however
we shouldn't crash on it.
Differential Revision: https://reviews.llvm.org/D108134
Alexander Potapenko [Tue, 17 Aug 2021 09:34:22 +0000 (11:34 +0200)]
[msan] Add support for disable_sanitizer_instrumentation attribute
Unlike __attribute__((no_sanitize("memory"))), this one will cause MSan
to skip the entire function during instrumentation.
Depends on https://reviews.llvm.org/D108029
Differential Revision: https://reviews.llvm.org/D108199
Guillaume Chatelet [Fri, 20 Aug 2021 13:09:35 +0000 (13:09 +0000)]
[libc] Align to 32B instead of 16B for optimized memcmp
Bjorn Pettersson [Wed, 18 Aug 2021 21:22:35 +0000 (23:22 +0200)]
[NewPM] Use parameterized syntax for a couple of more passes
A couple of passes that are parameterized in new-PM used different
pass names (in cmd line interface) while using the same pass class
name. This patch updates the PassRegistry to model pass parameters
more properly using PASS_WITH_PARAMS.
Reason for the change is to ensure that we have a 1-1 mapping
between class name and pass name (when disregarding the params).
With a 1-1 mapping it is more obvious which pass name to use in
options such as -debug-only, -print-after etc.
The opt -passes syntax is changed for the following passes:
early-cse-memssa => early-cse<memssa>
post-inline-ee-instrument => ee-instrument<post-inline>
loop-extract-single => loop-extract<single>
lower-matrix-intrinsics-minimal => lower-matrix-intrinsics<minimal>
This patch is not updating pass names in docs/Passes.rst. Not quite
sure what the status is for that document (e.g. when it comes to
listing pass paramters). It is only loop-extract-single that is
mentioned in Passes.rst today, out of the passes mentioned above.
Differential Revision: https://reviews.llvm.org/D108362
Louis Dionne [Fri, 20 Aug 2021 12:42:36 +0000 (08:42 -0400)]
[libc++] Update credits.txt per coment on D108263
Louis Dionne [Thu, 19 Aug 2021 16:39:16 +0000 (12:39 -0400)]
[libc++] Bypass calling exception-throwing functions in the dylib with -fno-exceptions
basic_string and vector currently have a hard dependency on the compiled
library because they need to call __vector_base_common::__throw_xxx(),
which are externally instantiated in the compiled library. That makes
sense when exceptions are enabled (because we're trying to localize the
exception-throwing code to the compiled library), but it doesn't really
make sense when exceptions are disabled, and the __throw_xxx functions
are just calling abort() anyways.
This patch simply overrides the __throw_xxx() functions so that they
don't rely on the compiled library when exceptions are disabled.
Differential Revision: https://reviews.llvm.org/D108389
Alexander Potapenko [Fri, 13 Aug 2021 12:17:41 +0000 (14:17 +0200)]
[clang][Codegen] Introduce the disable_sanitizer_instrumentation attribute
The purpose of __attribute__((disable_sanitizer_instrumentation)) is to
prevent all kinds of sanitizer instrumentation applied to a certain
function, Objective-C method, or global variable.
The no_sanitize(...) attribute drops instrumentation checks, but may
still insert code preventing false positive reports. In some cases
though (e.g. when building Linux kernel with -fsanitize=kernel-memory
or -fsanitize=thread) the users may want to avoid any kind of
instrumentation.
Differential Revision: https://reviews.llvm.org/D108029
Simon Pilgrim [Fri, 20 Aug 2021 11:41:38 +0000 (12:41 +0100)]
[clangd] detectClangPath() - remove (dead) return. NFC.
Simon Pilgrim [Fri, 20 Aug 2021 11:36:28 +0000 (12:36 +0100)]
MemProfilerPass::run - remove (dead) duplicate return. NFC.
Simon Pilgrim [Fri, 20 Aug 2021 11:32:12 +0000 (12:32 +0100)]
[AST] getDeclLocForCommentSearch - remove dead return. NFC.
Don't use an else-block as the previous if-block always returns, and remove the (now more obvious) dead return {}.
Florian Mayer [Fri, 20 Aug 2021 11:20:40 +0000 (12:20 +0100)]
Revert "[hwasan] do not check if freed pointer belonged to allocator."
This reverts commit
119146f8ae25c31ea630a15761a6fba6b7eb909c.
Simon Pilgrim [Fri, 20 Aug 2021 11:10:47 +0000 (12:10 +0100)]
[Sema] Remove dead return immediately after another return. NFC.
Denys Shabalin [Fri, 20 Aug 2021 10:35:09 +0000 (12:35 +0200)]
[mlir][linalg] Fix __repr__ implementation in const from opdsl
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D108369
Tim Northover [Fri, 20 Aug 2021 10:16:07 +0000 (11:16 +0100)]
AArch64: don't form indexed paired ops if base reg overlaps operands.
The registers involved might not be identical, but can still overlap (e.g.
"str w0, [x0, #4]!").
Roman Lebedev [Fri, 20 Aug 2021 10:17:56 +0000 (13:17 +0300)]
[NFCI][SimplifyCFG] Rewrite `createUnreachableSwitchDefault()`
The only thing that function should do as per it's semantic,
is to ensure that the switch's default is a block consisting only of
an `unreachable` terminator.
So let's just create such a block and update switch's default
to point to it. There should be no need for all this weird dance
around predecessors/successors.
Jingu Kang [Wed, 14 Jul 2021 10:43:29 +0000 (11:43 +0100)]
[AArch64] Enable Upper bound unrolling universally
Differential Revision: https://reviews.llvm.org/D105996
Fraser Cormack [Tue, 17 Aug 2021 14:01:19 +0000 (15:01 +0100)]
[RISCV] Fix reporting of incorrect commutable operand indices
This patch fixes an issue where RISCV's `findCommutedOpIndices` would
incorrectly return the pseudo `CommuteAnyOperandIndex` as a commutable
operand index, rather than fixing a specific index.
Reviewed By: rogfer01
Differential Revision: https://reviews.llvm.org/D108206
Andrzej Warzynski [Fri, 20 Aug 2021 09:11:19 +0000 (09:11 +0000)]
Revert "[flang] Refine output file generation"
This reverts commit
fd21d1e198e381a2b9e7af1701044462b2d386cd.
The test added in this patch [1] is failing on Windows and causing the
Windows BuildBot [2] to fail. I don't see any obvious way to fix this,
so reverting in order to investigate.
[1] llvm-project/flang/test/Driver/output-paths.f90
[2] https://lab.llvm.org/buildbot/#/builders/172/builds/2077
Vladislav Vinogradov [Thu, 19 Aug 2021 13:28:16 +0000 (16:28 +0300)]
[mlir] Fix ControlFlowInterfaces implementation for Async dialect
* Add `RegionBranchTerminatorOpInterface` to `YieldOp`.
* Implement `getSuccessorEntryOperands` in `ExecuteOp`.
* Fix `getSuccessorRegions` implementation in `ExecuteOp`.
Reviewed By: ezhulenev
Differential Revision: https://reviews.llvm.org/D108373
Florian Mayer [Thu, 19 Aug 2021 15:52:45 +0000 (16:52 +0100)]
[hwasan] do not check if freed pointer belonged to allocator.
In that case it is very likely that there will be a tag mismatch anyway.
We handle the case that the pointer belongs to neither of the allocators
by getting a nullptr from allocator.GetBlockBegin.
Reviewed By: hctim, eugenis
Differential Revision: https://reviews.llvm.org/D108383
Vignesh Balasubramanian [Thu, 19 Aug 2021 07:16:07 +0000 (12:46 +0530)]
[OpenMP][OMPD]Code movement required for OMPD
These changes don't come under OMPD guard as it is a movement of existing code to capture parallel behavior correctly.
"Runtime Entry Points for OMPD" like "ompd_bp_parallel_begin" and "ompd_bp_parallel_begin" should be placed at the correct execution point for the debugging tool to access proper handles/data.
Without the below changes, in certain cases, debugging tool will pick the wrong parallel and task handle.
Reviewed By: @hbae
Differential Revision: https://reviews.llvm.org/D100366
Vladislav Vinogradov [Thu, 19 Aug 2021 14:33:58 +0000 (17:33 +0300)]
[mlir][NFC] Use explicit ::mlir namespace in mlir-tblgen generated code
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D108376
Jingu Kang [Fri, 20 Aug 2021 07:46:32 +0000 (08:46 +0100)]
Precommit test for D108204
Justas Janickas [Thu, 19 Aug 2021 14:43:32 +0000 (15:43 +0100)]
[OpenCL] Fix version reporting of C++ for OpenCL 2021
C++ for OpenCL version 2021 and later are expected to consist of a
major version number only. Therefore, a different constructor for
`VersionTuple` needs to be called when reporting language version.
Differential Revision: https://reviews.llvm.org/D108379
Yaron Keren [Fri, 20 Aug 2021 05:28:45 +0000 (08:28 +0300)]
[docs] Clarify how to run cmake and llvm-lit with Visual Studio addressing PR45978
Differential Revision: https://reviews.llvm.org/D108444
Sam McCall [Fri, 20 Aug 2021 06:49:25 +0000 (08:49 +0200)]
[AST] Avoid single-trip loop in ClangAttrEmitter
This triggers coverity warnings, see https://reviews.llvm.org/D107703
Andrzej Warzynski [Wed, 18 Aug 2021 16:14:09 +0000 (16:14 +0000)]
[flang] Refine output file generation
This patch refactors the file generation API in Flang's frontend driver.
It improves the layering between `CreateDefaultOutputFile`,
`CreateOutputFile` (`CompilerInstance` methods) and their various
clients.
List of changes:
* Rename `CreateOutputFile` as `CreateOutputFileImpl` and make it
private. This method is an implementation detail.
* Instead of passing an `std::error_code` out parameter into
`CreateOutputFileImpl`, have it return Expected<>. This is a bit shorter
and more idiomatic LLVM.
* Make `CreateDefaultOutputFile` (which calls `CreateOutputFileImpl`)
issue an error when file creation fails. The error code from
`CreateOutputFileImpl` is used to generate a meaningful diagnostic
message.
* Remove error reporting from `PrintPreprocessedAction::ExecuteAction`.
This is only for cases when output file generation fails. This is
handled in `CreateDefaultOutputFile` instead (see the previous point).
* Inline `AddOutputFile` into its only caller,
`CreateDefaultOutputFile`.
* Switch from `lvm::buffer_ostream` to `llvm::buffer_unique_ostream>`
for non-seekable output streams. This simplifies the logic in the driver
and was introduced for this very reason in [1]
* Moke sure that the diagnostics from the prescanner when running `-E`
(`PrintPreprocessedAction::ExecuteAction`) are printed before the actual
output is generated.
* Update comments, add test.
[1] https://reviews.llvm.org/D93260
Differential Revision: https://reviews.llvm.org/D108390
Guillaume Chatelet [Thu, 19 Aug 2021 20:58:15 +0000 (20:58 +0000)]
[libc] Add an optimized version for memcmp
Differential Revision: https://reviews.llvm.org/D108406
Kazu Hirata [Fri, 20 Aug 2021 06:34:22 +0000 (23:34 -0700)]
[DWARF] Remove parseListTableHeader (NFC)
The last use was removed on Oct 4, 2020 in commit
6d0be74af5555f7bc56ac72cbd98ff270fd1291b.
Sebastian Neubauer [Thu, 19 Aug 2021 11:55:03 +0000 (13:55 +0200)]
[AMDGPU] Fix too many constants with flat scratch
Prevent SIFoldOperands from creating SALU instructions with a constant
and a frame index. Previously, only one operand was checked to be a
frame index, leading to too many constants when flat scratch is enabled
and stack offsets are large.
Differential Revision: https://reviews.llvm.org/D108368