[AArch64] Lower scalable i64 CLMUL with SVE2/SME (#198999)
When AES or SSVE-AES are not available, but SVE2 or SME are,
clmul.nxv2i64 can benefit from a cross-byte CLMUL of .S precision. This
re-uses the functionality added for nxv8i16.
[Support] Take ArrayRef in convertWideToUTF8 (#200687)
`convertWideToUTF8` took a `std::wstring`, but it never modified its
data. An `ArrayRef` or `std::wstring_view` are sufficient here. I chose
`ArrayRef<wchar_t>` over `std::wstring_view`, because it can be
implicitly constructed from any range that provides `data()` and
`size()`. A second overload taking a `const wchar_t *` is provided to
convert null terminated wide C-strings.
[Liveness][analyzer] Fix handling of [[assume]] attributes (#198618)
Before this commit, if the analyzer encountered code like
```
int f(int a, int b) {
[[assume(a == 2), assume(b == 3)]];
return a + b;
}
```
it performed the following steps:
1. It visited the expression `a == 2` with `ExprEngine::Visit` (after
visiting its sub-expressions, within the regular visitation that visits
each statement of the `CFGBlock`). This triggered the `EagerlyAssume`
logic and separated two execution paths.
2. It discarded the result bound to `a == 2` from the `Environment`
because `a == 2` is not a direct child of the `AttributedStmt`.
3. Analogously, it visited an evaluated `b == 3`.
4. Analogously, it discarded the result bound to `b == 3`.
5. On each execution path `VisitAttributedStmt` was reached, it ran the
[32 lines not shown]
[libsycl] Add single_task (#192499)
Depends on liboffload PR:
https://github.com/llvm/llvm-project/pull/194333.
The approach with void sycl_kernel_launch(pack of arguments) implies
that
we can use or copy arguments only during that call. Since it pass only
kernel arguments as parameters and returns void - we have to split
setting
of extra kernel data like event dependencies and range and getting
result
event from arguments handling and direct kernel submision if it is
possible. Key stages: 1) passing to queue (or handler in future)
dependency
events and range (for parallel_for), saving them in queue (copy/move).
2)
wrapping kernel arguments into typeless wrappers (pointer based,
initially
[39 lines not shown]
[LifetimeSafety] Add support for lifetime capture_by (#196884)
This PR implements support for the `[[clang::lifetime_capture_by(X)]]`
attribute within the lifetime-safety analysis.
The PR introduces a new helper in `FactGenerator.cpp` called
`handleLifetimeCaptureBy` which detects
`[[clang::lifetime_capture_by(X)]]` on parameters. If detected, the
analyzer now generates an `OriginFlowFact` ensuring that captured
dependencies are added to the capturer's state. The PR supports
capture_by params and `this` and currently doesn't implement attributes
on function declarations.
Example:
Integrate `[[clang::lifetimebound]]`: This existing Clang annotation is
crucial for specifying that the lifetime of a function's output is tied
to one of its inputs.
```cpp
[60 lines not shown]
[IR] Handle nofree noalias in canBeFreed() (#200194)
Based on the argument nofree semantics specified in
https://github.com/llvm/llvm-project/pull/195658, we can conclude that
an argument with both nofree and noalias cannot be freed.
This also handles the case of readonly + noalias, to be consistent with
the logic for functions (and because we had a FIXME for it...)
[lldb] Reduce size of Mangled class (#200181)
The Mangled class is used in several places in LLDB, most notably as a
direct member of Symbol. This makes this class one of the most
frequently long-lived allocations in LLDB.
In commit a2672250be871bdac18c1a955265a98704434218 , this class got a
(large) cache that stores information about demangled data. This cache
is stored in a std::optional member, which means the memory for the
class is allocated within our Mangled object. It should be noted that
this cache is only used when we actually demangle the name, which
doesn't happen for every mangled name we encounter.
The additional cache member caused that the size of Mangled went from
16B to 152B by default (that is, even if the Mangled name was never
demangled).
This patch replaces the std::optional with a unique_ptr which stores the
cache on first use in a separate heap allocation. This changes decreases
the amount of allocated memory when debugging a relatively small
Objective-C project from 1.57GiB to 1.18GiB (-400MiB).
[clang-tools-extra][docs] Convert maintainers file to Markdown (#200365)
Following the way clang does it.
* Moved files to .md (done in #200769).
* Reformatted into Markdown.
* Changed the stub file docs/Maintainers.rst into docs/Maintainers.md
and used a myst directive for the include.
* In the config file, added myst parser and ".md" as a recognised file
extension.
After this change, all maintainers files in llvm-project will be in
Markdown format.
[clang-tools-extra] Move maintainer files to .md files (#200769)
Without any formatting changes. This will break the docs build, but a
follow up (#200365) will fix the formatting and so on.
[X86] matchShuffleAsVSHLD - fix incorrect shift factor (#200754)
#200604 left the non-commuted case to still scale by 8bits instead of the src scalar bit size
[Serialization] Fix assertion on re-deserialized friend template spec… (#200566)
…ialization in PCH (#198133)
A friend function-template specialization declared inside a class
template is serialized into a PCH. When the class template is later
instantiated while loading the PCH, the friend specialization can be
deserialized re-entrantly (VisitFriendDecl -> VisitFunctionDecl -> ...
-> VisitFunctionDecl for the same specialization) at the same time as
the canonical copy, producing two redeclarations of the same
specialization in the template's specialization set.
ASTDeclReader::VisitFunctionDecl asserted that this collision could only
happen when merging declarations from different modules. Since
38b3d87bd384, friend functions defined inside dependent class templates
are loaded eagerly, so the collision can now also occur within a single
PCH/AST file (non-modules build), tripping the assertion:
Assertion failed: (Reader.getContext().getLangOpts().Modules &&
[7 lines not shown]
[libc][math] Guard f16 math headers to fix certain 32-bit ARM builds (#200715)
Wrap hypotf16.h and expxf16_utils.h in LIBC_TYPES_HAS_FLOAT16 macros
like other flaot16 math headers. This fixes build breaks on systems
where float16 is unsupported (like some 32-bit ARM).
[NFCI][clang] Allow overriding any global variable address space
Allow the target to change the AS of a global variable at will, not just whenever Clang cannot assign one.
This enables the next patch that will specialize LDS GVs for barriers as a separate address space.
[RFC][AMDGPU] Add BARRIER address space
Add a new BARRIER address space that is used for global variables that are used to represent the barrier IDs in GFX12.5.
These barrier addresses just have values corresponding 1-1 to barrier IDs. They are still implemented on top of LDS, but the offsetting happens during an addrspacecast to generic, not whenever the barrier GV is used.
The motivation for this is to make the relation between LDS and barrier GVs explicit in the compiler. It does add a bit more complexity, but that complexity was already there, just hidden by pretending barrier GVs were actual LDS.
[AMDGPU] Widen MUBUF/MTBUF source-vgpr WAR hazard on gfx940-family to SGPR soffset (#197267)
createsVALUHazard previously gated the MUBUF/MTBUF source-vgpr WAR
hazard to fire only when SOFFSET was a literal or absent. On
gfx940-family subtargets that gate is too narrow: the hazard also fires
when SOFFSET is sourced from an SGPR.
Concretely, on gfx950 a sequence of the form
```
buffer_store_dwordx4 v[X:X+3], voff, descr, sN offen
v_pk_mul_f32 v[X:X+1], <src>, <src> # next VALU cycle
```
deterministically commits the post-pk_mul value of v[X+1] to memory for
the second dword of the store; the other three dwords store correctly.
The wait-state window depends on the SOFFSET shape:
[20 lines not shown]