[AArch64][llvm] Some instructions should be `HINT` aliases (NFC)
Implement the following instructions as a `HINT` alias instead of a
dedicated instruction in separate classes:
* `stshh`
* `stcph`
* `shuh`
* `tsb`
Updated all their helper methods too, and updated the `stshh` pseudo
expansion for the intrinsic to emit `HINT #0x30 | policy`.
Code in AArch64AsmPrinter::emitInstruction identified an initial BTI using a
broad bitmask on the HINT immediate, which also matched shuh/stcph (50..52)
This could move the patchable entry label after a non-BTI instruction.
Replaced it with an exact BTI check using the BTI HINT range (32..63) and
AArch64BTIHint::lookupBTIByEncoding(Imm ^ 32).
A following change will remove duplicated code and simplify.
[2 lines not shown]
[AArch64][llvm] Tighten SYSP; don't disassemble invalid encodings
Tighten SYSP aliases, so that invalid encodings are disassembled
to `<unknown>`. This is because:
```
Cn is a 4-bit unsigned immediate, in the range 8 to 9
Cm is a 4-bit unsigned immediate, in the range 0 to 7
op1 is a 3-bit unsigned immediate, in the range 0 to 6
op2 is a 3-bit unsigned immediate, in the range 0 to 7
```
Ensure we check this when disassembling, and also constrain
tablegen for compile-time errors of invalid encodings.
Also adjust the testcases in `armv9-sysp-diagnostics.s` and
`llvm/test/MC/AArch64/armv9a-sysp.s` as they were invalid,
and added a few invalid (outside of range) SYSP-alikes to
test that `<unknown>` is printed
[CIR][docs] Migrate existing Markdown documents to reStructuredText format (#192066)
This patch migrates the existing ClangIR documents that are written in
Markdown format to reStructuredText format to align CIR's documents with
clang's documentation policy.
Closes #191850 .
[clang][rtsan] Disallow type and realtime sanitizer combo (#192681)
Both of these sanitizer runtimes define similar interceptors, so they
may not be used together
[libc] Reorganize iswctype to avoid GPU/libc++ error (#192659)
After #191178 there were build errors when building the libc++
hand-in-hand pieces due to header layering.
Written with the assistance of Gemini
[AArch64] Fix codegen for FEAT_F16F32DOT with SVE2/SME. (#192668)
When compiling with +sve2/+sme, don't override to use Custom lowering
for PARTIAL_REDUCE_FMLA when it previously determined the operation was
legal due to +f16f32dot/+fp16fml.
[libc] Various limits adds and fixes (#192672)
Implemented and corrected POSIX limits:
* Corrected _POSIX_NAME_MAX and _POSIX_PATH_MAX definitions.
* Added PATH_MAX for Linux.
* Added _POSIX_THREAD_DESTRUCTOR_ITERATIONS and
PTHREAD_DESTRUCTOR_ITERATIONS.
* Updated limits.yaml to include these macros.
[libc] Fix ucontext_t and mcontext_t for C compliance (#192648)
* x86_64/ucontext_t.h: Removed alignas to fix C compilation error.
* x86_64/mcontext_t.h: Updated include guard to prevent collision.
[CAS] Fix assertion failure when opening CAS with smaller mapping size (#192565)
When opening an existing large CAS using a smaller requested mapping
size, the file size can be smaller than capacity while holding only a
shared lock. Replace the assertion with a graceful lock upgrade to
exclusive before resizing the file.
[libc++] Fix realloc bug in ios.cpp (#177526)
When realloc fails in the function register_callback in `ios.cpp`, the
memory will be leaked, then `__fn_` is assigned as `nullptr`,
dereferencing `__fn_` causes UB. The fix is quite simple which aligns to
`iword & pword` for `realloc`, i.e. return directly if `realloc` fails.
Regarding testing for this bug fix, because `realloc` is a C function
that we can't replace, there is no way to exercise that path easily.
[flang] Conditional expressions lowering: use fir.if SSA results for trivial scalar types (#192338)
For trivial scalar types (INTEGER, REAL, COMPLEX, LOGICAL, UNSIGNED),
generate `fir.if` with SSA results instead of allocating a temporary and
using `hlfir.assign`. This avoids the alloca/declare/assign/load pattern
for types that can be passed directly as SSA values.
Non-trivial scalar types (derived types, characters) continue to use the
existing temporary-based paths.
The LIT test expectations have been updated accordingly, and a test case
was added.
[SPIR-V] Use ToolSubst for spirv-tools lit substitutions (#192462)
Bare-string substitutions match as substrings and the replacement path
contains the tool name, causing corrupted RUN lines
The issue is reproducible, for example, when path to llvm has tool name
substring at any point
[clang] Clear ASTContext::TUDecl in 'cleanup' for easier debugging (#191697)
While the ASTContext has more things inside, I think we should at least
clear the TUDecl so that when traversing the (dangling) AST would
immediately step on the null-dereference instead of chasing dangling
pointers and crash later.
I was bitten by this in #191058.
This commit should be NFC - assuming that people didn't traverse already
dangling ASTs.