Revision tags: llvmorg-21-init |
|
#
87103a01 |
| 27-Jan-2025 |
Momchil Velikov <momchil.velikov@arm.com> |
[AArch64] Implement NEON FP8 vectors as VectorType (#123603)
Reimplement Neon FP8 vector types using attribute `neon_vector_type`
instead of having them as builtin types.
This allows to implement
[AArch64] Implement NEON FP8 vectors as VectorType (#123603)
Reimplement Neon FP8 vector types using attribute `neon_vector_type`
instead of having them as builtin types.
This allows to implement FP8 Neon intrinsics without the need to add
special cases for these types when using `__builtin_shufflevector`
or bitcast (using C-style cast operator) between vectors, both
extensively used in the generated code in `arm_neon.h`.
show more ...
|
Revision tags: llvmorg-19.1.7 |
|
#
41a94de7 |
| 13-Jan-2025 |
Maksim Ivanov <emaxx@google.com> |
[clang] Refactor attr diagnostics to use %select (#122473)
A cleanup follow-up to #118501 and #118567.
|
#
b4ce29ab |
| 12-Jan-2025 |
Sander de Smalen <sander.desmalen@arm.com> |
[AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (#121788)
This adds support for parsing the attribute and codegen to map it to
"aarch64_za_state_agnostic" LLVM IR attribute.
This
[AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (#121788)
This adds support for parsing the attribute and codegen to map it to
"aarch64_za_state_agnostic" LLVM IR attribute.
This attribute is described in the Arm C Language Extensions (ACLE)
document:
https://github.com/ARM-software/acle/blob/main/main/acle.md#__arm_agnostic
show more ...
|
#
4f69f457 |
| 10-Jan-2025 |
Maksim Ivanov <emaxx@google.com> |
(reland) [clang] Warn [[clang::lifetimebound]] misusages on types (#118501)
This relands #118281 as-is, after it got reverted in commit
356df2dd72e8299b5de58e9390283110c19f7c76. The reland can go i
(reland) [clang] Warn [[clang::lifetimebound]] misusages on types (#118501)
This relands #118281 as-is, after it got reverted in commit
356df2dd72e8299b5de58e9390283110c19f7c76. The reland can go in after we
fixed some downstream codebases that had incorrectly placed attributes.
Original commit description:
> Emit the "cannot be applied to types" warning instead of silently
ignoring the attribute when it's attempted to be used on a type (instead
of a function argument or the function definition).
>
> Before this commit, the warning has been printed when the attribute
was (mis)used on a decl-specifier, but not in other places in a
declarator.
>
> Examples where the warning starts being emitted with this commit:
>
> ```
> int * [[clang::lifetimebound]] x;
>
> void f(int * [[clang::lifetimebound]] x);
>
> void g(int * [[clang::lifetimebound]]);
> ```
>
> Note that the last example is the case of an unnamed function
parameter. While in theory Clang could've supported the
`[[clang::lifetimebound]]` analysis for unnamed parameters, it doesn't
currently, so the commit at least makes the situation better by
highlighting this as a warning instead of a silent ignore - which was
reported at #96034.
show more ...
|
Revision tags: llvmorg-19.1.6 |
|
#
6e58e99a |
| 17-Dec-2024 |
Sirraide <aeternalmail@gmail.com> |
[Clang] [Sema] Reject non-power-of-2 `_BitInt` matrix element types (#117487)
Essentially, this makes this ill-formed: ```c++ using mat4 = _BitInt(12) [[clang::matrix_type(3, 3)]]; ```
This matches
[Clang] [Sema] Reject non-power-of-2 `_BitInt` matrix element types (#117487)
Essentially, this makes this ill-formed: ```c++ using mat4 = _BitInt(12) [[clang::matrix_type(3, 3)]]; ```
This matches preexisting behaviour for vector types (e.g. `ext_vector_type`), and given that LLVM IR intrinsics for matrices also take vector types, it seems like a sensible thing to do.
This is currently especially problematic since we sometimes lower matrix types to LLVM array types instead, and while e.g. `[4 x i32]` and `<4 x i32>` *probably* have the same similar memory layout (though I don’t think it’s sound to rely on that either, see #117486), `[4 x i12]` and `<4 x i12>` definitely don’t.
show more ...
|
#
70c1764d |
| 08-Dec-2024 |
Nathan Ridge <zeratul976@hotmail.com> |
[clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (#118236)
Fixes https://github.com/llvm/llvm-project/issues/118198
Fixes https://github.com/clangd/clangd/issues/2235
|
#
46de3a70 |
| 04-Dec-2024 |
Sarah Spall <sarahspall@microsoft.com> |
[HLSL] get inout/out ABI for array parameters working (#111047)
Get inout/out parameters working for HLSL Arrays.
Utilizes the fix from #109323, and corrects the assignment behavior
slightly to al
[HLSL] get inout/out ABI for array parameters working (#111047)
Get inout/out parameters working for HLSL Arrays.
Utilizes the fix from #109323, and corrects the assignment behavior
slightly to allow for Non-LValues on the RHS.
Closes #106917
---------
Co-authored-by: Chris B <beanz@abolishcrlf.org>
show more ...
|
#
356df2dd |
| 03-Dec-2024 |
Haojian Wu <hokein.wu@gmail.com> |
Revert "[clang] Warn [[clang::lifetimebound]] misusages on types (#118281)"
Temporarily revert the patch to give downstream teams some time to clean up their codebases.
This reverts commit 4849d593
Revert "[clang] Warn [[clang::lifetimebound]] misusages on types (#118281)"
Temporarily revert the patch to give downstream teams some time to clean up their codebases.
This reverts commit 4849d593ab07c47f9f520bea636f62d159d57006.
show more ...
|
#
4849d593 |
| 03-Dec-2024 |
Maksim Ivanov <emaxx@google.com> |
[clang] Warn [[clang::lifetimebound]] misusages on types (#118281)
Emit the "cannot be applied to types" warning instead of silently
ignoring the attribute when it's attempted to be used on a type
[clang] Warn [[clang::lifetimebound]] misusages on types (#118281)
Emit the "cannot be applied to types" warning instead of silently
ignoring the attribute when it's attempted to be used on a type (instead
of a function argument or the function definition).
Before this commit, the warning has been printed when the attribute was
(mis)used on a decl-specifier, but not in other places in a declarator.
Examples where the warning starts being emitted with this commit:
```
int * [[clang::lifetimebound]] x;
void f(int * [[clang::lifetimebound]] x);
void g(int * [[clang::lifetimebound]]);
```
Note that the last example is the case of an unnamed function parameter.
While in theory Clang could've supported the `[[clang::lifetimebound]]`
analysis for unnamed parameters, it doesn't currently, so the commit at
least makes the situation better by highlighting this as a warning
instead of a silent ignore - which was reported at #96034.
show more ...
|
Revision tags: llvmorg-19.1.5 |
|
#
43f84e79 |
| 19-Nov-2024 |
Oleksandr T. <oleksandr.tarasiuk@outlook.com> |
[Clang] Enhance diagnostic by attaching source location to deduced type in trailing return without auto (#115786)
Fixes #78694
|
Revision tags: llvmorg-19.1.4 |
|
#
46d750be |
| 16-Nov-2024 |
Kazu Hirata <kazu@google.com> |
[Sema] Remove unused includes (NFC) (#116461)
Identified with misc-include-cleaner.
|
#
76bb9633 |
| 14-Nov-2024 |
Aaron Ballman <aaron@aaronballman.com> |
No longer assert when using noderef on an _Atomic type (#116237)
When filling out the type locations for a declarator, we handled atomic
types and we handled noderef types, but we didn't handle ato
No longer assert when using noderef on an _Atomic type (#116237)
When filling out the type locations for a declarator, we handled atomic
types and we handled noderef types, but we didn't handle atomic noderef
types.
Fixes #116124
show more ...
|
#
3e20bae8 |
| 13-Nov-2024 |
Utkarsh Saxena <usx@google.com> |
Reapply "[clang] Introduce [[clang::lifetime_capture_by(X)]] (#115823)
Fix compile time regression and memory leak
In the previous change, we saw:
- Memory leak: https://lab.llvm.org/buildbot/#/
Reapply "[clang] Introduce [[clang::lifetime_capture_by(X)]] (#115823)
Fix compile time regression and memory leak
In the previous change, we saw:
- Memory leak: https://lab.llvm.org/buildbot/#/builders/169/builds/5193
- 0.5% Compile time regression
[link](https://llvm-compile-time-tracker.com/compare.php?from=4a68e4cbd2423dcacada8162ab7c4bb8d7f7e2cf&to=8c4331c1abeb33eabf3cdbefa7f2b6e0540e7f4f&stat=instructions:u)
For compile time regression, we make the Param->Idx `StringMap` for
**all** functions. This `StringMap` is expensive and should not be
computed when none of the params are annotated with
`[[clang::lifetime_capture_by(X)]]`.
For the memory leak, the small vectors used in Attribute are not
destroyed because the attributes are allocated through ASTContext's
allocator. We therefore need a raw array in this case.
show more ...
|
#
7a1fdbb9 |
| 13-Nov-2024 |
Balázs Kéri <balazs.keri@ericsson.com> |
[clang][AST] Add 'IgnoreTemplateParmDepth' to structural equivalence cache (#115518)
Structural equivalence check uses a cache to store already found
non-equivalent values. This cache can be reused
[clang][AST] Add 'IgnoreTemplateParmDepth' to structural equivalence cache (#115518)
Structural equivalence check uses a cache to store already found
non-equivalent values. This cache can be reused for calls (ASTImporter
does this). Value of "IgnoreTemplateParmDepth" can have an effect on the
structural equivalence therefore it is wrong to reuse the same cache for
checks with different values of 'IgnoreTemplateParmDepth'. The current
change adds the 'IgnoreTemplateParmDepth' to the cache key to fix the
problem.
show more ...
|
#
3a03513f |
| 11-Nov-2024 |
Nikita Popov <nikita.ppv@gmail.com> |
Revert "[clang] Introduce [[clang::lifetime_capture_by(X)]] (#111499)"
This reverts commit 8c4331c1abeb33eabf3cdbefa7f2b6e0540e7f4f.
Causes a large compile-time regression, see: https://llvm-compil
Revert "[clang] Introduce [[clang::lifetime_capture_by(X)]] (#111499)"
This reverts commit 8c4331c1abeb33eabf3cdbefa7f2b6e0540e7f4f.
Causes a large compile-time regression, see: https://llvm-compile-time-tracker.com/compare.php?from=4a68e4cbd2423dcacada8162ab7c4bb8d7f7e2cf&to=8c4331c1abeb33eabf3cdbefa7f2b6e0540e7f4f&stat=instructions:u
show more ...
|
#
8c4331c1 |
| 11-Nov-2024 |
Utkarsh Saxena <usx@google.com> |
[clang] Introduce [[clang::lifetime_capture_by(X)]] (#111499)
This implements the RFC
https://discourse.llvm.org/t/rfc-introduce-clang-lifetime-capture-by-x/81371
In this PR, we introduce `[[cla
[clang] Introduce [[clang::lifetime_capture_by(X)]] (#111499)
This implements the RFC
https://discourse.llvm.org/t/rfc-introduce-clang-lifetime-capture-by-x/81371
In this PR, we introduce `[[clang::lifetime_capture_by(X)]]` attribute
as discussed in the RFC.
As an implementation detail of this attribute, we store and use param
indices instead of raw param expressions. The parameter indices are
computed lazily at the end of function declaration since the function
decl (and therefore the subsequent parameters) are not visible yet while
parsing a parameter annotation.
In subsequent PR, we will infer this attribute for STL containers and
perform lifetime analysis to detect dangling cases.
show more ...
|
#
4027400d |
| 08-Nov-2024 |
Aaron Ballman <aaron@aaronballman.com> |
[C2y] Add test coverage and documentation for WG14 N3342 (#115494)
This paper made qualified function types implementation-defined. We have
always supported this as an extension, so now we're docum
[C2y] Add test coverage and documentation for WG14 N3342 (#115494)
This paper made qualified function types implementation-defined. We have
always supported this as an extension, so now we're documenting our
behavior.
Note, we still warn about this by default even in C2y mode because a
qualified function type is a sign of programmer confusion.
show more ...
|
#
d3daa3c4 |
| 31-Oct-2024 |
Pavel Yaskevich <xedin@apache.org> |
[clang/AST] Make it possible to use SwiftAttr in type context (#108631)
Swift ClangImporter now supports concurrency annotations on imported
declarations and their parameters/results, to make it po
[clang/AST] Make it possible to use SwiftAttr in type context (#108631)
Swift ClangImporter now supports concurrency annotations on imported
declarations and their parameters/results, to make it possible to use
imported APIs in Swift safely there has to be a way to annotate
individual parameters and result types with relevant attributes that
indicate that e.g. a block is called on a particular actor or it accepts
a `Sendable` parameter.
To faciliate that `SwiftAttr` is switched from `InheritableAttr` which
is a declaration attribute to `DeclOrTypeAttr`. To support this
attribute in type context we need access to its "Attribute" argument
which requires `AttributedType` to be extended to include `Attr *` when
available instead of just `attr::Kind` otherwise it won't be possible to
determine what attribute should be imported.
show more ...
|
Revision tags: llvmorg-19.1.3 |
|
#
4dd55c56 |
| 24-Oct-2024 |
Jay Foad <jay.foad@amd.com> |
[clang] Use {} instead of std::nullopt to initialize empty ArrayRef (#109399)
Follow up to #109133.
|
#
2074de25 |
| 22-Oct-2024 |
Alex Voicu <alexandru.voicu@amd.com> |
[clang][HIP] Don't use the OpenCLKernel CC when targeting AMDGCNSPIRV (#110447)
When compiling HIP source for AMDGCN flavoured SPIR-V that is expected
to be consumed by the ROCm HIP RT, it's not de
[clang][HIP] Don't use the OpenCLKernel CC when targeting AMDGCNSPIRV (#110447)
When compiling HIP source for AMDGCN flavoured SPIR-V that is expected
to be consumed by the ROCm HIP RT, it's not desirable to set the OpenCL
Kernel CC on `__global__` functions. On one hand, this is not an OpenCL
RT, so it doesn't compose with e.g. OCL specific attributes. On the
other it is a "noisy" CC that carries semantics, and breaks overload
resolution when using [generic dispatchers such as those used by
RAJA](https://github.com/LLNL/RAJAPerf/blob/186d4194a5719788ae96631c923f9ca337f56970/src/common/HipDataUtils.hpp#L39).
show more ...
|
Revision tags: llvmorg-19.1.2, llvmorg-19.1.1 |
|
#
50e5411e |
| 01-Oct-2024 |
Younan Zhang <zyn7109@gmail.com> |
[Clang][Sema] Retain the expanding index for unevaluated type constraints (#109518)
(This continues the effort of #86265, fixing another piece of issue in
constraint evaluation on variadic lambdas.
[Clang][Sema] Retain the expanding index for unevaluated type constraints (#109518)
(This continues the effort of #86265, fixing another piece of issue in
constraint evaluation on variadic lambdas.)
We need the depth of the primary template parameters for constraint
substitution. To that end, we avoided substituting type constraints by
copying the constraint expression when instantiating a template. This,
however, has left an issue in that for lambda's parameters, they can
reference outer template packs that would be expanded in the process of
an instantiation, where these parameters would make their way into the
constraint evaluation, wherein we have no other way to expand them later
in evaluation. For example,
template <class... Ts> void foo() {
bar([](C<Ts> auto value) {}...);
}
The lambda references a pack `Ts` that should be expanded when
instantiating `foo()`. The `Ts` along with the constraint expression
would not be transformed until constraint evaluation, and at that point,
we would have no chance to expand `Ts` anyhow.
This patch takes an approach that transforms `Ts` from an unexpanded
TemplateTypeParmType into a SubstTemplateTypeParmType with the current
pack substitution index, such that we could use that to expand the type
during evaluation.
Fixes #101754
show more ...
|
#
1d8fad9f |
| 26-Sep-2024 |
Helena Kotas <hekotas@microsoft.com> |
[HLSL] Allow resource type attributes only on `__hlsl_resource_t` (#110143)
Resource type attributes should only ever be used on the intangible type
`__hlsl_resource_t`.
|
#
09284e7e |
| 17-Sep-2024 |
Mital Ashok <mital@mitalashok.co.uk> |
[Clang] Reject `this void` explicit object parameters (CWG2915) (#108817)
https://cplusplus.github.io/CWG/issues/2915.html
Previously, `struct A { void f(this void); };` was accepted with `A::f`
[Clang] Reject `this void` explicit object parameters (CWG2915) (#108817)
https://cplusplus.github.io/CWG/issues/2915.html
Previously, `struct A { void f(this void); };` was accepted with `A::f`
being a member function with no non-object arguments, but it was still a
little wonky because it was still considered an explicit object member
function. Now, this is rejected immediately.
This applies to any language mode with explicit object parameters as
this is a DR (C++23 and C++26)
show more ...
|
Revision tags: llvmorg-19.1.0 |
|
#
5df1b793 |
| 17-Sep-2024 |
Helena Kotas <hekotas@microsoft.com> |
[HLSL] Add `[[hlsl::raw_buffer]]` attribute (#107954)
This PR introduces new HLSL resource type attribute
`[[hlsl::raw_buffer]]`. Presence of this attribute on a resource handle
means that the res
[HLSL] Add `[[hlsl::raw_buffer]]` attribute (#107954)
This PR introduces new HLSL resource type attribute
`[[hlsl::raw_buffer]]`. Presence of this attribute on a resource handle
means that the resource does not require typed element access. The
attribute will be used on resource handles that represent buffers like
`StructuredBuffer` or `ByteAddressBuffer` and in DXIL it will be
translated to target extension type `dx.RawBuffer`.
Fixes #107907
show more ...
|
#
0a7a1ef2 |
| 16-Sep-2024 |
Helena Kotas <hekotas@microsoft.com> |
[HLSL] Add `[[hlsl::contained_type()]]` attribute (#108456)
Introducing a new HLSL resource type attribute `[[contained_type(T)]]`
which describes the "contained type" of a buffer or resource type.
[HLSL] Add `[[hlsl::contained_type()]]` attribute (#108456)
Introducing a new HLSL resource type attribute `[[contained_type(T)]]`
which describes the "contained type" of a buffer or resource type.
Specifically, the attribute will be used on the resource handle in
templated buffer types like so:
template <typename T> struct RWBuffer {
__hlsl_resource_t [[hlsl::contained_type(T)]] [[hlsl::resource_class(UAV)]] h;
};
Fixes #104855
show more ...
|