[mlir] Refactor InterfaceGen to support generating interfaces for Attributes and...
authorRiver Riddle <riddleriver@gmail.com>
Tue, 30 Jun 2020 22:42:52 +0000 (15:42 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 30 Jun 2020 22:52:33 +0000 (15:52 -0700)
commit2e2cdd0a5230790300bdde7e5629fedef36d99b6
tree5b6417b47b77447e6b0929c7f6afbf5d4aa0ac68
parent9fbb2de8e475cbb4ffa71280eb2ddc4922af05f6
[mlir] Refactor InterfaceGen to support generating interfaces for Attributes and Types.

This revision adds support to ODS for generating interfaces for attributes and types, in addition to operations. These interfaces can be specified using `AttrInterface` and `TypeInterface` in place of `OpInterface`. All of the features of `OpInterface` are supported except for the `verify` method, which does not have a matching representation in the Attribute/Type world. Generating these interface can be done using `gen-(attr|type)-interface-(defs|decls|docs)`.

Differential Revision: https://reviews.llvm.org/D81884
28 files changed:
mlir/docs/Interfaces.md
mlir/docs/OpDefinitions.md
mlir/docs/Traits.md
mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td
mlir/include/mlir/IR/OpBase.td
mlir/include/mlir/IR/SymbolInterfaces.td
mlir/include/mlir/Interfaces/CallInterfaces.td
mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
mlir/include/mlir/Interfaces/SideEffectInterfaces.td
mlir/include/mlir/TableGen/Interfaces.h [moved from mlir/include/mlir/TableGen/OpInterfaces.h with 66% similarity]
mlir/include/mlir/TableGen/OpTrait.h
mlir/lib/TableGen/CMakeLists.txt
mlir/lib/TableGen/Interfaces.cpp [moved from mlir/lib/TableGen/OpInterfaces.cpp with 51% similarity]
mlir/lib/TableGen/OpTrait.cpp
mlir/test/lib/Dialect/Test/CMakeLists.txt
mlir/test/lib/Dialect/Test/TestDialect.cpp
mlir/test/lib/Dialect/Test/TestInterfaces.td [new file with mode: 0644]
mlir/test/lib/Dialect/Test/TestOps.td
mlir/test/lib/Dialect/Test/TestTypes.h [new file with mode: 0644]
mlir/test/lib/IR/CMakeLists.txt
mlir/test/lib/IR/TestInterfaces.cpp [new file with mode: 0644]
mlir/test/mlir-tblgen/interfaces.mlir [new file with mode: 0644]
mlir/tools/mlir-opt/mlir-opt.cpp
mlir/tools/mlir-tblgen/DialectGen.cpp
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
mlir/tools/mlir-tblgen/OpFormatGen.cpp
mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp