[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.
[BOLT] Support non-null MCInst operands in annotation handling (#192188)
The annotation sentinel in BOLT is a null MCInst operand appended after
all prime operands. However, some architectures (e.g. Hexagon) use
non-null MCInst operands as legitimate prime operands for duplex
sub-instructions. The existing code treated any MCInst operand as the
annotation sentinel, causing duplex sub-instructions to be
misidentified.
In getNumPrimeOperands(), only treat a null MCInst operand as the
sentinel. In getAnnotationInstOp(), skip non-null MCInst operands when
searching for the annotation sentinel.
[mlir][tosa] Add `draft` information to specification version (#192122)
The draft flag can be used by useful to indicate that a specification
version is not yet finalized, and may be subject to change. This is
particularly important for serialized formats that offer guarantees
around backwards compatibility. By exposing `draft` information in the
specification version in the target environment, we can allow consumers
to query this information.
[libc] Fix strcasecmp/strncasecmp signedness and add tests (#192632)
Fixed character signedness bug in strcasecmp and strncasecmp
implementations in src/strings/ where characters > 127 were not
correctly handled.
Added LIBC_CRASH_ON_NULLPTR checks to both functions.
Enhanced unit tests in test/src/strings/ to be comprehensive without
duplicating basic case insensitivity tests.
Updated assertions in strcasecmp_test, strncasecmp_test, and strcmp_test
to check for sign instead of exact value.
[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]
[mlir] reduce excessive verification in transform
`mergeSymbolsInto` called by the transform interpreter for named
sequence management was calling a full verifier after renaming symbols.
The renaming could have potentially broken symbol table-related
invariants, but not really anything else. Only verify the symbol
table-related invariants intead.
[flang][NFC] Converted five tests from old lowering to new lowering (part 46) (#192439)
Tests converted from test/Lower: logical-operations.f90, loops2.f90,
loops3.f90, memory-alloc.f90, zero-size.f90
Remove __arm_atomic_store_with_stshh from llvm (#192419)
This patch is revert of #181386 with some manual changes applied due to
revert conflicts.
Current implementation of __arm_atomic_store_with_stshh is incorrect as
it doesn't enforce the memory ordering constraints as can be seen
[here](https://godbolt.org/z/n5YnbaT8E). Different solution will need to
be implemented, but removing for now so users don't pick this up.
[AMDGPU] Report only local per-function resource usage when object linking is enabled
With object linking the linker aggregates resource usage across TUs via
`.amdgpu.info`, so compile-time pessimism and call-graph propagation duplicate
the linker's work or pollute its inputs.
In this mode, skip the per-callsite conservative bumps in
`AMDGPUResourceUsageAnalysis` and assign each resource symbol in
`AMDGPUMCResourceInfo` a concrete local constant instead of building call-graph
max/or expressions.
[AMDGPU] Add `.amdgpu.info` section for per-function metadata
AMDGPU object linking requires the linker to propagate resource usage
(registers, stack, LDS) across translation units. To support this, the compiler
must emit per-function metadata and call graph edges in the relocatable object
so the linker can compute whole-program resource requirements.
This PR introduces a `.amdgpu.info` ELF section using a tagged, length-prefixed
binary format: each entry is encoded as:
```
[kind: u8] [len: u8] [payload: <len> bytes]
```
A function scope is opened by an `INFO_FUNC` entry (containing a symbol
reference), followed by per-function attributes (register counts, flags, private
segment size) and relational edges (direct calls, LDS uses, indirect call
signatures). String data such as function type signatures is stored in a
companion `.amdgpu.strtab` section.
[4 lines not shown]
[mlir] add normal form checked transform interface (#192647)
This interface can be implemented by operations that guarantee certain
normal forms for themselves and their regions. The operations provide
the list of normal forms they guarantee. This interface interacts with
the typed transform handles removing the need for them to check normal
forms that are guaranteed (and preserved by transforms).
Provide a simple `transform.payload` operation to carry a list of normal
forms and implement the interface.
This exposes the fact that the transform interpreter may be running the
verifier too much, but this is a pre-existing beavior that is orthogonal
to this patch.
Assisted-by: Claude Opus 4.7 / Cursor
[mlir] MlirOptMain: avoid double verification
MlirOptMain would run verification twice at the end of the processing:
1. after the last pass in the pipeline;
2. prior to printing.
Since there is no logic that could mutate, and thus potentially
invalidate, the IR between the two, the second verification is
redundant. Skip it when possible.