[MLIR][docs] Document the CMake infrastructure
Describe MLIR's TableGen, library, visibility, aggregation,
installation, and generated-header conventions in one infrastructure
guide. Explain library owners, explicit generators, and compile-only
header requirements.
Link the guide from CreatingADialect.md. Use
add_mlir_dialect_tablegen_target in the AttributesAndTypes.md example.
Assisted-by: Codex
[MLIR][CMake] Stop depending on mlir-generic-headers by default
Remove the default mlir-generic-headers dependency from ordinary and
example libraries, and migrate their generated-interface requirements to
library owners. Keep the compatibility aggregate and registrations.
MLIRIR now owns MLIRInferIntRangeInterfaceIncGen, which Matchers.h
includes. Add the Transform/Interfaces generator-to-generator
dependency. MLIRDialectUtils switches from MLIRArithOpsIncGen to
COMPILE_ONLY:MLIRArithDialect because ReshapeOpsUtils.h includes
Arith.h.
Extend the release note and aggregate regression test.
Assisted-by: Codex
[CMake] Migrate CIR and Flang generated-header dependencies
Replace CIR's mlir-headers dependencies and Flang's global MLIR library
lists with their actual library dependencies. Let owners provide
generated headers through the link graph, and remove duplicate ordering
dependencies on foreign IncGen targets.
Declare CIR interface and header ownership explicitly. Keep source
shards, bytecode tables and lowering tables private to their consumers.
Scope accumulated TableGen variables and keep implementation-only
lowering tables out of Clang's global TableGen aggregate.
Include only the dialects and conversion passes registered by Flang.
Preserve the supported registrations and retain MLIR_DEPS for downstream
compatibility. Use compile-only owner links for header-only
dependencies.
Assisted-by: Codex
[MLIR][CMake] Stop depending on mlir-headers by default
Remove the default mlir-headers dependency from the dialect, conversion,
extension, and translation library helpers. Keep the aggregate target,
its registrations, and explicit compatibility dependencies available.
Replace redundant foreign generator edges with actual library links or
compile-only header owners. Add generator-to-generator add_dependencies
edges when one generated header includes another. Add regression
coverage that rejects an implicit dependency on the aggregate.
Add a release note explaining downstream migration, the temporary
DEPENDS mlir-headers fallback, and clean generated-file dependency
audits.
Assisted-by: Codex
[mlir][vector] Require matching element types for vector xfers (#239164)
`vector.transfer_read` and `vector.transfer_write` currently accept
source and vector types with different elemental types when their
bitwidths are compatible. This packing behavior is not supported by the
Vector dialect.
With this PR, we require source and vector elemental types to match, and
update the affected tests to reject unsupported transfers.
This also removes outdated packing cases from:
- `mlir/test/Dialect/Vector/ops.mlir`
- `mlir/test/Dialect/Vector/vector-transfer-permutation-lowering.mlir`
Fixes: #237545
---------
Signed-off-by: Federico Bruzzone <federico.bruzzone.i at gmail.com>
[docs] Update AI tool policy for textual communication (#243459)
Update the AI tool policy for the approved RFC:
https://discourse.llvm.org/t/rfc-forbid-ai-generated-communication/92414
The tl;dr is that PR descriptions must be human-written, and we have
stronger restrictions on LLM-generated text in other communication
channels.
I mostly tried to preserve the old text and put this into a new section.
Additionally, as the policy is getting quite long, I've added a summary
of the points that are most likely to be relevant to people. In the
interest of brevity, the summary intentionally omits the finer details,
so if someone wants to know if their use of LLM translation is allowed,
they'll just have to read the full policy.
Revert "[AArch64][GlobalISel] Turn ANDs that keep the low bits of a vector into fmov (#243591)" (#248834)
This reverts commit d97c4a496eeaf325f5303519e747967b681c29db, which
broke check-llvm:
FAIL: LLVM :: CodeGen/AArch64/and-keep-low-bits.ll
Commit ce6bab09e864bb4462487ebf995dd91a0dd88662 (#240841) already
rewrites the single-lane zero mask in and_v2i64_keep_low_64 into
G_INSERT_VECTOR_ELT during AArch64PostLegalizerCombiner. That pass
runs before AArch64PostLegalizerLowering. As a result, GlobalISel
emits:
mov v0.d[1], xzr
The test expects:
fmov d0, d0
[4 lines not shown]
[LoongArch] Support memcmp expansion for vectors and combine for i128/i256 setcc
This commit enables memcmp expansion for lsx/lasx. After doing
this, i128 and i256 loads which are illegal types on LoongArch
will be generated. Without process, they will be splited to
legal scalar type.
So this commit also enable combination for `setcc` to bitcast
i128/i256 types to vector types before type legalization and
generate vector instructions.
Inspired by x86 and riscv.
[mlir][ArmSME] Legalize writes in `vector.mask` (#246947)
ArmSME legalization creates new ops inside a `vector.mask` region which
is invalid IR.
A write has no passthru, so `vector.mask { transfer_write }` is
equivalent to the mask operand.
The patterns now take the mask from the _operand_ (will be deleted via
#239511) or from the enclosing `vector.mask`, and replace the
`Xfer_write` first and then the `vector.mask`.
Part of #239511 and #240114 (item 16).
RFC:
https://discourse.llvm.org/t/rfc-unify-masking-in-the-vector-dialect/92675
This supersedes the bailouts of #246463.
---------
Signed-off-by: Federico Bruzzone <federico.bruzzone.i at gmail.com>
[mlir][linalg] Add `operands_to_pack` to `structured.pack` (#241195)
`linalg.pack` packs every operand that uses a packed iterator dimension,
so there is no way to pack only some of the operands of an op.
With this PR we add an optional list of operand numbers,
`operands_to_pack`. If it is absent, all operands are packed as before.
If it is present, only the listed operands are packed. Every other
operand is not packed: its packed dimensions are split in place into
`[outer, inner]` with a `tensor.expand_shape`, and the result for an
init is collapsed back with a `tensor.collapse_shape` - i.e., no data is
moved.
The tile sizes must be constants. The packed dimensions of an unpacked
operand may be static or dynamic. A static one must be a multiple of its
tile, otherwise the pack fails. A dynamic one cannot be checked: it is
assumed to be a multiple, which the payload must guarantee, otherwise is
UB.
[20 lines not shown]
[NFC][clang][test] Rename strlen-inline-builtin.c to inline-builtin-attrs.c (#248820)
The file will also test other attributes on inline builtins.
Assisted-by: Gemini
jj: updated to 0.48.0
0.48.0
Release highlights
* `jj bookmark set` and `jj bookmark move` now always move bookmarks backwards
or sideways. The `--allow-backwards` flag for `jj bookmark set` and `jj
bookmark move` is now a no-op.
* The graph lines in `jj log`, `jj evolog`, `jj op log`, `jj op show`, and
`jj op diff` can now be colored. Each line uses one of the labels
`graph line0` to `graph line11`, and keeps its label when it moves to another
column. The labels have no color by default. Set them in the `[colors]` table
to turn the colors on. Node symbols also receive the `graph` and line labels.
Breaking changes
* `jj bookmark set` and `jj bookmark move` now move bookmarks backwards or
[110 lines not shown]
18822 smatch: __builtin_bswap*() is not a no-op
Reviewed by: Bill Sommerfeld <sommerfeld at hamachi.org>
Approved by: Dan McDonald <danmcd at oxide.computer>
[LoongArch] Enable SelectOptimize for LA464 and LA664 (#233466)
Enable SelectOptimize for LA464/LA664 under O3 by default, which will
convert select or select-like instructions, e.g. `or(zext(icmp))`, back
to branch for better use the CPU's speculative execution. See
https://github.com/llvm/llvm-project/pull/77284 and
[D138990](https://reviews.llvm.org/D138990) for more detailed
explaination.
The up-coming [LoongArch sched-model
PR](https://github.com/llvm/llvm-project/pull/226064) has introduced
`MispredictPenalty = 14` for LA464 and LA664, which will have some
impact on the heuristic algorithm of this pass, but I didn't see any
changes in SPEC CPU2006.
Here are the SPEC CPU2006 results, running on Loongson 3B6000, with
`-mtune=la664 -O3 -mlsx -fuse-ld=lld`. Only benchmarks which codes
changed after the pass are listed:
[31 lines not shown]
xz: updated to 5.8.5
5.8.5 (2026-12-03)
IMPORTANT: This includes security fixes. These and a few other fixes
have also been committed to the old stable branches (v5.2, v5.4, and
v5.6) in the xz Git repository. Those fixes are marked below. No new
5.2.x, 5.4.x, or 5.6.x releases will be made.
* liblzma:
- Fix a data corruption bug in the LZMA2 encoder. The issue was
found via code analysis; no one has reported actual data
corruption. Creating a test file to trigger this bug isn't
straightforward, and at the time of this release, no such
files are known.
If the bug is triggered in a debug build, an assertion will
fail. In non-debug builds, a corrupt file is created. It
[168 lines not shown]