Dominik Adamski [Thu, 20 Oct 2022 09:29:57 +0000 (04:29 -0500)]
[mlir][OpenMP] Add aligned clause definition to simd construct
simd aligned construct is represented as pair of variable which needs
to be aligned and corresponding alignment value.
Added parser, printer and verifier of aligned clause. MLIR tests were
updated to test correctness of MLIR definition of aligned clause.
Differential Revision: https://reviews.llvm.org/D135865
Reviewed By: kiranchandramohan
Sanjay Patel [Tue, 1 Nov 2022 16:04:04 +0000 (12:04 -0400)]
[PatternMatch] add unittests for logical-and/or; NFC
Nikita Popov [Tue, 1 Nov 2022 16:03:40 +0000 (17:03 +0100)]
Revert "[ValueLattice] Fix getCompare() for undef values"
This reverts commit
6de41e6d7652b74a5aa2bd78b0597cc53a8c3c2a.
Missed a unit test affected by this change, revert for now.
Nikita Popov [Tue, 1 Nov 2022 16:00:17 +0000 (17:00 +0100)]
[SCCP] Regenerate test checks (NFC)
Dhruva Chakrabarti [Tue, 1 Nov 2022 15:59:58 +0000 (08:59 -0700)]
Revert "[OpenMP] [OMPT] [2/8] Implemented a connector for communication of OMPT callbacks between libraries."
This reverts commit
f94c2679cb1db92ce4103487bf0247eca6e4d722.
Adrian Tong [Mon, 31 Oct 2022 17:22:17 +0000 (17:22 +0000)]
Implement support for AArch64ISD::MOVI in computeKnownBits
This helps simplify a USHR+ORR into USRA on AArch64
Differential Revision: https://reviews.llvm.org/D137108
Jeffrey Tan [Tue, 25 Oct 2022 16:42:34 +0000 (09:42 -0700)]
Add formatting support for VSCode logpoints message
https://reviews.llvm.org/D127702 adds the initial logpoints support in
lldb-vscode. This patch further improves it by:
1. Adding a newline at the end of each log message
2. Support most of the format specifiers like \t, \n, \x etc..
The implementation is borrowed from FormatEntity::ParseInternal(). Future
patch should merge these two implementations.
Differential Revision: https://reviews.llvm.org/D136697
Nikita Popov [Tue, 1 Nov 2022 15:39:20 +0000 (16:39 +0100)]
[ValueLattice] Fix getCompare() for undef values
Resolve the TODO about incorrect getCompare() behavior. This can
be made more precise (e.g. by materializing the undef value and
performing constant folding on it), but for now just return an
unknown result.
Krzysztof Parzyszek [Tue, 1 Nov 2022 15:29:21 +0000 (08:29 -0700)]
[Hexagon] Use HVX predicates when mapping HVX intrinsics in isel
In llvm/lib/Target/Hexagon/HexagonDepMapAsm2Intrin.td we use "HasV66" for
HVX v66 intrinsics. We should be using "UseHVXV66" instead, since HVX has
its own versioning.
Adrian Tong [Tue, 1 Nov 2022 15:22:45 +0000 (15:22 +0000)]
Precommit test cases for D137108 (Support for AArch64ISD::MOVI in computeKnownBits)
Lei Zhang [Tue, 1 Nov 2022 15:33:42 +0000 (11:33 -0400)]
[mlir][gpu] Relax MMA load/store to allow vector memref
This is useful for converting to SPIR-V, where we'd like to have
memref of vector element types.
Reviewed By: ThomasRaoux, bondhugula
Differential Revision: https://reviews.llvm.org/D137143
Simon Pilgrim [Tue, 1 Nov 2022 15:34:32 +0000 (15:34 +0000)]
[X86] Fix broadcastm intrinsics comment
These broadcast from mask predicate registers, and don't load from memory
Noticed while reviewing D137163
Nikita Popov [Tue, 1 Nov 2022 15:17:05 +0000 (16:17 +0100)]
[AA] Add missing const qualifier (NFC)
Yonghong Song [Wed, 26 Oct 2022 23:15:02 +0000 (16:15 -0700)]
[clang][Sema] Fix a clang crash with btf_type_tag
For the following program,
$ cat t.c
struct t {
int (__attribute__((btf_type_tag("rcu"))) *f)();
int a;
};
int foo(struct t *arg) {
return arg->a;
}
Compiling with 'clang -g -O2 -S t.c' will cause a failure like below:
clang: /home/yhs/work/llvm-project/clang/lib/Sema/SemaType.cpp:6391: void {anonymous}::DeclaratorLocFiller::VisitParenTypeLoc(clang::ParenTypeLoc):
Assertion `Chunk.Kind == DeclaratorChunk::Paren' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
......
#5 0x00007f89e4280ea5 abort (/lib64/libc.so.6+0x21ea5)
#6 0x00007f89e4280d79 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x21d79)
#7 0x00007f89e42a6456 (/lib64/libc.so.6+0x47456)
#8 0x00000000045c2596 GetTypeSourceInfoForDeclarator((anonymous namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*) SemaType.cpp:0:0
#9 0x00000000045ccfa5 GetFullTypeForDeclarator((anonymous namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*) SemaType.cpp:0:0
......
The reason of the failure is due to the mismatch of TypeLoc and D.getTypeObject().Kind. For example,
the TypeLoc is
BTFTagAttributedType 0x88614e0 'int btf_type_tag(rcu)()' sugar
|-ParenType 0x8861480 'int ()' sugar
| `-FunctionNoProtoType 0x8861450 'int ()' cdecl
| `-BuiltinType 0x87fd500 'int'
while corresponding D.getTypeObject().Kind points to DeclaratorChunk::Paren, and
this will cause later assertion.
To fix the issue, similar to AttributedTypeLoc, let us skip BTFTagAttributedTypeLoc in
GetTypeSourceInfoForDeclarator().
Differential Revision: https://reviews.llvm.org/D136807
Sanjay Patel [Tue, 1 Nov 2022 15:04:10 +0000 (11:04 -0400)]
[InstCombine] add helper function for select-of-bools folds; NFC
This set of folds keeps growing, and it contains
bugs like issue #58552, so make it easier to
spot those via backtrace.
David Green [Tue, 1 Nov 2022 15:00:56 +0000 (15:00 +0000)]
[ARM] Tests for various NEON vector compares. NFC
Archibald Elliott [Tue, 1 Nov 2022 14:52:37 +0000 (14:52 +0000)]
[ARM] Specify Triple in DebugInfo Tests
When the host's target triple ends in `-windows-msvc`, `%llc_dwarf`
contains an explicit `-windows-gnu` triple which ensures that dwarf will
be used. This is useful in target-independent tests, where no triple is
specified, and no target-specific features are used. However, this is
not compatible with target-dependent tests (such as those in
llvm/test/DebugInfo/ARM), as the command-line triple will override the
triple in the LLVM IR program, causing test issues on windows.
This change switches these tests to use an explicit triple, so the tests
test what was expected, and there is no flakiness on windows.
Fixes #58053
Differential Revision: https://reviews.llvm.org/D136066
Aaron Ballman [Tue, 1 Nov 2022 14:46:20 +0000 (10:46 -0400)]
Update a stale comment; NFC
This function doesn't return anything these days.
Florian Hahn [Tue, 1 Nov 2022 14:43:42 +0000 (14:43 +0000)]
[ConstraintElimination] Fix nested GEP check.
At the moment, the implementation requires that the outer GEP has a
single index, the inner GEP can have an arbitrary indices, because the
general `decompose` helper is used.
David Sherwood [Wed, 26 Oct 2022 08:50:17 +0000 (08:50 +0000)]
[AArch64][SVE2] Add the SVE2.1 while predicate-as-counter instructions
This patch adds the assembly/disassembly for the following
predicate-as-counter instructions:
whilelt: While incrementing signed scalar less than scalar
whilele: While incrementing signed scalar less than or equal to scalar
whilegt: While incrementing signed scalar greater than scalar
whilege: While incrementing signed scalar greater than or equal to scalar
whilelo: While incrementing unsigned scalar lower than scalar
whilels: While incrementing unsigned scalar lower or same as scalar
whilehs: While decrementing unsigned scalar higher or same as scalar
whilehi: While decrementing unsigned scalar higher than scalar
The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09
Differential Revision: https://reviews.llvm.org/D136750
Florian Hahn [Tue, 1 Nov 2022 14:17:38 +0000 (14:17 +0000)]
[ConstraintElimination] Add tests for nested GEPs with multiple indices.
Nico Weber [Tue, 1 Nov 2022 14:07:13 +0000 (10:07 -0400)]
[gn build] port
6e6704b0dc2c
Sanjay Patel [Tue, 1 Nov 2022 12:24:13 +0000 (08:24 -0400)]
[InstCombine] add test for mul with shl; NFC
David Sherwood [Tue, 25 Oct 2022 15:56:40 +0000 (15:56 +0000)]
[AArch64][SVE2] Add the SVE2.1 cntp instruction
This patch adds the assembly/disassembly for the following instructions:
cntp : Set scalar to count from predicate-as-counter
The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09
Differential Revision: https://reviews.llvm.org/D136747
Caroline Concatto [Thu, 27 Oct 2022 14:49:36 +0000 (15:49 +0100)]
[AArch64]SME2 Outer Product and Accumulate instructions
This patch adds the assembly/disassembly for the following instructions:
BMOPA: Bitwise exclusive NOR population count outer product and accumulate.
BMOPS: Bitwise exclusive NOR population count outer product and subtract.
SMOPA (2-way): Signed integer sum of outer products and accumulate.
SMOPS (2-way): Signed integer sum of outer products and subtract.
UMOPA (2-way): Unsigned integer sum of outer products and accumulate.
UMOPS (2-way): Signed integer sum of outer products and accumulate.
The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09
Differential Revision: https://reviews.llvm.org/D136077
wanglei [Tue, 1 Nov 2022 12:44:54 +0000 (20:44 +0800)]
[LoongArch] Remove useless empty pattern fields in some Pseudo instructions. NFC
Youling Tang [Tue, 1 Nov 2022 12:48:45 +0000 (20:48 +0800)]
[sanitizer] Fix build error with current LoongArch Clang
Fix the following build failures:
```
In file included from /home/loongson/llvm-work/llvm-project/compiler-rt/lib/sanitizer_common/sanit>
llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_loongarch64.inc:27:23: error>
register u64 a7 asm("a7") = nr;
^
llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_loongarch64.inc:28:23: error>
register u64 a0 asm("a0"); ^
```
The non-prefix `$` syntax in inline assembly is not supported in clang
yet (it is supported by gcc), add prefix `$` to solve the problem.
Differential Revision: https://reviews.llvm.org/D137145
Youling Tang [Tue, 1 Nov 2022 12:19:33 +0000 (20:19 +0800)]
[asan][test] Fix build errors in loongarch64
- Add get_bits_for_arch for loongarch64 detection, fix the following error,
```
$ make check-asan
-- sanitizer_common tests on "Linux" will run against "asan"
CMake Error at test/asan/CMakeLists.txt:22 (message):
Unknown target architecture: loongarch64
Call Stack (most recent call first):
test/asan/CMakeLists.txt:49 (get_bits_for_arch)
```
- Do not use __builtin_longjmp, fix the following error,
```
llvm-project/compiler-rt/lib/asan/tests/asan_test.cpp:635:3: error: __builtin_longjmp is not supported for the current target
__builtin_longjmp((void**)buf, 1);
```
Differential Revision: https://reviews.llvm.org/D137012
Youling Tang [Tue, 1 Nov 2022 12:14:06 +0000 (20:14 +0800)]
[builtins][LoongArch] Port __clear_cache to LoongArch Linux
There are two failures in the current builtins,
Failed Tests (2):
Builtins-loongarch64-linux :: clear_cache_test.c
Builtins-loongarch64-linux :: enable_execute_stack_test.c
It is caused by __clear_cache not being implemented and triggering `abort`.
"__clear_cache" is implemented in the same way as "clear_cache" in gcc (
in gcc/config/loongarch/loongarch.md)
Differential Revision: https://reviews.llvm.org/D136921
Youling Tang [Tue, 1 Nov 2022 12:08:06 +0000 (20:08 +0800)]
[compiler-rt][builtins] Support builtins for LoongArch
Initial builtins for LoongArch.
Add loongarch64 to ALL_CRT_SUPPORTED_ARCH list.
Support fe_getround and fe_raise_inexact in builtins.
Differential Revision: https://reviews.llvm.org/D136338
Simon Pilgrim [Tue, 1 Nov 2022 12:06:34 +0000 (12:06 +0000)]
[X86] combineConcatVectorOps - fold 512-bit concat(GF2P8AFFINEQB(x,y,c),GF2P8AFFINEQB(z,w,c)) -> GF2P8AFFINEQB(concat(x,z),concat(y,w),c)
Now that D137036 has landed, we just need AVX512F support to generate 512-bit GF2P8AFFINEQB ops
Anton Sidorenko [Fri, 28 Oct 2022 09:19:04 +0000 (12:19 +0300)]
[GlobalISel] Compute debug location when merging stores more accurately
Originaly the loop did almost nothing as the calculated location was
overwritten on the next iteration.
Differential Revision: https://reviews.llvm.org/D136937
Valery Pykhtin [Mon, 31 Oct 2022 13:12:35 +0000 (14:12 +0100)]
[AMDGPU] Fix RP tracker's live registers after processing a memory clause.
It's incorrect to reuse live registers left from the first instruction in a clause after the clause as they don't contain in-clause defs.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D137081
Anton Sidorenko [Mon, 31 Oct 2022 10:13:12 +0000 (13:13 +0300)]
[GlobalISel] Precommit test for D136937
David Sherwood [Thu, 20 Oct 2022 12:27:16 +0000 (12:27 +0000)]
[AArch64][SVE2] Add the SVE2.1 contiguous stores to multiple consecutive vectors
This patch adds the assembly/disassembly for the following instructions:
st1* : Contiguous store of bytes to multiple consecutive vectors -
(scalar + scalar) and (scalar + immediate)
stnt1* : Contiguous store non-temporal of bytes to multiple consecutive
vectors - (scalar + scalar) and (scalar + immediate)
The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09
Differential Revision: https://reviews.llvm.org/D136686
David Sherwood [Wed, 19 Oct 2022 14:27:12 +0000 (14:27 +0000)]
[AArch64][SVE2] Add the SVE2.1 contiguous load to multiple consecutive vector
This patch adds the assembly/disassembly for the following instructions:
ld1* : Contiguous load of bytes to multiple consecutive vectors -
(scalar + scalar) and (scalar + immediate)
ldnt1* : Contiguous load non-temporal of bytes to multiple consecutive
vectors - (scalar + scalar) and (scalar + immediate)
The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09
Differential Revision: https://reviews.llvm.org/D136680
Stefan Gränitz [Tue, 1 Nov 2022 09:13:43 +0000 (10:13 +0100)]
[JITLink] Revert template typename change after
2a3b257a935a (NFC)
As pointed out in the review https://reviews.llvm.org/D135523#C3696894NL515
Tiezhu Yang [Tue, 1 Nov 2022 04:56:55 +0000 (12:56 +0800)]
[LLDB][LoongArch] Add LoongArch ArchSpec and subtype detection
Define LoongArch architecture subtypes, add the LoongArch ArchSpec bits,
and inspect the ELF header to detect the right subtype based on ELF class.
Here is a simple test:
```
[loongson@linux ~]$ cat hello.c
int main()
{
printf("Hello, World!\n");
return 0;
}
[loongson@linux ~]$ clang hello.c -g -o hello
```
Without this patch:
```
[loongson@linux ~]$ llvm-project/llvm/build/bin/lldb hello
(lldb) target create "hello"
error: '/home/loongson/hello' doesn't contain any 'host' platform architectures: unknown
```
With this patch:
```
[loongson@linux ~]$ llvm-project/llvm/build/bin/lldb hello
(lldb) target create "hello"
Current executable set to '/home/loongson/hello' (loongarch64).
(lldb) run
Process 735167 launched: '/home/loongson/hello' (loongarch64)
Hello, World!
Process 735167 exited with status = 0 (0x00000000)
(lldb) quit
[loongson@linux ~]$ llvm-project/llvm/build/bin/llvm-lit llvm-project/lldb/test/Shell/ObjectFile/ELF/loongarch-arch.yaml
llvm-lit: /home/loongson/llvm-project/llvm/utils/lit/lit/llvm/config.py:456: note: using clang: /home/loongson/llvm-project/llvm/build/bin/clang
-- Testing: 1 tests, 1 workers --
PASS: lldb-shell :: ObjectFile/ELF/loongarch-arch.yaml (1 of 1)
Testing Time: 0.09s
Passed: 1
```
Reviewed By: SixWeining, xen0n, DavidSpickett
Differential Revision: https://reviews.llvm.org/D137057
Nikita Popov [Thu, 27 Oct 2022 10:45:08 +0000 (12:45 +0200)]
[IR] Take operand bundles into account for call argument readonly/writeonly
We currently only take operand bundle effects into account when
querying the function-level memory attributes. However, I believe
that we also need to do the same for parameter attributes. For
example, a call with deopt bundle to a function with readnone
parameter attribute cannot treat that parameter as readnone,
because the deopt bundle may read it.
Differential Revision: https://reviews.llvm.org/D136834
Matt Arsenault [Tue, 1 Nov 2022 07:40:46 +0000 (00:40 -0700)]
AMDGPU: Add testcase from issue 58639
This was fixed in
bf789b1957efd2482e1dbd164d91a6612a450fe3
Yeting Kuo [Mon, 24 Oct 2022 15:40:48 +0000 (23:40 +0800)]
[VP][RISCV] Add vp.rint and RISC-V support.
FRINT uses dynamic rounding mode instead of static rounding mode. The patch
rename VFCVT_X_F_VL to VFCVT_RM_X_F_VL for static rounding mode uses and added
new ISDNode VFCVT_X_F_VL directly selected to PseudoVFCVT_X_F_V.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D136662
Matt Arsenault [Sat, 29 Oct 2022 18:32:04 +0000 (11:32 -0700)]
AMDGPU/GlobalISel: Add missing run line for gfx7 packed operations
We were only testing targets with legal 16-bit operations.
Matt Arsenault [Tue, 20 Sep 2022 22:17:25 +0000 (18:17 -0400)]
AtomicExpand: Use InstSimplifyFolder
Automatically cleanup operations if we know the atomic has higher
alignment.
Michał Górny [Fri, 28 Oct 2022 20:13:35 +0000 (22:13 +0200)]
[lit] Add pyproject.toml and fix build w/ modern setuptools backend
Add a `pyproject.toml` file that provides build system information
for PEP 517-compliant builders. While all the commonly used builders
provide fallback to running `setup.py` for backwards compatibility, this
ensures the best forward compatibility. It also provides a reliable way
of specifying the minimum required setuptools version. Effectively, it
will make it possible to remove `setup.py` in favor of purely
declarative configuration in the future, or even switch to a different
build system.
Update `setup.py` to explicitly add the current directory to `sys.path`
for importing `lit`. This is necessary, as the modern setuptools
backend does not guarantee that the current directory is present there.
Differential Revision: https://reviews.llvm.org/D136976
Arnab Dutta [Mon, 31 Oct 2022 11:49:51 +0000 (17:19 +0530)]
[MLIR] Fix bug in the method constructing semi affine expression from flattened form
Set proper offset to the second element of the index pair, so that
we do not have same index values for more than one local expression.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D137062
Michael Buch [Tue, 1 Nov 2022 05:56:15 +0000 (22:56 -0700)]
[lldb][Test] Fix TestFrameFormatNameWithArgs.test on Windows/Linux
* Windows doesn't support setting these breakpoints by basename
* On Linux std::function arguments aren't formatted as such
Alexander Shaposhnikov [Tue, 1 Nov 2022 05:55:28 +0000 (05:55 +0000)]
[IR][Instruction] Annotate more methods with LLVM_READONLY
This diff annotates more methods of the class Instruction with
LLVM_READONLY (similarly to isAssociative/isCommutative).
Test plan: ninja check-all
Differential revision: https://reviews.llvm.org/D137053
skc7 [Wed, 26 Oct 2022 04:33:13 +0000 (04:33 +0000)]
[SLP] Extend reordering data of tree entry to support PHI nodes
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D136757
Michał Górny [Tue, 1 Nov 2022 04:49:24 +0000 (05:49 +0100)]
Revert "[compiler-rt] Switch from llvm-config to find_package(LLVM)"
This reverts commit
37acf9bdd4686397a6d37000e8d3fe35f456a860. It broke
a buildbot.
Sameer Sahasrabuddhe [Tue, 1 Nov 2022 04:26:58 +0000 (09:56 +0530)]
[AAPointerInfo] refactor how offsets and Access objects are tracked
AAPointerInfo now maintains a list of all Access objects that it owns, along
with the following maps:
- OffsetBins: OffsetAndSize -> { Access }
- InstTupleMap: RemoteI x LocalI -> Access
A RemoteI is any instruction that accesses memory. RemoteI is different from
LocalI if and only if LocalI is a call; then RemoteI is some instruction in the
callgraph starting from LocalI.
Motivation: When AAPointerInfo recomputes the offset for an instruction, it sets
the value to Unknown if the new offset is not the same as the old offset. The
instruction must now be moved from its current bin to the bin corresponding to
the new offset. This happens for example, when:
- A PHINode has operands that result in different offsets.
- The same remote inst is reachable from the same local inst via different paths
in the callgraph:
```
A (local inst)
|
B
/ \
C1 C2
\ /
D (remote inst)
```
This fixes a bug where a store is incorrectly eliminated in a lit test.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D136526
Matt Arsenault [Sat, 29 Oct 2022 01:50:19 +0000 (18:50 -0700)]
llvm-reduce: Write bitcode temporary files for bitcode inputs
Most tools accept .ll or .bc inputs interchangably, but some don't.
Default to writing temporary files that match the input. This
will also aid reducing deserialization bugs.
Matt Arsenault [Sat, 29 Oct 2022 01:24:21 +0000 (18:24 -0700)]
llvm-reduce: Drop guessing output format based on file extension
Matt Arsenault [Wed, 26 Oct 2022 20:05:46 +0000 (13:05 -0700)]
llvm-reduce: Support emitting bitcode for final result
Previously, this unconditionally emitted text IR. I ran
into a bug that manifested in broken disassembly, so the
desired output was the bitcode format. If the input format
was binary bitcode, the requested output file ends in .bc,
or an explicit -output-bitcode option was used, emit bitcode.
Michał Górny [Sat, 29 Oct 2022 17:03:37 +0000 (19:03 +0200)]
[compiler-rt] Switch from llvm-config to find_package(LLVM)
Replace the use of the deprecated `llvm-config` tool with LLVM's CMake
files for detecting LLVM in standalone builds.
Differential Revision: https://reviews.llvm.org/D137024
Matt Arsenault [Sat, 29 Oct 2022 00:17:00 +0000 (17:17 -0700)]
Fix missing C++ mode comment
Matt Arsenault [Mon, 24 Oct 2022 16:08:54 +0000 (09:08 -0700)]
llvm-reduce: Report file opening errors
This was also trying to write the bitcode to the failed file
on failure, which asserts. Also, consistently use
ToolOutputFile, instead of one path manually removing
the temp file.
Matt Arsenault [Thu, 29 Sep 2022 20:21:49 +0000 (16:21 -0400)]
AtomicExpand: Don't create unused instructions for some atomicrmw
This wasn't used by every atomicrmw expansion.
Matt Arsenault [Sat, 29 Oct 2022 19:34:03 +0000 (12:34 -0700)]
Hexagon: Register null TargetStreamer
Unlike just about every target, I don't
see an obvious null dereference this fixes.
Matt Arsenault [Sat, 29 Oct 2022 19:34:42 +0000 (12:34 -0700)]
Hexagon: Add missing C++ mode comment
Matt Arsenault [Sat, 29 Oct 2022 19:38:55 +0000 (12:38 -0700)]
NVPTX: Register null target streamer
Matt Arsenault [Fri, 28 Oct 2022 20:42:37 +0000 (13:42 -0700)]
X86: Implement null target streamer
There should no need for null checks in the AsmPrinter
Matt Arsenault [Fri, 28 Oct 2022 17:32:15 +0000 (10:32 -0700)]
AArch64: Register null MCTargetStreamer
Fixes crashes with clang -emit-codegen-only
Florian Mayer [Tue, 1 Nov 2022 00:39:05 +0000 (17:39 -0700)]
Revert "[InstCombine] fold mul with decremented "shl -1" factor"
This reverts commit
bc886e9b587b9d009f49b12eaaa9ebc1c71905a1.
Broke MSAN bootstrap buildbots with Assertion `RangeAfterCopy % ExtraScale == 0 && "Extra instruction requires immediate to be aligned"' failed.
Florian Mayer [Mon, 31 Oct 2022 23:34:17 +0000 (16:34 -0700)]
[NFC] use has_value instead of hasValue
LLVM GN Syncbot [Mon, 31 Oct 2022 23:37:46 +0000 (23:37 +0000)]
[gn build] Port
627465cf9fa7
Nikolas Klauser [Wed, 19 Oct 2022 09:06:12 +0000 (11:06 +0200)]
[libc++][PMR] Deprecate the implementation in std::experimental
This commit deprecates <experimental/memory_resource> since we now ship the non-experimental
version of it. Per the libc++ policy [1], we are deprecating the experimental feature in
upcoming LLVM 16 and will remove it entirely in LLVM 18.
[1]: https://libcxx.llvm.org/DesignDocs/ExperimentalFeatures.html#id4
Reviewed By: ldionne, #libc
Spies: EricWF, libcxx-commits
Differential Revision: https://reviews.llvm.org/D136245
Nikolas Klauser [Tue, 18 Oct 2022 19:40:49 +0000 (21:40 +0200)]
[libc++][PMR] Move the pmr::memory_resource destructor into the dylib
This avoids emitting the VTable of `pmr::memory_resource` in every TU.
Reviewed By: ldionne
Spies: EricWF, nemanjai, libcxx-commits
Differential Revision: https://reviews.llvm.org/D136196
Nikolas Klauser [Tue, 18 Oct 2022 19:33:32 +0000 (21:33 +0200)]
[libc++][PMR] Mark completed papers and issues as such
Reviewed By: ldionne, #libc
Spies: krytarowski, Quuxplusone, tschuett, libcxx-commits
Differential Revision: https://reviews.llvm.org/D136194
Nikolas Klauser [Tue, 18 Oct 2022 18:40:13 +0000 (20:40 +0200)]
[libc++][PMR] Add attributes
This allows the compiler to do more optimizations.
Reviewed By: ldionne, #libc
Spies: libcxx-commits, krytarowski
Differential Revision: https://reviews.llvm.org/D136191
Nikolas Klauser [Wed, 12 Oct 2022 23:03:58 +0000 (01:03 +0200)]
[libc++] Move preferred_name declarations into the forward declaring headers and add pmr preferred names
We currently define the preferred names in multiple places. `basic_string` and `basic_string_view` also have a lot of aliases, which makes the declarations quite long. So let's only add the preferred names in forward-declaring headers to make the implementation more readable and have all the preferred names in one place.
Reviewed By: ldionne
Spies: EricWF, krytarowski, libcxx-commits
Differential Revision: https://reviews.llvm.org/D135824
Ilia Diachkov [Sat, 29 Oct 2022 00:07:02 +0000 (03:07 +0300)]
[SPIRV] support the enqueue_kernel builtin function
The patch adds support of the enqueue_kernel builtin function.
It is implemented in the same way as in the SPIRV translator.
2 LIT tests are added to show the improvement.
Differential Revision: https://reviews.llvm.org/D137018
Anlun Xu [Mon, 31 Oct 2022 22:26:58 +0000 (15:26 -0700)]
[Bazel] Add llvm:Support to Bazel deps of SPIRVCommonConversion
Differential Revision: https://reviews.llvm.org/D137119
Usman Nadeem [Mon, 31 Oct 2022 22:08:11 +0000 (15:08 -0700)]
[JumpThreading] Put a limit on the PHI nodes when duplicating a BB.
Do not duplicate a BB if it has a lot of PHI nodes.
If a threadable chain is too long then the number of duplicated PHI nodes
can add up, leading to a substantial increase in compile time when rewriting
the SSA.
Fixes https://github.com/llvm/llvm-project/issues/58203
Differential Revision: https://reviews.llvm.org/D136716
The threshold of 76 in this patch is reasonably high and reduces the compile
time of cldwat2m_macro.f90 in SPEC2017/cam4 from 80+min to <2min.
Change-Id: I153c89a8e0d89b206a5193dc1b908c67e320717e
Craig Topper [Mon, 31 Oct 2022 19:37:51 +0000 (12:37 -0700)]
[RISCV] Fix crash a vector add has a 4x sext and zext operand.
We can narrow one of the extends and keep the other original by
using a vwaddu.wv or vwadd.wv.
We were previously forgetting to keep the original operand and
instead took the source of its extend. This resulted in a type
mismatch that later failed with an impossible physical register copy.
To fix this I've refactored some code to maintain information about
whether the source needs to be extended at all for longer so we could
use it in materialize.
Differential Revision: https://reviews.llvm.org/D137106
Evgeny Shulgin [Sat, 22 Oct 2022 20:17:56 +0000 (20:17 +0000)]
[libc++] Add test for checking progress on P0533R9
This test checks progress on P0533R9 (https://wg21.link/p0533r9).
Whenever a desired function becomes constexpr, the programmer won't forget
to switch `ASSERT_NOT_CONSTEXPR_CXX23` to `ASSERT_CONSTEXPR_CXX23` and
eventually to change the paper's implementation status. The test also works
as a reference list of unimplemented functions.
Reviewed By: philnik, #libc
Differential Revision: https://reviews.llvm.org/D136538
LLVM GN Syncbot [Mon, 31 Oct 2022 21:45:27 +0000 (21:45 +0000)]
[gn build] Port
84ea6b6f78df
LLVM GN Syncbot [Mon, 31 Oct 2022 21:45:26 +0000 (21:45 +0000)]
[gn build] Port
0d01300aacf6
Jonas Devlieghere [Mon, 31 Oct 2022 17:16:32 +0000 (10:16 -0700)]
[lldb] Emit diagnostic events in the diagnostic dump
Connect the diagnostic events with the diagnostic infrastructure.
- Emit existing diagnostic events (warnings and errors) to the
diagnostic log.
- Introduce a new diagnostic event (info) that's used exclusively for
diagnostic logging and does not get broadcast.
Differential revision: https://reviews.llvm.org/D136648
Jonas Devlieghere [Mon, 31 Oct 2022 17:11:12 +0000 (10:11 -0700)]
[lldb] Add a "diagnostics dump" command
Add a "diagnostics dump" command to, as the name implies, dump the
diagnostics to disk. The goal of this command is to let the user
generate the diagnostics in case of an issue that doesn't cause the
debugger to crash.
This command is also critical for testing, where we don't want to cause
a crash to emit the diagnostics.
Differential revision: https://reviews.llvm.org/D135622
Jonas Devlieghere [Fri, 28 Oct 2022 21:26:11 +0000 (14:26 -0700)]
[lldb] Add diagnostics
Around this time last year, I said on the mailing list [1] that I wanted
to to transform the reproducers into something that resembles a
sysdiagnose on Apple platforms: a collection of files containing a
variety of information to help diagnose bugs or troubleshoot issues.
This patch adds that framework. Based on lessons learned from the
reproducers, I've intentionally tried to keep it small and simple.
Different parts of LLDB can register callbacks (this is necessary for
layering purposes) that will get called when the diagnostics should be
generated.
[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html
Differential revision: https://reviews.llvm.org/D134991
Sanjay Patel [Mon, 31 Oct 2022 21:32:34 +0000 (17:32 -0400)]
[InstCombine] adjust branch on logical-and fold
The transform was just added with:
115d2f69a515cd756fa51
...but as noted in post-commit feedback, it was
confusingly coded. Now, we create the final
expected canonicalized form directly and put
an extra use check on the match, so we should
not ever end up with more instructions.
Sanjay Patel [Mon, 31 Oct 2022 21:29:03 +0000 (17:29 -0400)]
[InstCombine] add test for branch on logical-and; NFC
More coverage for the change
115d2f69a515cd756fa51 as
suggested in post-commit feedback.
Given that the transform is canonicalized with another
'not' op, we should adjust the use checks and create
that form directly.
Krzysztof Parzyszek [Mon, 31 Oct 2022 21:06:39 +0000 (14:06 -0700)]
[Hexagon] Add LLVM codegen testcases for V6_[add|sub]carryo intrinsics
Tue Ly [Mon, 31 Oct 2022 20:04:41 +0000 (16:04 -0400)]
[libc][math] Add place-holder implementation for pow function.
Add place-holder implementation for pow function to unblock libc demo
examples.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D137109
Tue Ly [Mon, 31 Oct 2022 19:42:00 +0000 (15:42 -0400)]
[libc][math] Add place-holder implementation for asin to unblock demo examples.
Add a place-holder implementation for asin to unblock libc demo
examples.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D137105
Peter Klausler [Mon, 31 Oct 2022 21:17:02 +0000 (14:17 -0700)]
[flang] Rework line of code to dodge clang 16 warning
Recode a non-short-circuiting conjunction of two Boolean function calls
into separate statements to avoid a warning from clang 16.
Jakub Kuderski [Mon, 31 Oct 2022 21:00:45 +0000 (17:00 -0400)]
[mlir][arith][spirv] Hard fail in `-convert-arith-to-spirv`
Turn legalization failures into hard failures to make sure that we do
not miss conversion pattern application failures.
Add a message on type conversion failure.
Move unsupported cases into a separate test file.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D137102
Dan Gohman [Tue, 4 Oct 2022 19:50:10 +0000 (12:50 -0700)]
[wasm-ld] Allow importing/exporting the output module's memory with arbitrary names
This adds an `--export-memory` option to wasm-ld which allows passing
a name to give to the exported memory, and extends `--import-memory` to
allow passing a <module>,<name> pair specifying where the memory should
be imported from.
This is based on https://reviews.llvm.org/D131376, with the main
difference being that it only supports exporting memory by one name.
Differential Revision: https://reviews.llvm.org/D135898
chenglin.bi [Mon, 31 Oct 2022 20:45:59 +0000 (04:45 +0800)]
[InstCombine] Precommit test for D136582; NFC
Krzysztof Parzyszek [Mon, 31 Oct 2022 19:28:25 +0000 (12:28 -0700)]
[Hexagon] Add builtins and intrinsics for V6_v[add|sub]carryo
Philip Reames [Mon, 31 Oct 2022 20:34:28 +0000 (13:34 -0700)]
[InstCombine] Allow simplify demanded transformations on scalable vectors
Differential Revision: https://reviews.llvm.org/D136475
Paul Robinson [Mon, 31 Oct 2022 20:14:56 +0000 (13:14 -0700)]
[lit] Fix typo in REQUIRES clause
Patrick Walton [Mon, 24 Oct 2022 22:31:35 +0000 (15:31 -0700)]
[AliasAnalysis] Introduce getModRefInfoMask() as a generalization of pointsToConstantMemory().
The pointsToConstantMemory() method returns true only if the memory pointed to
by the memory location is globally invariant. However, the LLVM memory model
also has the semantic notion of *locally-invariant*: memory that is known to be
invariant for the life of the SSA value representing that pointer. The most
common example of this is a pointer argument that is marked readonly noalias,
which the Rust compiler frequently emits.
It'd be desirable for LLVM to treat locally-invariant memory the same way as
globally-invariant memory when it's safe to do so. This patch implements that,
by introducing the concept of a *ModRefInfo mask*. A ModRefInfo mask is a bound
on the Mod/Ref behavior of an instruction that writes to a memory location,
based on the knowledge that the memory is globally-constant memory (in which
case the mask is NoModRef) or locally-constant memory (in which case the mask
is Ref). ModRefInfo values for an instruction can be combined with the
ModRefInfo mask by simply using the & operator. Where appropriate, this patch
has modified uses of pointsToConstantMemory() to instead examine the mask.
The most notable optimization change I noticed with this patch is that now
redundant loads from readonly noalias pointers can be eliminated across calls,
even when the pointer is captured. Internally, before this patch,
AliasAnalysis was assigning Ref to reads from constant memory; now AA can
assign NoModRef, which is a tighter bound.
Differential Revision: https://reviews.llvm.org/D136659
Paul Robinson [Mon, 31 Oct 2022 19:58:53 +0000 (12:58 -0700)]
[lit] Remove undefined keyword from a Driver test
`clang-driver` hasn't been a valid keyword for a long time.
The test fails when the keyword is removed, so added XFAIL: *
to reflect the true status of the test (XFAIL not UNSUPPORTED)
and filed issue #58711 to get it fixed.
Sanjay Patel [Mon, 31 Oct 2022 19:49:03 +0000 (15:49 -0400)]
[InstCombine] canonicalize branch with logical-and-not condition
https://alive2.llvm.org/ce/z/EfHlWN
In the motivating case from issue #58313,
this allows forming a duplicate 'not' op
which then gets CSE'd and simplifyCFG'd
and combined into the expected 'xor'.
Sanjay Patel [Mon, 31 Oct 2022 18:00:05 +0000 (14:00 -0400)]
[InstCombine] add tests for branch on logical and/or; NFC
Philip Reames [Mon, 31 Oct 2022 18:54:37 +0000 (11:54 -0700)]
[test] Add coverage for sign bits and known non-zero for scalable vectors
Peter Klausler [Mon, 17 Oct 2022 19:51:00 +0000 (12:51 -0700)]
[flang] Fix pointer definition semantic checking via refactoring
The infrastructure in semantics that is used to check that the
left-hand sides of normal assignment statements are really definable
variables was not being used to check whether the LHSs of pointer assignments
are modifiable, and so most cases of unmodifiable pointers are left
undiagnosed. Rework the semantics checking for pointer assignments,
NULLIFY statements, pointer dummy arguments, &c. so that cases of
unmodifiable pointers are properly caught. This has been done
by extracting all the various definability checking code that has
been implemented for different contexts in Fortran into one new
facility.
The new consolidated definability checking code returns messages
meant to be attached as "because: " explanations to context-dependent
errors like "left-hand side of assignment is not definable".
These new error message texts and their attached explanations
affect many existing tests, which have been updated. The testing
infrastructure was extended by another patch to properly compare
warnings and explanatory messages, which had been ignored until
recently.
Differential Revision: https://reviews.llvm.org/D136979
Jeff Niu [Thu, 27 Oct 2022 20:43:41 +0000 (13:43 -0700)]
[mlir][scf] Add scf-to-cf lowering for `scf.index_switch`
This patch adds lowering from `scf.index_switch` to `cf.switch.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D136883
Philip Reames [Mon, 31 Oct 2022 18:36:14 +0000 (11:36 -0700)]
[test] Refresh an autogened test to pickup naming change