[all-commits] [llvm/llvm-project] 3e731a: [mlir] Limit Interface generation to the top-level...

River Riddle via All-commits all-commits at lists.llvm.org
Wed Jan 18 19:16:54 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3e731af9124cc74d2276da19031e6dd275a7c33f
      https://github.com/llvm/llvm-project/commit/3e731af9124cc74d2276da19031e6dd275a7c33f
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2023-01-18 (Wed, 18 Jan 2023)

  Changed paths:
    M mlir/docs/Interfaces.md
    M mlir/tools/mlir-tblgen/OpInterfacesGen.cpp

  Log Message:
  -----------
  [mlir] Limit Interface generation to the top-level input file

There are very few instances in which we use multiple files
for interface definitions (none upstream), and this allows
for including interfaces that shouldn't be generated (for
interface inheritance, dependencies, etc.)

Differential Revision: https://reviews.llvm.org/D140196


  Commit: 5cdc2bbc7588e7b046ac5c7f79a84ef18978a83a
      https://github.com/llvm/llvm-project/commit/5cdc2bbc7588e7b046ac5c7f79a84ef18978a83a
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2023-01-18 (Wed, 18 Jan 2023)

  Changed paths:
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/IR/SymbolInterfaces.td
    M mlir/include/mlir/Support/InterfaceSupport.h
    M mlir/include/mlir/TableGen/Format.h
    M mlir/include/mlir/TableGen/Interfaces.h
    M mlir/lib/TableGen/CodeGenHelpers.cpp
    M mlir/lib/TableGen/Format.cpp
    M mlir/lib/TableGen/Interfaces.cpp
    M mlir/test/mlir-tblgen/op-interface.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
    M mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
    M mlir/unittests/TableGen/FormatTest.cpp

  Log Message:
  -----------
  [mlir] Move SymbolOpInterfaces "classof" check to a proper "extraClassOf" interface field

SymbolOpInterface overrides the base classof to provide support
for optionally implementing the interface. This is currently placed
in the extraClassDeclarations, but that is kind of awkard given that
it requires underlying knowledge of how the base classof is implemented.
This commit adds a proper "extraClassOf" field to allow interfaces to
implement this, which abstracts away the default classof logic.

Differential Revision: https://reviews.llvm.org/D140197


  Commit: 83a635c0d4759bd77bbbb21ff8d202cb8c3ea57b
      https://github.com/llvm/llvm-project/commit/83a635c0d4759bd77bbbb21ff8d202cb8c3ea57b
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2023-01-18 (Wed, 18 Jan 2023)

  Changed paths:
    M mlir/docs/Interfaces.md
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/include/mlir/IR/StorageUniquerSupport.h
    M mlir/include/mlir/Support/InterfaceSupport.h
    M mlir/include/mlir/TableGen/Interfaces.h
    M mlir/lib/IR/ExtensibleDialect.cpp
    M mlir/lib/IR/MLIRContext.cpp
    M mlir/lib/Support/InterfaceSupport.cpp
    M mlir/lib/TableGen/AttrOrTypeDef.cpp
    M mlir/lib/TableGen/Interfaces.cpp
    M mlir/lib/TableGen/Operator.cpp
    M mlir/test/lib/Dialect/Test/TestInterfaces.td
    M mlir/test/mlir-tblgen/op-interface.td
    M mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
    M mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp

  Log Message:
  -----------
  [mlir] Add support for interface inheritance

This allows for interfaces to define a set of "base classes",
which are interfaces whose methods/extra class decls/etc.
should be inherited by the derived interface. This more
easily enables combining interfaces and their dependencies,
without lots of awkard casting. Additional implicit conversion
operators also greatly simplify the conversion process.

One other aspect of this "inheritance" is that we also implicitly
add the base interfaces to the attr/op/type. The user can still
add them manually if desired, but this should help remove some
of the boiler plate when an interface has dependencies.

See https://discourse.llvm.org/t/interface-inheritance-and-dependencies-interface-method-visibility-interface-composition

Differential Revision: https://reviews.llvm.org/D140198


  Commit: b2bdb0ba0f6d331844c1b9dcccd522472c7188c9
      https://github.com/llvm/llvm-project/commit/b2bdb0ba0f6d331844c1b9dcccd522472c7188c9
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2023-01-18 (Wed, 18 Jan 2023)

  Changed paths:
    M mlir/examples/toy/Ch2/include/toy/Ops.td
    M mlir/examples/toy/Ch3/include/toy/Ops.td
    M mlir/examples/toy/Ch4/include/toy/Ops.td
    M mlir/examples/toy/Ch5/include/toy/Ops.td
    M mlir/examples/toy/Ch6/include/toy/Ops.td
    M mlir/examples/toy/Ch7/include/toy/Ops.td
    M mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
    M mlir/include/mlir/Dialect/Func/IR/FuncOps.td
    M mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td
    M mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
    M mlir/include/mlir/IR/FunctionInterfaces.td
    M mlir/test/Dialect/Func/invalid.mlir

  Log Message:
  -----------
  [mlir] Make FunctionOpInterface inherit SymbolOpInterface

This lets users of FunctionOpInterface finally have the
name/visibility accessors from SymbolOpInterface. This also
lets us remove the clunky "getName" method from FunctionOpInterface.

Differential Revision: https://reviews.llvm.org/D140199


Compare: https://github.com/llvm/llvm-project/compare/f252333b978c...b2bdb0ba0f6d


More information about the All-commits mailing list