Commit Graph

499056 Commits

Author SHA1 Message Date
Valentin Clement (バレンタイン クレメン)
45daa4fdc6 [flang][cuda] Move CUDA Fortran operations to a CUF dialect (#92317)
The number of operations dedicated to CUF grew and where all still in
FIR. In order to have a better organization, the CUF operations,
attributes and code is moved into their specific dialect and files. CUF
dialect is tightly coupled with HLFIR/FIR and their types.

The CUF attributes are bundled into their own library since some
HLFIR/FIR operations depend on them and the CUF dialect depends on the
FIR types. Without having the attributes into a separate library there
would be a dependency cycle.
2024-05-17 09:37:53 -07:00
Walter Erquinigo
d90159add4 [LSP] Use std::string for storing the Reply method (#92464)
This was using a StringRef, which is very unsafe because the method name
might just get disposed due to the async nature of the response.
This was causing weird characters being printed in the output logs.
2024-05-17 12:32:59 -04:00
Dmitry Vasilyev
d38ea8c4c8 [lldb] Fixed the test TestGdbRemoteAttachWait running on a remote target (#92413)
Install `_exe_to_attach` to a remote target if necessary.
2024-05-17 20:14:09 +04:00
Benjamin Maxwell
e01ff8238c [mlir][vector] Fix scalability issues in drop innermost unit dims transfer patterns (#92402)
Previously, these rewrites would drop scalable dimensions and treated
`[1]` (scalable one dim) as a unit dimension. This patch propagates
scalable dimensions and ensures `[1]` is not treated as a unit
dimension.
2024-05-17 17:13:59 +01:00
Vlad Serebrennikov
8aa6511f42 [clang][NFC] Remove an unnecessary const_cast 2024-05-17 19:10:34 +03:00
Mital Ashok
621d0f3e86 [Clang][Sema] Fix last argument not being used when comparing function template specializations when one has an explicit object argument (#92263)
Fixes #92188
2024-05-17 18:00:43 +02:00
Christian Ulmann
9e39a0c723 [MLIR][ArmSME] Fix for block sorting refactor
This commit fixes a breakage introduced by changing the name of the
block sorting function.

Related PR: https://github.com/llvm/llvm-project/pull/92558
2024-05-17 15:59:04 +00:00
Christian Ulmann
e919df5777 [MLIR][Transforms] Correct block sorting utils name (NFC) (#92558)
This commit renames the name of the block sorting utility function to
`getBlocksSortedByDominance`. A topological order is not defined on a
general directed graph, so the previous name did not make sense.
2024-05-17 17:36:09 +02:00
Vlad Serebrennikov
84aee95124 [clang][NFC] Remove const_cast from Preprocessor::addModuleMacro() 2024-05-17 18:11:49 +03:00
Kelvin Li
c0cdc1d956 [flang] Allow flexible producer name in #di_compile_unit (NFC) (#92462) 2024-05-17 10:49:20 -04:00
Kazu Hirata
9b6f0735fb [Support] Drop nop conversions of StringRef to StringRef (NFC)
Both sides here are known to be of StringRef.
2024-05-17 07:30:58 -07:00
maxbartel
9ba0a77256 [mlir][spirv] Add support for dense_resource in arith to spirv (#91318)
This adds support for `dense_resource` in arith to spirv. 

Note that this inlines the blob into the IR. Another possibility would
be to add proper dense_resource support to spirv, but there is a lot of
special handling going on to convert a `DenseElementsAttr` to the
correct SPIRV type. Some of that even iterates over all the values in
the Attribute. For proper support of a `DenseResourceElementsAttr` this
probably needs a redesign. I would like to hear some opinions on that!

The test is disabled on non little Endian machines. See
https://github.com/llvm/llvm-project/issues/63469 for more information.
2024-05-17 10:29:48 -04:00
Vlad Serebrennikov
30d0850e0f [clang][NFC] Improve const-correctness in ParseLexedMethodDeclaration 2024-05-17 17:15:44 +03:00
Chris B
8c5e487ee3 [HLSL][CMake] Add clangd and distribution settings (#92011)
This just adds some simple distribution settings and includes clangd in
the build for distribution.
2024-05-17 09:10:27 -05:00
Joseph Huber
c4017cda00 [Offload][NFC] Remove header license in CMake files (#92544)
Summary:
No other project has these in the CMake itself, and they're wildly
inconsistent even within the project. These don't really add anything so
I think they should be removed.
2024-05-17 09:05:03 -05:00
Simon Pilgrim
fa9881d6a9 [X86] vector-bitreverse.ll - add AVX512BW+AVX512VL test coverage 2024-05-17 15:04:22 +01:00
Momchil Velikov
a0cc1ab978 [AArch64] Add intrinsics for multi-vector to ZA array vector accumulators (#91606)
[Recommit of e88ba6d975]

According to the specification in
https://github.com/ARM-software/acle/pull/309 this adds the intrinsics

void_svadd_za16_vg1x2_f16(uint32_t slice, svfloat16x2_t zn)
__arm_streaming __arm_inout("za");
void_svadd_za16_vg1x4_f16(uint32_t slice, svfloat16x4_t zn)
__arm_streaming __arm_inout("za");
void_svsub_za16_vg1x2_f16(uint32_t slice, svfloat16x2_t zn)
__arm_streaming __arm_inout("za");
void_svsub_za16_vg1x4_f16(uint32_t slice, svfloat16x4_t zn)
__arm_streaming __arm_inout("za");

as well as the corresponding `bf16` variants.
2024-05-17 15:02:53 +01:00
Vlad Serebrennikov
6677aef285 [clang][NFC] Remove const-qualification from FunctionTemplateSpecializationInfo::TemplateArguments (#92500)
This patch remove const-qualification from pointee type of
`FunctionTemplateSpecializationInfo::TemplateArguments`, because it's
(eventually) used to initialize `MultiLevelTemplateArgumentList`, which
can actually mutate the arguments via

f42f57b52d/clang/include/clang/Sema/Template.h (L197-L204)
Mutation seems to be required to correctly handle packs:

9144553207/clang/lib/Sema/SemaTemplateInstantiate.cpp (L1440-L1469)
2024-05-17 17:49:50 +04:00
Tom Stellard
89b83d2d3f [git] Add hashes to requirements.txt for extra security (#92305)
https://pip.pypa.io/en/stable/topics/secure-installs/
2024-05-17 06:49:27 -07:00
Vlad Serebrennikov
d3d5a30021 [clang][NFC] Remove const_cast from ParseClassSpecifier 2024-05-17 16:41:20 +03:00
Sergio Afonso
502ccd81c6 [MLIR][OpenMP] NFC: Remove redundant check (#91594)
The check removed by this patch in the OpenMP to LLVM IR translation
pass already exists as part of the op verifier for `omp.loop_nest`.
2024-05-17 14:33:10 +01:00
Sergio Afonso
a43d2f686a [Flang][OpenMP] NFC: Fix typo in include guard (#91593) 2024-05-17 14:32:17 +01:00
Sergio Afonso
b1161b2a40 [Flang][OpenMP] Fix semantics check for nested DISTRIBUTE (#91592)
Composite OpenMP constructs where DISTRIBUTE is the first leaf
construct, as well as standalone DISTRIBUTE constructs, are allowed
inside of TEAMS regions.

Before this patch, nesting a DISTRIBUTE construct inside of a combined
TARGET TEAMS construct was disallowed, which it shouldn't be. Now both
TEAMS and TARGET TEAMS constructs can be immediate parents of DISTRIBUTE
constructs.
2024-05-17 14:31:16 +01:00
Youngsuk Kim
f39af73f3e [clang][Sema] Warn consecutive builtin comparisons in an expression (#92200)
Add warning under `-Wparentheses` for consistency with `gcc 14.1`.

Closes #20456

---------

Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
2024-05-17 09:29:20 -04:00
Sander de Smalen
9917f3ce64 [Clang][AArch64] Require SVE or SSVE for scalable types. (#91356)
Scalable types are only available when:
* The function is compiled with +sve
* The function is compiled with +sme and the function is executed in
Streaming-SVE mode.
2024-05-17 14:21:56 +01:00
Romaric Jodin
932ca85680 libclc: remove __attribute__((assume)) for clspv targets (#92126)
Instead add a proper attribute in clang, and add convert it to function
metadata to keep the information in the IR. The goal is to remove the
dependency on __attribute__((assume)) that should have not be there in
the first place.

Ref https://github.com/llvm/llvm-project/pull/84934
2024-05-17 06:13:32 -07:00
Sander de Smalen
3a32590f25 [AArch64] Avoid using NEON FCVTXN in Streaming-SVE mode. (#91981) 2024-05-17 14:11:28 +01:00
Matt Arsenault
f5c8242042 SimplifyLibCalls: Prefer to emit intrinsic in pow(2, x) -> ldexp(1, x) (#92363) 2024-05-17 14:28:03 +02:00
Aaron Ballman
371eccd5df [clang-query] Remove support for srcloc output (#92442)
This functionality was added about three years ago, but has been in a
significantly broken state since it was added. It has begun to cause a
maintenance burden for work in Clang (largely due to the complexity of
having two levels of code generation involved), and the original author
is unable to help maintain it. Because it only worked under limited
circumstances and because of the maintenance burden, it is being
removed. If someone wishes to resurrect the functionality, they should
hopefully be able to do so from this one commit.

Fixes #82591
2024-05-17 08:06:46 -04:00
Vlad Serebrennikov
a68d20e986 [clang] Implement CWG2428 "Deprecating a concept" (#92295)
This patch allows attributes to be attached to C++20 concepts,
implementing
[CWG2428](https://cplusplus.github.io/CWG/issues/2428.html).
2024-05-17 16:02:44 +04:00
David Sherwood
0ad275c158 [InstCombine] Fold vector.reduce.op(vector.reverse(X)) -> vector.reduce.op(X) (#91743)
For all of the following reductions:

vector.reduce.or
vector.reduce.and
vector.reduce.xor
vector.reduce.add
vector.reduce.mul
vector.reduce.umin
vector.reduce.umax
vector.reduce.smin
vector.reduce.smax
vector.reduce.fmin
vector.reduce.fmax

if the input operand is the result of a vector.reverse then we can
perform a reduction on the vector.reverse input instead since the answer
is the same. If the reassociation is permitted we can also do the same
folds for these:

vector.reduce.fadd
vector.reduce.fmul
2024-05-17 12:58:14 +01:00
Shengchen Kan
98deedae92 [X86][CodeGen] Use switch-case for transform in X86DAGToDAGISel::PostprocessISelDAG, NFCI
This is to simplify code for #91747
2024-05-17 19:47:20 +08:00
Matthias Springer
a2590e0c14 [mlir][Transforms] Make 1:N function conversion pattern interface-based (#92395)
This commit turns the 1:N dialect conversion pattern for function
signatures into a pattern for `FunctionOpInterface`. This is similar to
the interface-based pattern that is provided with the 1:1 dialect
conversion (`populateFunctionOpInterfaceTypeConversionPattern`). No
change in functionality apart from supporting all `FunctionOpInterface`
ops and not just `func::FuncOp`.
2024-05-17 13:44:00 +02:00
Andi Drebes
d1cff36e5e [MLIR][analysis] Lattice: Fix automatic delegation of meet to lattice value classes (#82620)
The class `Lattice` should automatically delegate invocations of the
meet operator to the meet operation of the associated lattice value
class if that class provides a static function called `meet`. This
process fails for two reasons:

1. `Lattice::has_meet` checks for a member function `meet` without
arguments of the lattice value class, although it should check for a
static member function.

2. The function template `Lattice::meet<VT>()` implementing the default
meet operation directly in the lattice is always present and takes
precedence over the delegating function template `Lattice::meet<VT,
std::integral_constant<bool, true>>()`.

This change fixes the automatic delegation of the meet operation of a
lattice to the lattice value class in the presence of a static `meet`
function by conditionally enabling either the delegating function
template or the non-delegating function template and by changing
`Lattice::has_meet` so that it checks for a static `meet` member
function in the lattice value type.

The test from `TestSparseBackwardDataFlowAnalysis.cpp` is changed, such
that the `meet` function is not provided directly in the `WrittenTo`
lattice, but by the `Lattice` base class in order to trigger delegation
to a lattice value class.
2024-05-17 13:41:30 +02:00
Jay Foad
ac092925c3 [SelectionDAG] Widen cttz to cttz_zero_undef (#92514)
Instead of widening e.g. i8 cttz(x) to i16 cttz(x | 0x100), use the more
optimizable form cttz_zero_undef(x | 0x100) since the widened operand is
definitely not zero.
2024-05-17 12:39:40 +01:00
Florian Hahn
1e7d047c71 [VPlan] Mark LoopInfo preserved in native-path as well (NFC).
LoopInfo is updated during VPlan execution now, so it will also be
updated correctly in the native path.
2024-05-17 12:18:01 +01:00
Matt Arsenault
ddb87e0f96 SystemZ: Use REG_SEQUENCE for PAIR128 (#90640)
PAIR128 should probably just be removed entirely

Depends #90638
2024-05-17 13:16:34 +02:00
Donát Nagy
58bad2862c [analyzer][NFC] Require explicit matching mode for CallDescriptions (#92454)
This commit deletes the "simple" constructor of `CallDescription` which
did not require a `CallDescription::Mode` argument and always used the
"wildcard" mode `CDM::Unspecified`.

A few months ago, this vague matching mode was used by many checkers,
which caused bugs like https://github.com/llvm/llvm-project/issues/81597
and https://github.com/llvm/llvm-project/issues/88181. Since then, my
commits improved the available matching modes and ensured that all
checkers explicitly specify the right matching mode.

After those commits, the only remaining references to the "simple"
constructor were some unit tests; this commit updates them to use an
explicitly specified matching mode (often `CDM::SimpleFunc`).

The mode `CDM::Unspecified` was not deleted in this commit because it's
still a reasonable choice in `GenericTaintChecker` and a few unit tests.
2024-05-17 13:08:45 +02:00
Paul Walker
37c6b9ff72 [NFC][LLVM] Mainly whitespace changes.
Also marks AliasSetTracker::size() as const.
2024-05-17 10:37:26 +00:00
David Green
4349ffb3fa [SelectOpt] Add tests for not select conditions. NFC 2024-05-17 11:34:01 +01:00
Ivan Kosarev
bbe40b9e0a [MCAsmStreamer] Do not crash on switching to sections of unknown types (#92380)
MCObjectStreamer already accepts unknown types.
2024-05-17 11:20:33 +01:00
Benjamin Maxwell
c93b45aaee [mlir][ArmSME] Reword in-memory tile warning (NFC) (#92415)
It did not make sense that this said "all tile operations will go
through memory". Only the operations where the warning is emitted will
go through memory. The message has been updated to reflect that.
2024-05-17 11:20:11 +01:00
Johannes Reifferscheid
698cf0176b Fix i1 array global crash in NVPTXAsmPrinter. (#92506)
See the test file. At head, this crashes with

```
assertion failed at llvm/lib/Support/APInt.cpp:492 in
uint64_t llvm::APInt::extractBitsAsZExtValue(unsigned int, unsigned int) const:
  bitPosition < BitWidth && (numBits + bitPosition) <= BitWidth &&
  "Illegal bit extraction"
```
2024-05-17 12:06:35 +02:00
Shan Huang
d0e2808f80 [DebugInfo][LoopLoadElim] Fix missing debug location updates (#91839) 2024-05-17 10:56:05 +01:00
Tom Eccles
7c16e7d9cd [flang][NFC] Use tablegen to reduce AddAliasTags boilerplate (#92373)
I will make this pass run properly on more top-level operations in a
follow up patch.
2024-05-17 10:53:29 +01:00
Vyacheslav Levytskyy
e3e06135eb [SPIR-V] Ensure that we don't have a dangling BlockAddress constants after internal intrinsic 'spv_switch' is processed (#92390)
After internal intrinsic 'spv_switch' is processed we need to delete
G_BLOCK_ADDR instructions that were generated to keep track of the
corresponding basic blocks. If we just delete G_BLOCK_ADDR instructions
with BlockAddress operands, this leaves their BasicBlock counterparts in
a "address taken" status. This would make AsmPrinter to generate a
series of unneeded labels of a `"Address of block that was removed by
CodeGen"` kind. This PR is to ensure that we don't have a dangling
BlockAddress constants by zapping the BlockAddress nodes, and only after
that proceed with erasing G_BLOCK_ADDR instructions.

See also https://github.com/llvm/llvm-project/pull/87823 for more
details.
2024-05-17 11:43:02 +02:00
Vyacheslav Levytskyy
2ed8ff3bf8 [SPIR-V] Fix types of internal intrinsic functions and add a test case for __builtin_alloca() (#92265)
This PR generation of argument types of internal intrinsic functions
`spv_const_composite` and `spv_track_constant`, so that composite
constants of ConstantVector type preserve their correct type in
transformation passes and can be successfully used further by LLVM
intrinsic functions.

The added test case serves two purposes: it is to check the above
mentioned fix and to demonstrate that a call to __builtin_alloca() maps
to instructions from SPV_INTEL_variable_length_array when this extension
is available.
2024-05-17 11:42:37 +02:00
Ramkumar Ramachandra
b6fa78d54c [LAA] refactor sortPtrAccesses (NFC) (#92256)
Use the destructuring syntax in C++ and llvm::enumerate to make
sortPtrAccesses a little more readable.
2024-05-17 10:41:41 +01:00
Daniel Grumberg
7a67479392 [clang][ExtractAPI] Correctly generate declaration fragments for non-type template parameters (#91958)
Previously we only generated declaration fragments for template type
parameters/arguments, this adds supports for most other possible
template parameters/arguments.

rdar://127732598
2024-05-17 10:33:31 +01:00
Pavel Labath
33bf08ec36 [lldb-dap] Correctly detect alias commands with arguments in repl (#92137)
ResolveCommand will not succeed for an alias command with arguments, and
the code wasn't providing any. Replace that with explicit query(ies) for
the existence of a command with the given name.
2024-05-17 11:24:20 +02:00