wren romano [Tue, 18 Jul 2023 01:02:04 +0000 (18:02 -0700)]
[mlir][sparse] Renaming `CreationPolicy` to `Policy`
This change is mostly for brevity's sake; but it also paves the way for the `Policy` enum to be reuseable for other situations that require the same three-way semantics.
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D155532
Mark de Wever [Wed, 19 Jul 2023 18:56:51 +0000 (20:56 +0200)]
[libc++][print] Disables tests with msan.
These tests break with msan on the sanitizer-aarch64-linux-bootstrap-msan
builder. Note the x86_64 builder is not affected. To unbreak the CI
temporary disable the tests completely with msan.
The breakage was introduced by D150044.
Wael Yehia [Thu, 1 Jun 2023 19:56:07 +0000 (15:56 -0400)]
Define llvm::thread::DefaultStackSize to 4 megabytes on AIX
Link time thinLTO spawns pthreads to parallelize optimization and
codegen of the input bitcode files. On AIX, the default pthread
stack size limit is ~192k for 64-bit programs; insufficient for a
normal LLVM compilation.
Reviewed By: ZarkoCA, MaskRay
Differential Revision: https://reviews.llvm.org/D155731
Alexey Bataev [Wed, 19 Jul 2023 18:20:39 +0000 (11:20 -0700)]
[SLP]Fix a crash when trying to cast scalable vector type to fixed.
Need to check for FixedVectorType, not a vector type, since later
compiler performs unconditional cast to FixedVectorType and gets the
number of elements in this type.
Fangrui Song [Wed, 19 Jul 2023 18:37:42 +0000 (11:37 -0700)]
[ELF] --build-id=fast: switch to xxh3_64bits
Fangrui Song [Wed, 19 Jul 2023 18:28:47 +0000 (11:28 -0700)]
[ELF] splitNonStrings: switch to xxh3_64bits
This is primarily used for .rodata.cst* duplicate elimination. The
sections are usually much smaller than .debug_str (D154813), so the
speedup is negligible. We do this switch for consistency as we want to
eliminate xxh64 in lld.
Vy Nguyen [Mon, 17 Jul 2023 19:37:51 +0000 (15:37 -0400)]
[lld-macho]Use install_name as Identifier for code-sign, if available.
Detail:
LD64 uses the name provided via -[dylib]install_name as "Identifier", when available.
For compatiblity, LLD should do that too.
Differential Revision: https://reviews.llvm.org/D155508
Joseph Huber [Wed, 19 Jul 2023 17:32:19 +0000 (12:32 -0500)]
[OpenMP][Docs] Add some things to the OpenMP support
This patch adds some information that we have support for in the OpenMP
clang support page.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D155727
Fangrui Song [Wed, 19 Jul 2023 18:13:26 +0000 (11:13 -0700)]
[ELF][test] Refactor merge.s
Daniel Thornburgh [Tue, 18 Jul 2023 21:51:10 +0000 (14:51 -0700)]
[sanitizer-common] Run module msan init before early sigaction test
MSAN wrappers can be inserted for e.g. the access to stderr in the
constructor of the test, which can segfault if the constructor function
runs before these data structures have been initialized.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D155648
Simon Pilgrim [Wed, 19 Jul 2023 17:58:12 +0000 (18:58 +0100)]
[X86] matchBinaryShuffle - relax PACKSS for v2i64 -> v4i32 shuffle truncation pattern match.
Similar to combineVectorSignBitsTruncation, we don't require all-signbits source inputs, just enough signbits to reach into the lowest i16 to safely use PACKSSDW.
Momchil Velikov [Wed, 19 Jul 2023 17:31:25 +0000 (18:31 +0100)]
[CodeGenPrepare] Refactor optimizeSelectInst (NFC)
Refactor to use BasicBlockUtils functions and make life easier for
a subsequent patch for updating the dominator tree.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D154053
Simon Pilgrim [Wed, 19 Jul 2023 17:55:37 +0000 (18:55 +0100)]
Fix MSVC "'GetVMSetForLMul': not all control paths return a value" warning. NFC.
Jake Egan [Wed, 19 Jul 2023 17:50:33 +0000 (13:50 -0400)]
[InstrProf][NFC] Ignore -Wcast-qual after D153911 to fix build failure on AIX
/scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c:202:40: error: cast from 'const int (*)[0]' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
(void *)&dummy_name, (void *)&dummy_vnds};
^
1 error generated.
Mahesh Ravishankar [Wed, 19 Jul 2023 04:58:26 +0000 (04:58 +0000)]
[mlir][Linalg] Cleanup the drop unit dims pass in Linalg.
TL;DR the following API functions have been merged
```
void populateFoldUnitExtentDimsViaReshapesPatterns(RewritePatternSet &patterns);
void populateFoldUnitExtentDimsViaSlicesPatterns(RewritePatternSet &patterns);
```
into
```
void populateFoldUnitExtentDimsPatterns(RewritePatternSet &patterns,
ControlDropUnitDims &options);
```
To use the previous functionality use
```
ControlDropUnitDims options;
// By default options.rankReductionStrategy is
// ControlDropUnitDims::RankReductionStrategy::ReassociativeReshape.
populateFoldUnitExtentDimsPatterns(patterns, options);
```
and
```
ControlDropUnitDims options;
options.rankReductionStrategy = ControlDropUnitDims::RankReductionStrategy::ExtractInsertSlice
populateFoldUnitExtentDimsPatterns(patterns, options);
```
This pass is quite old and needed to be updated based on the current
approach to transformations in Linalg
- Instead of two patterns, one to just remove loop dimensions that are
unit extent (and using 0 in the indexing maps), and another to drop
the unit-extents in the operand shapes, combine into a single
transformation. This avoid creating an intermediate step with
indexing maps having 0's in the domains exp ressions.
- Expose the core transformation as a utility function and add a
pattern that calls this transformation.
This is a mostly NFC change, apart from the API change and dropping
the patterns/test that only dropped the loops that are unit extents.
Differential Revision: https://reviews.llvm.org/D155518
Wael Yehia [Wed, 19 Jul 2023 01:48:03 +0000 (21:48 -0400)]
[ThinLTO][AIX] Enable thinlto on AIX
Starting from AIX 7.2 TL5 SP6 and AIX 7.3 TL2 the system linker supports thinLTO.
Reviewed By: ZarkoCA, MaskRay
Differential Revision: https://reviews.llvm.org/D155700
Valentin Clement [Wed, 19 Jul 2023 17:30:42 +0000 (10:30 -0700)]
[mlir][openacc] Relax verifier for the acc.reduction.recipe
Allow the init and combiner regions to have more
arguments to pass information.
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D155656
Craig Topper [Wed, 19 Jul 2023 17:30:42 +0000 (10:30 -0700)]
[RISCV] Run mem2reg on the scalar C builtin tests to remove allocas and simplify checks. NFC
As requested on D155647.
Johannes Doerfert [Wed, 19 Jul 2023 17:11:29 +0000 (10:11 -0700)]
[AMDGPUAttributor][FIX] No endless recursion for recursive initializers
Fixes: https://github.com/llvm/llvm-project/issues/63956
Johannes Doerfert [Wed, 19 Jul 2023 17:13:03 +0000 (10:13 -0700)]
[Attributor][NFCI] Add a shortcut for constants
Johannes Doerfert [Wed, 19 Jul 2023 06:27:16 +0000 (23:27 -0700)]
[Attributor][NFCI] Avoid updating AAs that depend on missing callees
Momchil Velikov [Wed, 19 Jul 2023 16:27:56 +0000 (17:27 +0100)]
Refactor some BasicBlockUtils functions (NFC)
Add a more "flexible" `SplitBlockAndInsertIfThenElse` function
and re-implement some others on top of it.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D154052
Alex Voicu [Wed, 19 Jul 2023 17:04:31 +0000 (18:04 +0100)]
[Clang][CodeGen]`vtable`, `typeinfo` et al. are globals
All data structures and values associated with handling virtual functions / inheritance, as well as RTTI, are globals and thus can only reside in the global address space. This was not taken fully taken into account because for most targets, global & generic appear to coincide. However, on targets where global & generic ASes differ (e.g. AMDGPU), this was problematic, since it led to the generation of invalid bitcasts (which would trigger asserts in Debug) and less than optimal code. This patch does two things:
ensures that vtables, vptrs, vtts, typeinfo are generated in the right AS, and populated accordingly;
removes a bunch of bitcasts which look like left-overs from the typed ptr era.
Reviewed By: yxsamliu
Differential Revision: https://reviews.llvm.org/D153092
Craig Topper [Wed, 19 Jul 2023 17:03:57 +0000 (10:03 -0700)]
[RISCV] Upgrade Zvfh version to 1.0 and move out of experimental state.
This has been ratified according to https://wiki.riscv.org/display/HOME/Recently+Ratified+Extensions
Differential Revision: https://reviews.llvm.org/D155668
Fangrui Song [Wed, 19 Jul 2023 16:58:43 +0000 (09:58 -0700)]
[lld-macho] Switch to xxh3_64bits
xxh3 is substantially faster than xxh64.
For lld/ELF, there is substantial speedup in `.debug_str` duplicate
elimination (D154813). Use xxh3 for lld-macho as well.
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D155677
Fangrui Song [Wed, 19 Jul 2023 16:56:53 +0000 (09:56 -0700)]
[DWARFLinkerParallel] Switch to xxh3_64bits
xxh3 is substantially faster than xxh64.
For lld `.debug_str` there is substantial speedup (D154813).
@avl reports that it is around 1-2% improvement for different number of input sets and for different threads configuration.
Reviewed By: avl
Differential Revision: https://reviews.llvm.org/D155675
Joseph Huber [Wed, 19 Jul 2023 15:58:45 +0000 (10:58 -0500)]
[libc] Fix global constructor being emitted for the RPC client
The indirection here is for some reason causing an unnecessary
constructor. If we leave this uninitialized we will get the default
constructor which simply zero initliaizes the global. I've checked the
output and confirmed that it uses the `zeroinitializer` so this should
be safe.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D155720
Luke Lau [Wed, 12 Jul 2023 00:13:14 +0000 (01:13 +0100)]
[RISCV] Fold ops into vmv.v.v as vmerge with all-ones mask
A vmv.v.v shares the same encoding as a vmerge that isn't masked, so we can
also fold it into its operands if we treat it as a vmerge with an all-ones
mask. We take care here not to actually transform the existing vmv into a
vmerge, otherwise things like True.hasOneUse() become inaccurate. Instead this
just returns an equivalent list of operands.
This is an alternative to D153351.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D155101
Luke Lau [Tue, 11 Jul 2023 16:52:23 +0000 (17:52 +0100)]
[RISCV] Fold vmerge into its ops with smaller VL if known
Currently when folding vmerge into its operands, we stop if the VLs aren't
identical. However since the body of (vmerge (vop)) is the intersection of
vmerge and vop's bodies, we can use the smaller of the two VLs if we know it
ahead of time. This patch relaxes the constraint on VL if they are both
constants, or if either of them are VLMAX.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D155071
Luke Lau [Tue, 11 Jul 2023 12:14:50 +0000 (13:14 +0100)]
[RISCV] Add tests for merges with differing VLs that could be folded
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D155069
Razvan Lupusoru [Wed, 19 Jul 2023 16:08:35 +0000 (09:08 -0700)]
[nfc][openacc] Add missing comma in acc dialect operation macros
A comma is missing which is incorrect if macro is used.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D155722
Simon Pilgrim [Wed, 19 Jul 2023 16:02:03 +0000 (17:02 +0100)]
[SLP][X86] Regenerate some test checks to reduce diff in D154891
Simon Pilgrim [Wed, 19 Jul 2023 13:55:54 +0000 (14:55 +0100)]
[X86] matchBinaryShuffle - match PACKSS for v2i64 -> v4i32 all-signbits shuffle truncation patterns.
Ideally matchShuffleWithPACK should be able to handle this, but it needs a major rewrite to handle illegal types.
David Spickett [Wed, 19 Jul 2023 09:19:13 +0000 (09:19 +0000)]
[libunwind] Fix build error on 32 bit Arm after -Wcast-qual was added
New warning was added in https://reviews.llvm.org/D153911 which caused:
https://buildkite.com/llvm-project/libcxx-ci/builds/28407#
01896b79-2a5e-4554-ac31-
2abec5a8b281
../../libunwind/src/UnwindLevel1-gcc-ext.c:172:47: error: cast from 'const unsigned int *' to 'unsigned int *' drops const qualifier [-Werror,-Wcast-qual]
ex.pr_cache.ehtp = (_Unwind_EHT_Header *) unwindInfo;
I don't see any reason there should be a const here in the first place,
so just remove it.
Reviewed By: #libunwind, michaelplatings, MaskRay
Differential Revision: https://reviews.llvm.org/D155685
Valentin Clement [Wed, 19 Jul 2023 15:53:50 +0000 (08:53 -0700)]
[flang] Represent unknown extent correctly in getTypeAsString
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D155655
Nikita Popov [Wed, 19 Jul 2023 15:28:47 +0000 (17:28 +0200)]
[IR] Remove declaration of no longer existing constructor (NFC)
The definition was dropped in D155585, so drop the declaration
as well.
Thanks to Roman Divacky for pointing this out!
Ingo Müller [Tue, 18 Jul 2023 15:02:32 +0000 (15:02 +0000)]
[mlir][transform][gpu][python] Add .td file for bindings.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D155602
Fangrui Song [Wed, 19 Jul 2023 15:34:25 +0000 (08:34 -0700)]
[ELF] Use llvm::xxh3_64bits for MergeInputSection::splitStrings
See D154812 for the speedup.
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D154813
Piotr Fusik [Fri, 14 Jul 2023 16:30:41 +0000 (18:30 +0200)]
[libc++] Work around dynamic linking of stringbuf::str() on Windows
https://github.com/llvm/llvm-project/issues/40363 caused the C++20
`str() const &` and `str() &&` to be dllimport'ed despite _LIBCPP_HIDE_FROM_ABI.
This is a temporary solution until #40363 is fixed.
Reviewed By: #libc, hans, ldionne, Mordante
Differential Revision: https://reviews.llvm.org/D155185
Maksim Kita [Wed, 19 Jul 2023 15:07:40 +0000 (17:07 +0200)]
[AggressiveInstCombine] Fold strcmp for short string literals
Fold strcmp() against 1-char string literals.
This designates AggressiveInstCombine as the pass for libcalls
simplifications that may need to change the control flow graph.
Fixes https://github.com/llvm/llvm-project/issues/58003.
Differential Revision: https://reviews.llvm.org/D154725
Joseph Huber [Tue, 11 Jul 2023 19:14:08 +0000 (14:14 -0500)]
[libc] Add basic support for calling host functions from the GPU
This patch adds the `rpc_host_call` function as a GPU extension. This is
exported from the `libc` project to use the RPC interface to call a
function pointer via RPC any copying the arguments by-value. The
interface can only support a single void pointer argument much like
pthreads. The function call here is the bare-bones version of what's
required for OpenMP reverse offloading. Full support will require
interfacing with the mapping table, nowait support, etc.
I decided to test this interface in `libomptarget` as that will be the
primary consumer and it would be more difficult to make a test in `libc`
due to the testing infrastructure not really having a concept of the
"host" as it runs directly on the GPU as if it were a CPU target.
Reviewed By: jplehr
Differential Revision: https://reviews.llvm.org/D155003
Jakub Kuderski [Wed, 19 Jul 2023 15:01:07 +0000 (11:01 -0400)]
[mlir][spirv] Add cooperative matrix store op
Implement cooperative matrix store for the `SPV_KHR_cooperative_matrix`
extension: https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/KHR/SPV_KHR_cooperative_matrix.html.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D155631
Jakub Kuderski [Wed, 19 Jul 2023 14:55:25 +0000 (10:55 -0400)]
[mlir][spirv] Add cooperative matrix load op
Implement cooperative matrix load for the `SPV_KHR_cooperative_matrix`
extension: https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/KHR/SPV_KHR_cooperative_matrix.html.
Also some minor fixes in common code for custom parsing.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D155616
Razvan Lupusoru [Tue, 18 Jul 2023 20:39:51 +0000 (13:39 -0700)]
[openacc] Add attribute to hold declare data clause information
For variables in declare clauses, their producing operation should be
marked with the data clause for ease of lookup and consistency
verification. Thus add an attribute that can be used for this purpose
plus verification that declare data operation matches the declare
data clause on variable.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D155640
Maksim Kita [Wed, 19 Jul 2023 14:52:55 +0000 (16:52 +0200)]
[AggressiveInstCombine] Fold strcmp for short string literals tests (NFC)
Precommit tests for D154725.
Differential Revision: https://reviews.llvm.org/D155053
Markus Böck [Tue, 18 Jul 2023 12:30:00 +0000 (14:30 +0200)]
[mlir][flang] Convert TBAA metadata to an attribute representation
The current representation of TBAA is the very last in-tree user of the `llvm.metadata` operation.
Using ops to model metadata has a few disadvantages:
* Building a graph has to be done through some weakly typed indirection mechanism such as `SymbolRefAttr`
* Creating the metadata has to be done through a builder within a metadata op.
* It is not multithreading safe as operation insertion into the same block is not thread-safe
This patch therefore converts TBAA metadata into an attribute representation, in a similar manner as it has been done for alias groups and access groups in previous patches.
This additionally has the large benefit of giving us more "correctness by construction" as it makes things like cycles in a TBAA graph, or references to an incorrectly typed metadata node impossible.
Differential Revision: https://reviews.llvm.org/D155444
Ingo Müller [Wed, 19 Jul 2023 11:55:00 +0000 (11:55 +0000)]
[mlir][transform][linalg][python] Add mix-in for FuseIntoContainingOp.
The class did not have any mix-in until now. The new mix-in has two
overloads for the constructor of the class: one with all arguments and
one without the result types, which are defaulted to `AnyOpType`.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D155695
Kadir Cetinkaya [Wed, 19 Jul 2023 10:31:40 +0000 (12:31 +0200)]
Reland "[clangd] Always run preamble indexing on a separate thread"
This reverts commit
92c0546941190973e9201a08fa10edf27cb6992d.
Prevents tsan issues by resetting ref-counted-pointers eagerly, before
passing the copies into a new thread.
Ingo Müller [Wed, 19 Jul 2023 14:19:57 +0000 (14:19 +0000)]
[mlir][transform][linalg][python] Fix test for TileToForallOp mixin.
The test was introduced recently by https://reviews.llvm.org/D155090,
but https://reviews.llvm.org/D155567, which I worked on concurrently
affected the output of that test and the two patches were never tested
together.
Differential Revision: https://reviews.llvm.org/D155709
Martin Erhart [Wed, 19 Jul 2023 14:13:27 +0000 (14:13 +0000)]
[mlir][bufferization] Add lowering of bufferization.dealloc to memref.dealloc
Adds a generic lowering that suppors all cases of bufferization.dealloc
and one specialized, more efficient lowering for the simple case. Using
a helper function with for loops in the general case enables
O(|num_dealloc_memrefs|+|num_retain_memrefs|) size of the lowered code.
Depends on D155467
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D155468
Joseph Huber [Wed, 19 Jul 2023 14:25:34 +0000 (09:25 -0500)]
Revert "[libc] Treat the locks array as a bitfield"
Summary:
This caused test failures on the gfx90a buildbot. This works on my
gfx1030 and the Nvidia buildbots, so we'll need to investigate what is
going wrong here. For now revert it to get the bots green.
This reverts commit
05abcc579244b68162b847a6780d27b22bd58f74.
Djordje Todorovic [Wed, 19 Jul 2023 09:25:51 +0000 (11:25 +0200)]
[RISCV] Add DAG combine for CTTZ/CTLZ in the case of input 0
Within the AggressiveInstCombine Pass we have
an analysis/optimization that matches that
pattern of the Table Based CTZ. Some Targets do
not support/define ctz(0), but since the
AggressiveInstCombine is just an extension of
InstCombine, it should be a target-independent
canonicalization Pass, and therefore, we decided
to introduce several instructions, such as select
and compare that produce canonical IR, even if
the input is 0. The task for the Targets that do
support that input is to handle such a case and
to produce an optimal assembly.
This patch optimizes the CTTZ/CTLZ instructions
if the input is 0 by performing the`DAG combine`,
by generating the cttz(x) & 0x1f pattern (the
same goes for ctlz as well).
Differential Revision: https://reviews.llvm.org/D151449
Ingo Müller [Wed, 12 Jul 2023 10:38:24 +0000 (10:38 +0000)]
[mlir][transform][linalg][python] Add extended TileToForallOp.
This patch adds a mixin for TileToForallOp to
_structured_transform_ops_ext.py with syntactic sugar for construction
such ops. First, the types of the results are made optional and filled
with common default values if omitted. Second, for num_threads and
tile_sizes, the three possible forms (static, dynamic, or packed), can
now all be given through the same respective argument, which gets
dispatched to the correct form-specific argument automatically.
Reviewed By: nicolasvasilache, ftynse
Differential Revision: https://reviews.llvm.org/D155090
Jie Fu [Wed, 19 Jul 2023 13:59:53 +0000 (21:59 +0800)]
[clangd] Fix -Wunused-variable of 'FIDIt' (NFC)
/data/llvm-project/clang-tools-extra/clangd/index/SymbolCollector.cpp:878:16: error: unused variable 'FIDIt' [-Werror,-Wunused-variable]
const auto FIDIt = IncludeFiles.find(SID);
^
1 error generated.
Viktoriia Bakalova [Wed, 14 Jun 2023 12:21:08 +0000 (12:21 +0000)]
[clangd] Update symbol collector to use include-cleaner.
Differential Revision: https://reviews.llvm.org/D152900
David Truby [Thu, 6 Jul 2023 14:59:16 +0000 (15:59 +0100)]
[flang] Implement tand intrinsic
This implements the tand intrinsic by performing a multiplication
by pi/180 to the argument before calling tan inline.
This is a commonly provided extension that is used by OpenRadioss
Differential Revision: https://reviews.llvm.org/D154614
David Truby [Fri, 14 Jul 2023 16:02:44 +0000 (17:02 +0100)]
[flang] Use libm functions for complex operations by default
This patch changes the default lowering for complex operations to use
the more accurate libm operations as opposed to the mlir complex
operations. This is necessary due to precision issues in the mlir
complex dialect that cause failures in e.g. the LAPACK tests.
The mlir complex dialect lowering will still be used when
`-fapprox-func` is set (and by extension `-ffast-math` and `-Ofast`)
Differential Revision: https://reviews.llvm.org/D155310
Simon Pilgrim [Wed, 19 Jul 2023 13:32:25 +0000 (14:32 +0100)]
[X86] getFauxShuffleMask - add SIGN_EXTEND_VECTOR_INREG handling for all-signbits sources
Add suport for shuffle combines (via combineEXTEND_VECTOR_INREG) to begin from SIGN_EXTEND_VECTOR_INREG nodes
Paweł Bylica [Wed, 19 Jul 2023 11:55:19 +0000 (13:55 +0200)]
[InstCombine] Preserve metadata when combining select+binop
Fixes https://github.com/llvm/llvm-project/issues/63910
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D155461
Paweł Bylica [Wed, 19 Jul 2023 11:54:51 +0000 (13:54 +0200)]
[InstCombine][NFC] Add tests for preserving metadata
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D155594
Felipe de Azevedo Piovezan [Thu, 13 Jul 2023 13:12:01 +0000 (09:12 -0400)]
[lldb][NFC] Refactor test to enable subsequent reuse
On a subsequent commit, I intend to update the expression and call the evaluate
function more times. This refactors enables reusing some of the existing code
for that.
Differential Revision: https://reviews.llvm.org/D155197
Felipe de Azevedo Piovezan [Fri, 14 Jul 2023 17:34:27 +0000 (13:34 -0400)]
[lldb][NFC] Factor out CommandObject code filtering results based on scope
We will need this code in a subsequent commit.
Differential Revision: https://reviews.llvm.org/D155332
Simon Pilgrim [Wed, 19 Jul 2023 13:04:30 +0000 (14:04 +0100)]
[X86] Add test coverage for Issue #63946
Simon Pilgrim [Wed, 19 Jul 2023 12:55:11 +0000 (13:55 +0100)]
[X86] matchUnaryShuffle - match SIGN_EXTEND_VECTOR_INREG patterns for 'all-signbits' sources
Adapt the existing ANY/ZERO_EXTEND_VECTOR_INREG shuffle matching to also recognise SIGN_EXTEND_VECTOR_INREG patterns to handle cases where we're effectively "splatting" all-signbits sources.
John Brawn [Wed, 5 Jul 2023 15:21:51 +0000 (16:21 +0100)]
[ARM] Correctly handle execute-only in EmitStructByval
Currently when compiling for an execute-only target without movt then
EmitStructByval will generate a constant pool load which isn't
compatible with execute-only. Handle this by emitting tMOVi32imm,
and also simplify the existing movt handling by emitting t2MOVi32imm
or MOVi32imm.
Differential Revision: https://reviews.llvm.org/D154944
John Brawn [Thu, 6 Jul 2023 09:43:40 +0000 (10:43 +0100)]
[ARM] Restructure MOVi32imm expansion to not do pointless instructions
The expansion of the various MOVi32imm pseudo-instructions works by
splitting the operand into components (either halfwords or bytes) and
emitting instructions to combine those components into the final
result. When the operand is an immediate with some components being
zero this can result in pointless instructions that just add zero.
Avoid this by restructuring things so that a separate function handles
splitting the operand into components, then don't emit the component
if it is a zero immediate. This is straightforward for movw/movt,
where we just don't emit the movt if it's zero, but the thumb1
expansion using mov/add/lsl is more complex, as even when we don't
emit a given byte we still need to get the shift correct.
Differential Revision: https://reviews.llvm.org/D154943
Ties Stuij [Wed, 19 Jul 2023 10:26:01 +0000 (11:26 +0100)]
[ARM] don't emit constant pool for Thumb1 XO/stack guard combo
Currently for armv6-m and armv8-m.baseline, we emit constant pool code when we
use execute-only (XO) in combination with stack guards.
XO is a new feature for armv6-m, and this patch is part of a series of patches
that substitutes constant pool generation with the tMOVi32imm equivalent.
However XO for armv8-m.baseline has been available for about 6 years, and so
for armv8-m.baseline this is a bugfix.
Reviewed By: simonwallis2, olista01
Differential Revision: https://reviews.llvm.org/D155170
Kelvin Li [Tue, 18 Jul 2023 14:40:39 +0000 (10:40 -0400)]
[flang] Simplify macros for the vec_sld and vec_sldw intrinsics
The ignore_tkr directive is applied to the third argument so that the number of
interfaces can be reduced.
Differential Revision: https://reviews.llvm.org/D155624
Carlos Galvez [Mon, 17 Jul 2023 19:54:23 +0000 (19:54 +0000)]
[clang-tidy] Warn only for copyable/movable classes in cppcoreguidelines-avoid-const-or-ref-members
Since that's what the guidelines require.
Fixes #63733
Differential Revision: https://reviews.llvm.org/D155625
Piyou Chen [Wed, 19 Jul 2023 08:58:02 +0000 (01:58 -0700)]
[RISCV] Replace zihintntl with zicond in ISAInfo unittest
Some ISAInfo unittest base on experimental-zihintntl, but zihintntl will become none-experimental. This patch use another experimental extension zicond to replace zihintntl.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D155673
pvanhout [Tue, 11 Jul 2023 10:22:57 +0000 (12:22 +0200)]
[TableGen] Deprecate old GI Combiner Emitter
Will be removed in a month or so.
Reviewed By: aemerson
Differential Revision: https://reviews.llvm.org/D154939
Igor Kirillov [Mon, 26 Jun 2023 17:26:43 +0000 (17:26 +0000)]
[CodeGen] Extend ComplexDeinterleaving pass to recognise patterns using integer types
AArch64 introduced CMLA and CADD instructions as part of SVE2. This
change allows to generate such instructions when this architecture
feature is available.
Differential Revision: https://reviews.llvm.org/D153808
Simon Pilgrim [Wed, 19 Jul 2023 10:56:14 +0000 (11:56 +0100)]
[DAG] hoistLogicOpWithSameOpcodeHands - add support for SIGN_EXTEND_INREG nodes.
This can reuse the existing *_EXTEND node handling (with special handling for the valuetype arg)
Ivan Kosarev [Wed, 19 Jul 2023 10:34:25 +0000 (11:34 +0100)]
[AMDGPU] Combine the SDAG and GISel versions of the fmed3.ll test.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D155590
Ivan Kosarev [Wed, 19 Jul 2023 10:00:13 +0000 (11:00 +0100)]
[AMDGPU][AsmParser][NFC] Translate parsed DS instructions to MCInsts automatically.
Part of <https://github.com/llvm/llvm-project/issues/62629>.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D155620
Jie Fu [Wed, 19 Jul 2023 09:50:11 +0000 (17:50 +0800)]
[InstrProf] Ignore -Wcast-qual after D153911 to fix build failure (NFC)
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:46:60: error: cast from 'const char *' to 'struct __llvm_profile_header *' drops const qualifier [-Werror,-Wcast-qual]
__llvm_profile_header *Header = (__llvm_profile_header *)ProfileData;
^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:49:30: error: cast from 'const char *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
(__llvm_profile_data *)(ProfileData + sizeof(__llvm_profile_header) +
^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:77:41: error: cast from 'const struct __llvm_profile_data *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
DstData = (__llvm_profile_data *)__llvm_profile_begin_data();
^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:109:60: error: cast from 'const char *' to 'struct __llvm_profile_header *' drops const qualifier [-Werror,-Wcast-qual]
__llvm_profile_header *Header = (__llvm_profile_header *)ProfileData;
^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:116:30: error: cast from 'const char *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
(__llvm_profile_data *)(ProfileData + sizeof(__llvm_profile_header) +
^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:129:40: error: cast from 'const struct __llvm_profile_data *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
DstData = (__llvm_profile_data *)__llvm_profile_begin_data(),
^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:179:34: error: cast from 'const char *' to 'struct ValueProfData *' drops const qualifier [-Werror,-Wcast-qual]
VPMergeHook((ValueProfData *)SrcValueProfData, DstData);
^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:181:46: error: cast from 'const char *' to 'struct ValueProfData *' drops const qualifier [-Werror,-Wcast-qual]
SrcValueProfData + ((ValueProfData *)SrcValueProfData)->TotalSize;
^
...
Simon Pilgrim [Wed, 19 Jul 2023 09:50:07 +0000 (10:50 +0100)]
[DAG] hoistLogicOpWithSameOpcodeHands - add support for *_EXTEND_VECTOR_INREG nodes.
This can reuse the existing *_EXTEND node handling.
Mikhail Goncharov [Wed, 19 Jul 2023 09:21:42 +0000 (11:21 +0200)]
[bazel] remove PythonAttr TD after
67a910bbff772ebf4c47e8b434b59cdc4820bb68
Differential Revision: https://reviews.llvm.org/D155686
Guray Ozen [Wed, 19 Jul 2023 08:29:41 +0000 (10:29 +0200)]
[mlir][nvvm] Introduce Syncronization Ops for WGMMA
This work introduces : `wgmma.fence.aligned`, `wgmma.commit.group.sync.aligned` and `wgmma.wait.group.sync.aligned` Ops. They are used to syncronize warpgroup level matrix multiply-accumulate instructions, as known as WGMMA.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D155676
Jay Foad [Wed, 19 Jul 2023 07:29:14 +0000 (08:29 +0100)]
[AMDGPU] Insert s_nop before s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
Differential Revision: https://reviews.llvm.org/D155681
Jay Foad [Mon, 17 Jul 2023 15:20:32 +0000 (16:20 +0100)]
[ARM] Add a regression test for D154281
This is a reduced version of one of the tests that was broken by the
original commit of D154281 "[CodeGen] Store SP adjustment in
MachineBasicBlock. NFCI.".
Differential Revision: https://reviews.llvm.org/D155471
Jingu Kang [Wed, 19 Jul 2023 09:30:30 +0000 (10:30 +0100)]
Revert "[MachineLICM] Handle Subloops"
This reverts commit
33e60484d750291e99301e29e60fe72c8fa48ccd.
Shivam Gupta [Wed, 19 Jul 2023 09:19:43 +0000 (14:49 +0530)]
[clang][Docs] Added release note for D142609
Nuno Lopes [Wed, 19 Jul 2023 09:24:41 +0000 (10:24 +0100)]
[VectorCombine] Use poison insteaf of undef as placeholder [NFC]
These vector lanes are never accessed. They are used for shifting a value into the right lane
and therefore only 1 value of the whole vector is actually used
khei4 [Tue, 18 Jul 2023 09:58:20 +0000 (18:58 +0900)]
Reapply: [MemCpyOpt] implement single BB stack-move optimization which unify the static unescaped allocas
This reverts commit
8f3864ba4323a253bcf29825d23cd325b52c4106.
Differential Revision: https://reviews.llvm.org/D153453
khei4 [Tue, 18 Jul 2023 09:55:26 +0000 (18:55 +0900)]
[MemCpyOpt] add terminator user test for D153453(NFC)
Differential Revision: https://reviews.llvm.org/D155571
Ingo Müller [Tue, 18 Jul 2023 09:07:17 +0000 (09:07 +0000)]
[mlir][linalg][transform][python] Add type arg to MatchOp extension.
The extension class to MatchOp has a class method called match_op_names.
The previous version of that function did not allow to specify the
result type. This, however, may be useful/necessary if the op consuming
the resulting handle requires a particular type (such as the
bufferization.EmptyTensorToAllocTensorOp). This patch adds an overload
to match_op_names that allows to specify the result type.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D155567
Simon Pilgrim [Wed, 19 Jul 2023 09:10:15 +0000 (10:10 +0100)]
[X86] LowerEXTEND_VECTOR_INREG - add sign_extend_vector_inreg fast path for all-signbits source values
If the source operand is already all-signbits we don't need to create the sign extended elements - just splat the source element to the destination element width
Oleg Shyshkov [Wed, 19 Jul 2023 09:10:53 +0000 (11:10 +0200)]
[mlir][bazel] Fix build.
Guillaume Chatelet [Tue, 18 Jul 2023 15:29:42 +0000 (15:29 +0000)]
[libc][NFC] Rename files
This patch mostly renames files so it better reflects the function they declare.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D155607
David Spickett [Wed, 19 Jul 2023 09:04:13 +0000 (09:04 +0000)]
[lldb] XFAIL command-disassemble-mixed.c on Windows
Either clang-cl has different assembly output or we're not mapping
source to assembly properly on Windows. We (Linaro) will find out which.
https://lab.llvm.org/buildbot/#/builders/219/builds/4195
Chuanqi Xu [Wed, 19 Jul 2023 08:50:26 +0000 (16:50 +0800)]
[NFC] Adjust test for pr63595
The original test case is not strictly correct but our ODR checking
system doesn't find it.
Kadir Cetinkaya [Wed, 19 Jul 2023 08:45:06 +0000 (10:45 +0200)]
Revert "[clangd] Remove unused private field 'Opts' in UpdateIndexCallbacks (NFC)"
This reverts commit
c4fa97fca7e92c736fcb09779c84b42c25ffae70.
Guillaume Chatelet [Tue, 18 Jul 2023 16:32:04 +0000 (16:32 +0000)]
[libc][memfunctions] Explicit error when platform in not supported
Reviewed By: JonChesterfield, jhuber6
Differential Revision: https://reviews.llvm.org/D155597
Nikita Popov [Mon, 26 Jun 2023 13:33:09 +0000 (15:33 +0200)]
[LoopPeel] Clear dispositions after peeling
Block dispositions of values defined inside the loop may change
during peeling, so clear them. We already do this for other kinds
of unrolling.
Differential Revision: https://reviews.llvm.org/D153762
Kadir Cetinkaya [Wed, 19 Jul 2023 07:14:23 +0000 (09:14 +0200)]
Revert "[clangd] Always run preamble indexing on a separate thread"
This reverts commit
036a1b2202cb71aacfa72ef15145a88dc50a02cf.
Triggering failures under tsan, https://lab.llvm.org/buildbot/#/builders/131/builds/48349
Simi Pallipurath [Fri, 30 Jun 2023 10:48:47 +0000 (11:48 +0100)]
[Clang][Driver] Pass through the --be8 endian flag to linker in BareMetal driver For Arm.
When linking a big-endian image for Arm, clang has
to select between BE8 and BE32 formats. The default
is dependent on the selected target architecture.
For ARMv6 and later architectures the default is
BE8, for older architectures the default is BE32.
For BE8 and BE32, compiler outputs a big endian ELF
relocatable object file with the instructions and
data both big endian. The difference is that at
link time, for BE8 a linker must endian reverse
the instructions to little endian. For BE8, the
clang has to pass --be8 to the linker for Arm.
At the moment clang is not passing the --be8 flag
to linker for the baremetal target architectures
above ArmV6 for Arm. This patch passes through --be8
and -BE or EL to the linker, taking into account the
target and the -mbig-endian and -mlittle-endian flag.
Also there are few more changes in the baremetal
driver so that the code can cope with AArch64 being
big-endian as well.
Reviewed By: michaelplatings, MaskRay
Differential Revision: https://reviews.llvm.org/D154786
Viktoriia Bakalova [Tue, 18 Jul 2023 15:48:24 +0000 (15:48 +0000)]
[clangd] Make an include always refer to itself. Background: clang-review expects all referents to have definition, declaration or reference(s).
Differential Revision: https://reviews.llvm.org/D155614
Jay Foad [Wed, 19 Jul 2023 08:20:08 +0000 (09:20 +0100)]
[AMDGPU] Regenerate is.fpclass checks
Martin Storsjö [Sun, 16 Jul 2023 21:35:04 +0000 (00:35 +0300)]
[libcxx] Link to fewer MSVC CRT libraries
The library msvcrt.lib pulls in ucrt.lib and vcruntime.lib anyway,
there's no need to manually link against the individual dependencies.
This matches how the tests link against libraries - they only link
against msvcrt and msvcprt, not directly against ucrt and vcruntime.
Differential Revision: https://reviews.llvm.org/D155555