[all-commits] [llvm/llvm-project] 97eb8b: [mlir][tblgen] Warn about the deprecated multi-res...

Victor Perez via All-commits all-commits at lists.llvm.org
Sat Oct 3 13:01:57 PDT 2026


  Branch: refs/heads/users/victor-eds/fold-results-09-tblgen-warning
  Home:   https://github.com/llvm/llvm-project
  Commit: 97eb8b9bafde398610322cd2fa8a3e26cf0e0f74
      https://github.com/llvm/llvm-project/commit/97eb8b9bafde398610322cd2fa8a3e26cf0e0f74
  Author: Víctor Pérez Carrasco <victor.pc.upm at gmail.com>
  Date:   2026-10-03 (Sat, 03 Oct 2026)

  Changed paths:
    M mlir/docs/Canonicalization.md
    M mlir/docs/DefiningDialects/_index.md
    M mlir/include/mlir/Tools/mlir-tblgen/MlirTblgenMain.h
    M mlir/lib/Tools/mlir-tblgen/MlirTblgenMain.cpp
    A mlir/test/mlir-tblgen/op-fold-results-deprecation.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir][tblgen] Warn about the deprecated multi-result fold form

The legacy form `LogicalResult fold(FoldAdaptor,
SmallVectorImpl<OpFoldResult> &)` will be removed. This patch makes
`mlir-tblgen -gen-op-decls` warn when a dialect keeps `useOpFoldResults`
at 0 and has an op with `hasFolder` that does not have exactly one fixed
result. The warning points at the dialect definition. A note names the
first op that uses the legacy form.

The warning comes once for each dialect in one `-gen-op-decls` run. A
dialect with ops in more than one `.td` file can warn once for each file
that contains such an op. `-gen-op-defs` does not warn.

No in-tree dialect warns, because each in-tree dialect with such an op
already sets the bit.

The diagnostic follows the `-on-deprecated` option: `none` silences it,
`warn` (the default) warns, and `error` reports an error and fails the
run. `MlirTblgenMain.h` exposes the option value through
`getActionOnDeprecated()`.

Signed-off-by: Víctor Pérez Carrasco <victor.pc.upm at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list