LLVM/project ff93bd2mlir/include/mlir/Bindings/Python IRAttributes.h, mlir/lib/Bindings/Python IRCore.cpp IRAffine.cpp

[mlir][python] Fix Python binding cast diagnostics for nanobind 2.13

nanobind 2.13.0 changed failing `nb::cast<T>()` to raise `cast_error`
(an alias for `std::bad_cast`) for all failures, including `None`,
instead of the previous distinct exception types. The bindings relied
on catching `std::runtime_error` separately from `cast_error` to emit a
helpful "(None?)" hint, so that branch became dead code and the `None`
diagnostics regressed (e.g. "(std::bad_cast)" instead of "(None?)"),
breaking check-mlir Python tests.

Decide the `None` hint from the value via `is_none()` rather than the
exception type. This is robust across nanobind versions (2.10-2.13).

Fixes #205329
DeltaFile
+7-7mlir/lib/Bindings/Python/IRCore.cpp
+7-6mlir/include/mlir/Bindings/Python/IRAttributes.h
+6-5mlir/lib/Bindings/Python/IRAffine.cpp
+20-183 files

LLVM/project e568ab3llvm/lib/CodeGen MachineBasicBlock.cpp

[CodeGen] Search predecessors from the back in removePredecessor() (#206070)

In many passes involving CFG updates, it is a common pattern to process
the Predecessors vector from back to front for efficiency. However, the
current forward search in removePredecessor often results in an O(N)
complexity.

So this patch tries to change the search logic to a reverse search to
better align with the majority of actual CFG manipulation scenarios.
And in a real-world case (with ~16k predecessors), this modification can
help to reduce the execution time of the BranchFolder pass from
166.4951s to 6.0717s.

---------

Co-authored-by: Reid Kleckner <rkleckner at nvidia.com>
DeltaFile
+6-3llvm/lib/CodeGen/MachineBasicBlock.cpp
+6-31 files

LLVM/project 8a36dcfllvm/lib/Target/AArch64 AArch64InstrFormats.td AArch64InstrInfo.td, llvm/lib/Target/AArch64/MCTargetDesc AArch64InstPrinter.cpp

fixup! Model GCS sysl insns properly
DeltaFile
+31-41llvm/lib/Target/AArch64/AArch64InstrFormats.td
+17-0llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+1-4llvm/lib/Target/AArch64/AArch64InstrInfo.td
+1-1llvm/test/tools/llvm-mca/AArch64/Neoverse/V1-misc-instructions.s
+50-464 files

LLVM/project af06d2ellvm/lib/Target/AArch64 AArch64InstrFormats.td

fixup! Add mayLoad/mayStore
DeltaFile
+3-0llvm/lib/Target/AArch64/AArch64InstrFormats.td
+3-01 files

LLVM/project a6aa65ellvm/lib/Target/AArch64 AArch64RegisterInfo.td AArch64InstrInfo.td, llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp

fixup! Address Marian's comments
DeltaFile
+20-19llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+7-1llvm/lib/Target/AArch64/AArch64RegisterInfo.td
+4-2llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
+3-2llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+1-1llvm/lib/Target/AArch64/AArch64InstrInfo.td
+35-255 files

LLVM/project a5d5d1dmlir/include/mlir-c Rewrite.h, mlir/lib/CAPI/Transforms Rewrite.cpp

[mlir-c] Add ConversionTarget dynamic legality C API

Add mlirConversionTargetAddDynamicallyLegalOp,
mlirConversionTargetAddDynamicallyLegalDialect,
mlirConversionTargetMarkOpRecursivelyLegal, and
mlirConversionTargetMarkUnknownOpDynamicallyLegal to enable
per-instance legality callbacks from C.
DeltaFile
+149-0mlir/test/CAPI/rewrite.c
+44-0mlir/lib/CAPI/Transforms/Rewrite.cpp
+28-0mlir/include/mlir-c/Rewrite.h
+221-03 files

LLVM/project fe4ee66llvm/lib/Target/AArch64 AArch64InstrInfo.td AArch64InstrFormats.td, llvm/test/MC/AArch64 arm64-aliases.s

[AArch64] Define GCS operations as SYS and SYSL aliases

Move the remaining `GCS` instructions from dedicated opcodes to `SYSxt/SYSLxt`
aliases, keeping a tied `SYSL` pseudo for codegen where `GCS` preserves the`
input register when disabled at runtime.

Update `GCS` intrinsic selection, scheduling, disassembly aliases, and MC
coverage for the generic `SYS/SYSL` encodings.
DeltaFile
+23-49llvm/lib/Target/AArch64/AArch64InstrInfo.td
+27-0llvm/test/MC/AArch64/arm64-aliases.s
+19-4llvm/lib/Target/AArch64/AArch64InstrFormats.td
+9-3llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
+78-564 files

LLVM/project 07d95ballvm/lib/Target/AArch64 AArch64InstrFormats.td AArch64ISelDAGToDAG.cpp

fixup! Address CR comments
DeltaFile
+4-6llvm/lib/Target/AArch64/AArch64InstrFormats.td
+3-0llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
+7-62 files

LLVM/project 9fd6933llvm/lib/Target/LoongArch LoongArchISelLowering.cpp, llvm/test/CodeGen/LoongArch/lasx/ir-instruction sitofp.ll uitofp.ll

[LoongArch] Use vector extend for sitofp/uitofp (#202496)

Called sign/zero extend first in `performS[U]INT_TO_FPCombine` before
doing vector sitofp/uitofp, which avoid inefficient scalarization.
DeltaFile
+169-0llvm/test/CodeGen/LoongArch/lsx/ir-instruction/sitofp.ll
+135-0llvm/test/CodeGen/LoongArch/lasx/ir-instruction/sitofp.ll
+60-0llvm/test/CodeGen/LoongArch/lsx/ir-instruction/uitofp.ll
+53-0llvm/test/CodeGen/LoongArch/lasx/ir-instruction/uitofp.ll
+40-0llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+457-05 files

LLVM/project 24fb629llvm/lib/Target/LoongArch LoongArchISelLowering.cpp LoongArchLASXInstrInfo.td, llvm/test/CodeGen/LoongArch pr177863.ll

[LoongArch] Legalize LASX truncate with XVPICKEV instruction (#202485)

Add LASX truncate patterns for wide truncates (e.g. `v8i64 trunc to
v8i8`) with `XVPICKEV` instructions.

To merge two registers into one, return concat_vectors as is while its
two operations are `ISD::TRUNCATE`, also dealing with illegal results in
`ReplaceNodeResults`.
DeltaFile
+348-0llvm/test/CodeGen/LoongArch/lasx/vec-trunc-combine.ll
+31-40llvm/test/CodeGen/LoongArch/lasx/vxi1-masks.ll
+18-33llvm/test/CodeGen/LoongArch/lasx/xvmskcond.ll
+6-18llvm/test/CodeGen/LoongArch/pr177863.ll
+22-0llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+19-0llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
+444-916 files

LLVM/project f892160clang/include/clang/AST OpenMPClause.h

[Clang][OpenMP] Remove unnecessary LParentLoc in ThreadLimit and NumTeams clauses

The LParentLoc is already a field of the OMPVarListClause class. The ThreadLimit
and NumTeams clause classes should not need to define it.
DeltaFile
+0-18clang/include/clang/AST/OpenMPClause.h
+0-181 files

LLVM/project 006f5famlir/include/mlir-c Rewrite.h, mlir/lib/CAPI/Transforms Rewrite.cpp

[mlir-c] Add ConversionTarget dynamic legality C API

Add mlirConversionTargetAddDynamicallyLegalOp,
mlirConversionTargetAddDynamicallyLegalDialect,
mlirConversionTargetMarkOpRecursivelyLegal, and
mlirConversionTargetMarkUnknownOpDynamicallyLegal to enable
per-instance legality callbacks from C.
DeltaFile
+58-0mlir/test/CAPI/rewrite.c
+44-0mlir/lib/CAPI/Transforms/Rewrite.cpp
+28-0mlir/include/mlir-c/Rewrite.h
+130-03 files

LLVM/project 1c6cf4blldb/test/Shell/Commands command-disassemble-aarch64-extensions.s command-disassemble-aarch64-color.s, llvm/lib/Target/AArch64 AArch64InstrFormats.td

fixup! Update diff because SYSP definition has changed
DeltaFile
+126-114llvm/test/MC/AArch64/armv9a-sysp.s
+19-21llvm/test/MC/AArch64/armv9-sysp-diagnostics.s
+7-32llvm/lib/Target/AArch64/AArch64InstrFormats.td
+2-11llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+2-2lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s
+2-2lldb/test/Shell/Commands/command-disassemble-aarch64-color.s
+158-1822 files not shown
+159-1878 files

LLVM/project 751a37allvm/lib/Target/AArch64 AArch64InstrFormats.td AArch64RegisterInfo.td, llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp

fixup! More optimisations spotted by Marian after the specs changed
DeltaFile
+40-42llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+24-43llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+16-30llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
+5-6llvm/lib/Target/AArch64/AArch64InstrFormats.td
+4-5llvm/lib/Target/AArch64/AArch64RegisterInfo.td
+1-3llvm/lib/Target/AArch64/AArch64InstrInfo.td
+90-1291 files not shown
+91-1307 files

LLVM/project ed3cf41llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp, llvm/test/MC/AArch64 armv9a-tlbip.s

fixup! Address Carol's PR comments
DeltaFile
+5-0llvm/test/MC/AArch64/armv9a-tlbip.s
+3-0llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+8-02 files

LLVM/project d6c88c0llvm/lib/Target/AArch64/MCTargetDesc AArch64InstPrinter.cpp

fixup! Address PR comment about shortened `sysp` with xzr/xzr
DeltaFile
+17-16llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+17-161 files

LLVM/project 4356faellvm/lib/Target/AArch64 AArch64RegisterInfo.td, llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp

fixup! Implement Marian's suggestion to implement as XSeqPairsClass + [XZR, XZR]
DeltaFile
+54-82llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+35-73llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+12-9llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
+8-1llvm/lib/Target/AArch64/AArch64RegisterInfo.td
+0-7llvm/test/MC/AArch64/armv9a-sysp.s
+1-3llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.h
+110-1756 files

LLVM/project 211cbafllvm/lib/Target/AArch64 AArch64InstrFormats.td

fixup! Remove superfluous code
DeltaFile
+0-7llvm/lib/Target/AArch64/AArch64InstrFormats.td
+0-71 files

LLVM/project ea24c5cllvm/lib/Target/AArch64 AArch64InstrFormats.td, llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp

fixup! Address PR comments
DeltaFile
+5-9llvm/lib/Target/AArch64/AArch64InstrFormats.td
+2-3llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+1-2llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
+1-1llvm/test/MC/AArch64/armv9-sysp-diagnostics.s
+9-154 files

LLVM/project f2a1225llvm/lib/Target/AArch64 AArch64InstrFormats.td

fixup! Fixes after rebasing following Marian's change
DeltaFile
+3-3llvm/lib/Target/AArch64/AArch64InstrFormats.td
+3-31 files

LLVM/project 7225239llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp, llvm/test/MC/AArch64 armv9-sysp-diagnostics.s

fixup! Improve error parsing
DeltaFile
+46-25llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+12-12llvm/test/MC/AArch64/armv9-sysp-diagnostics.s
+58-372 files

LLVM/project 5a9adb2llvm/lib/Target/AArch64 AArch64InstrFormats.td, llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp

fixup! Templatise bounds checking and improve tests
DeltaFile
+15-4llvm/test/MC/AArch64/armv9-sysp-diagnostics.s
+18-0llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+12-5llvm/lib/Target/AArch64/AArch64InstrFormats.td
+0-8llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+45-174 files

LLVM/project 6ab1118llvm/lib/Target/AArch64/MCTargetDesc AArch64InstPrinter.cpp, llvm/test/MC/AArch64 armv9a-sysp.s

fixup! Add no-alias tests
DeltaFile
+4-3llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+7-0llvm/test/MC/AArch64/armv9a-sysp.s
+11-32 files

LLVM/project 319350cllvm/lib/Target/AArch64 AArch64InstrInfo.td, llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp

fixup! Remove SYSPxt_XZR and update code to reflect this
DeltaFile
+27-34llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+41-14llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+8-26llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
+2-30llvm/lib/Target/AArch64/AArch64InstrInfo.td
+0-20llvm/test/MC/AArch64/armv9-sysp-invalid.s
+13-3llvm/test/MC/AArch64/armv9-sysp-diagnostics.s
+91-1274 files not shown
+105-13710 files

LLVM/project 50bf24cllvm/lib/Target/AArch64 AArch64InstrFormats.td AArch64InstrInfo.td

fixup! Address Marian's PR comments: use imm0_6 predicate
DeltaFile
+9-1llvm/lib/Target/AArch64/AArch64InstrFormats.td
+2-2llvm/lib/Target/AArch64/AArch64InstrInfo.td
+11-32 files

LLVM/project 746c221llvm/lib/Target/AArch64 AArch64InstrFormats.td AArch64InstrInfo.td, llvm/lib/Target/AArch64/Disassembler AArch64Disassembler.cpp

[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
DeltaFile
+111-111llvm/test/MC/AArch64/armv9a-sysp.s
+25-1llvm/lib/Target/AArch64/AArch64InstrFormats.td
+25-0llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
+20-0llvm/test/MC/AArch64/armv9-sysp-invalid.s
+7-8llvm/test/MC/AArch64/armv9-sysp-diagnostics.s
+7-3llvm/lib/Target/AArch64/AArch64InstrInfo.td
+195-1233 files not shown
+207-1279 files

LLVM/project 4a58bc9mlir/include/mlir-c Dominance.h, mlir/include/mlir/CAPI Dominance.h

[mlir-c] Add DominanceInfo and PostDominanceInfo C API bindings

Expose DominanceInfo and PostDominanceInfo through the MLIR C API with
operation/block/value dominance queries, nearest common dominator,
reachability, and invalidation.
DeltaFile
+160-0mlir/test/CAPI/ir.c
+125-0mlir/include/mlir-c/Dominance.h
+106-0mlir/lib/CAPI/IR/Dominance.cpp
+19-0mlir/include/mlir/CAPI/Dominance.h
+1-0mlir/lib/CAPI/IR/CMakeLists.txt
+411-05 files

LLVM/project 9266407mlir/include/mlir-c Dominance.h, mlir/include/mlir/CAPI Dominance.h

[mlir-c] Add DominanceInfo and PostDominanceInfo C API bindings

Expose DominanceInfo and PostDominanceInfo through the MLIR C API with
operation/block/value dominance queries, nearest common dominator,
reachability, and invalidation.
DeltaFile
+160-0mlir/test/CAPI/ir.c
+125-0mlir/include/mlir-c/Dominance.h
+106-0mlir/lib/CAPI/IR/Dominance.cpp
+19-0mlir/include/mlir/CAPI/Dominance.h
+1-0mlir/lib/CAPI/IR/CMakeLists.txt
+411-05 files

LLVM/project 8b677ebllvm/lib/Target/AArch64 AArch64SystemOperands.td AArch64InstrFormats.td, llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp

[AArch64][llvm] Implement HINT instructions as aliases (NFCI)

Implement some `HINT`-space encodings as aliases of `HINT`
instead of dedicated instructions. Re-implement these isns:
  * bti
  * psb
  * stshh
  * stcph
  * shuh
  * tsb

Parse aliases explicitly in `AArch64AsmParser::parseHintAlias()` as they
have custom operands. Remove the (now unused) `PSB`, `BTI`, `CMH`, `PHint`
and `TSB` tablegen defs, operand classes, parser hooks and printer helpers.

Also, tighten the BTI check in the parser. The old bitmask matched non-BTI
`HINT` immediates such as `shuh/stcph`; use an exact BTI HINT encoding
check instead (`isHintSpaceBTI()`)


    [9 lines not shown]
DeltaFile
+147-267llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+0-152llvm/lib/Target/AArch64/AArch64SystemOperands.td
+0-103llvm/lib/Target/AArch64/AArch64InstrFormats.td
+6-51llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h
+3-52llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+21-24llvm/lib/Target/AArch64/AArch64InstrInfo.td
+177-64913 files not shown
+248-70319 files

LLVM/project 49cf5a7clang-tools-extra/clangd CodeComplete.cpp

[clangd] Remove unused onlyValue<bool> overload (NFC) (#206312)

BundledEntry has three `std::string` members and no bool member, so the
bool overload of onlyValue can never be instantiated. It has been dead
since it was added and trips -Wunused-template.

NFC. Part of #202945.
DeltaFile
+0-8clang-tools-extra/clangd/CodeComplete.cpp
+0-81 files