[all-commits] [llvm/llvm-project] d7c53a: [mlir] Decouple enum generation from attributes, a...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Thu Mar 27 17:40:28 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d7c53a91c2c11439429bbd50bb1d0a202c553a47
      https://github.com/llvm/llvm-project/commit/d7c53a91c2c11439429bbd50bb1d0a202c553a47
  Author: Krzysztof Drewniak <krzysdrewniak at gmail.com>
  Date:   2025-03-27 (Thu, 27 Mar 2025)

  Changed paths:
    M mlir/docs/DefiningDialects/Operations.md
    M mlir/include/mlir/IR/EnumAttr.td
    M mlir/include/mlir/TableGen/EnumInfo.h
    M mlir/lib/TableGen/EnumInfo.cpp
    M mlir/lib/TableGen/Pattern.cpp
    M mlir/test/Dialect/LLVMIR/func.mlir
    M mlir/test/IR/attribute.mlir
    M mlir/test/lib/Dialect/Test/TestEnumDefs.td
    M mlir/test/mlir-tblgen/enums-gen.td
    M mlir/tools/mlir-tblgen/EnumPythonBindingGen.cpp
    M mlir/tools/mlir-tblgen/EnumsGen.cpp
    M mlir/tools/mlir-tblgen/OpDocGen.cpp
    M mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
    M mlir/utils/spirv/gen_spirv_dialect.py

  Log Message:
  -----------
  [mlir] Decouple enum generation from attributes, adding EnumInfo and EnumCase (#132148)

This commit pulls apart the inherent attribute dependence of classes
like EnumAttrInfo and EnumAttrCase, factoring them out into simpler
EnumCase and EnumInfo variants. This allows specifying the cases of an
enum without needing to make the cases, or the EnumInfo itself, a
subclass of SignlessIntegerAttrBase.

The existing classes are retained as subclasses of the new ones, both
for backwards compatibility and to allow attribute-specific information.

In addition, the new BitEnum class changes its default printer/parser
behavior: cases when multiple keywords appear, like having both nuw and
nsw in overflow flags, will no longer be quoted by the operator<<, and
the FieldParser instance will now expect multiple keywords. All
instances of BitEnumAttr retain the old behavior.



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