[mlir][IR] Require token producer and consumer traits
Add marker traits for operations that intentionally produce or consume the
builtin token type. The verifier now rejects token results without
TokenProducerTrait, token operands without TokenConsumerTrait, token entry
block arguments whose parent op does not produce tokens, and token block
arguments outside entry blocks.
Extend the Test dialect token ops to cover valid opt-in cases and each
verifier rejection path.
Assisted-by: Codex
[RISCV][TTI] Model broadcast loads as zero-stride loads (#198446)
We have done this optimization in ISel and this PR just models it
in TTI.
---------
Co-authored-by: Luke Lau <luke_lau at icloud.com>
[AIX] Remove unsupported AIX native echo option -n (#199079)
AIX native echo doesn't support the `-n` flag.
Use the POSIX-standard `\c` escape sequence instead to suppress the
trailing newline, ensuring the test works across all systems and make it
portable.
The current test fails as follows:
```
FAIL: lit :: unit/Util.py (1 of 1)
******************** TEST 'lit :: unit/Util.py' FAILED ********************
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
"/opt/freeware/bin/python3.12" /home/himadhit/llvm/community/build/utils/lit/tests/unit/Util.py
# executed command: /opt/freeware/bin/python3.12 /home/himadhit/llvm/community/build/utils/lit/tests/unit/Util.py
[20 lines not shown]
[SPIRV][NFC] Pass function-pointer operand explicitly to visitFunPtrUse (#197667)
Take the function-pointer placeholder operand as a parameter rather
than reading MI.getOperand(2) directly, so visitFunPtrUse can be
reused from instructions with a different operand layout. Pure
refactor.
---------
Co-authored-by: Marcos Maronas <mmaronas at amd.com>
[ELF] Remove the symbol partition feature (#199186)
Follow-up to #198718: SHT_LLVM_SYMPART sections are no longer recognized
and are treated as ordinary sections.
The sole user has been retired (crbug.com/401249151).
The per-partition synthetic sections (.dynamic, .dynsym, .gnu.hash,
.eh_frame, .ARM.exidx, ...) move into `ctx.in`; the program headers move
into `ctx.phdrs`. Delete the `Partition` struct, `ctx.mainPart`,
`ctx.partitions`, the
PartitionElfHeaderSection/PartitionProgramHeadersSection shim sections,
and the `.part.end` marker.
[MLIR][Linalg] Specialize more binary elementwise ops (#192290)
Extends the matching logic for `linalg.generic` ops that can be
represented as named op or `linalg.elementwise` to cover all variants
currently supported by `RegionBuilderHelper::buildBinaryFn`. We
previously detected only `add`, `sub`, `mul` and `div` for floating
point types.
I combined the detection for unary and binary functions to make it
tractable to morph operations such as
```mlir
#map = affine_map<(d0) -> (d0)>
// ...
%c123_i32 = arith.constant 123 : i32
%0 = linalg.generic
{indexing_maps = [#map, #map], iterator_types = ["parallel"]}
ins(%A : tensor<?xi32>) outs(%Out : tensor<?xi32>) {
^bb0(%in: i32, %out: i32):
%v = arith.addi %c123_i32 , %in : i32
[12 lines not shown]
[clang] Avoid invalidating specialization lookup (#196533)
Fixes a use-after-free in `ASTReader::LoadExternalSpecializationsImpl`
when loading external specializations with `-ftime-trace` enabled.
This resolves the https://github.com/llvm/llvm-project/issues/196482 and
builds upon the https://github.com/llvm/llvm-project/pull/172658
The function kept a pointer into `SpecLookups`:
```cpp
LookupTable = &It->getSecond();
```
Then it constructed a `TimeTraceScope` whose name callback calls
`getNameForDiagnostic`. That call may deserialize additional AST state
and mutate `SpecLookups`, invalidating the saved pointer before it is
later used for:
[27 lines not shown]
[Driver][MSVC] Correctly handle the -fuse-ld=(empty) case (#199167)
We need to distinguish the case where `-fuse-ld` is unspecified and when
`-fuse-ld=(empty)` as is already done in the generic `ToolChain`
implementation but wasn't done in the MSVC driver to correctly handle
the `CLANG_DEFAULT_LINKER` CMake option.
[ELF] Reduce symbol partitions to shim binaries (#198718)
The experimental symbol partition feature can move arbitrary symbols and
input sections out of the main partition into named loadable partitions
that consumers extract with `llvm-objcopy --extract-partition`. It is
incompatible with many features, has seen no adoption beyond Chromium's
`build/extract_partition.py`. Chrome hasn't needed this feature for many
years.
The partitioning machinery (per-partition `MarkLive` runs, `moveToMain`,
cross-partition pull in `InputSection::replace`, per-symbol
dynsym/gnuhash/thunk-compat filters, `PartitionIndexSection`,
`copySectionsIntoPartitions`, etc.) does not pull its weight for that.
Remove the partitioning brain and keep a minimal shim shell.
`Symbol::partition` is deleted; every dynsym add goes to
`ctx.mainPart`. `ctx.partitions` wraps a `std::vector<Partition>`
whose iterator yields only the main partition; shim partitions live
in `storage[1..]` and are reached via `shims()`. The two paths that
[10 lines not shown]
[mlir][spirv] Fix `fp8` and `bf16` leaking into unsupported ops (#199102)
Including `SPIRV_AnyFloat` in the majority of types caused fp8 and bf16
to be allowed in ops that are not allowed by float8 and bfloat16
extensions. This patch tries to rectify to only allow fp8 and bf16 in
ops allowed by the respective specs. Additional tests have been also
added to increase the coverage with respect to those types.
Assisted-by: Codex + Claude Code
[Verifier] Add missing null-check. (#199170)
[Verifier] Add missing null-check.
visitProfMetadata's was using the result of dyn_extract without first
checkout that it's non-null. Thus one could crash the verifier by
providing invalid IR.
This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
[libc] Enforce standard identifier validation in hdrgen (#198971)
Implemented validation for standard identifiers in the hdrgen tool to
catch typos and unknown standards. Aggregated standards from all entity
types (macros, types, etc.) for validation, addressing a TODO in
header.py.
Added llvm_libc_ext, stdc_ext, and llvm_libc_stdfix_ext to the canonical
identifiers. Standardised invalid or inconsistently formatted standards
in several YAML files.
This enforces the correctness of any provided standards field but does
not yet require that every entity has one (many entities still inherit
standards from the header level).
Assisted-by: Automated tooling, human reviewed.