[all-commits] [llvm/llvm-project] 9fbb2d: [mlir] Add support for defining Traits and Interfa...

River Riddle via All-commits all-commits at lists.llvm.org
Tue Jun 30 15:52:57 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9fbb2de8e475cbb4ffa71280eb2ddc4922af05f6
      https://github.com/llvm/llvm-project/commit/9fbb2de8e475cbb4ffa71280eb2ddc4922af05f6
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-06-30 (Tue, 30 Jun 2020)

  Changed paths:
    M mlir/include/mlir/IR/AttributeSupport.h
    M mlir/include/mlir/IR/Attributes.h
    M mlir/include/mlir/IR/Dialect.h
    M mlir/include/mlir/IR/StorageUniquerSupport.h
    M mlir/include/mlir/IR/TypeSupport.h
    M mlir/include/mlir/IR/Types.h
    M mlir/lib/IR/Attributes.cpp
    M mlir/lib/IR/MLIRContext.cpp
    M mlir/lib/IR/Types.cpp

  Log Message:
  -----------
  [mlir] Add support for defining Traits and Interfaces on Attributes/Types.

This revisions add mechanisms to Attribute/Type for attaching traits and interfaces. The mechanisms are modeled 1-1 after those for operations to keep the system consistent. AttrBase and TypeBase now accepts a trailing list of `Trait` types that will be attached to the object. These traits should inherit from AttributeTrait::TraitBase and TypeTrait::TraitBase respectively as necessary. A followup commit will refactor the interface gen mechanisms in ODS to support Attribute/Type interface generation and add tests for the mechanisms.

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


  Commit: 2e2cdd0a5230790300bdde7e5629fedef36d99b6
      https://github.com/llvm/llvm-project/commit/2e2cdd0a5230790300bdde7e5629fedef36d99b6
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-06-30 (Tue, 30 Jun 2020)

  Changed paths:
    M mlir/docs/Interfaces.md
    M mlir/docs/OpDefinitions.md
    M mlir/docs/Traits.md
    M mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/IR/SymbolInterfaces.td
    M mlir/include/mlir/Interfaces/CallInterfaces.td
    M mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
    M mlir/include/mlir/Interfaces/SideEffectInterfaces.td
    A mlir/include/mlir/TableGen/Interfaces.h
    R mlir/include/mlir/TableGen/OpInterfaces.h
    M mlir/include/mlir/TableGen/OpTrait.h
    M mlir/lib/TableGen/CMakeLists.txt
    A mlir/lib/TableGen/Interfaces.cpp
    R mlir/lib/TableGen/OpInterfaces.cpp
    M mlir/lib/TableGen/OpTrait.cpp
    M mlir/test/lib/Dialect/Test/CMakeLists.txt
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    A mlir/test/lib/Dialect/Test/TestInterfaces.td
    M mlir/test/lib/Dialect/Test/TestOps.td
    A mlir/test/lib/Dialect/Test/TestTypes.h
    M mlir/test/lib/IR/CMakeLists.txt
    A mlir/test/lib/IR/TestInterfaces.cpp
    A mlir/test/mlir-tblgen/interfaces.mlir
    M mlir/tools/mlir-opt/mlir-opt.cpp
    M mlir/tools/mlir-tblgen/DialectGen.cpp
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
    M mlir/tools/mlir-tblgen/OpFormatGen.cpp
    M mlir/tools/mlir-tblgen/OpInterfacesGen.cpp
    M mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp

  Log Message:
  -----------
  [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


  Commit: 5d699d18b32c0e0c27eceec026ed399e76e7e8ef
      https://github.com/llvm/llvm-project/commit/5d699d18b32c0e0c27eceec026ed399e76e7e8ef
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-06-30 (Tue, 30 Jun 2020)

  Changed paths:
    M mlir/include/mlir/IR/Dialect.h
    M mlir/lib/IR/MLIRContext.cpp

  Log Message:
  -----------
  [mlir] Remove locking for dialect/operation registration.

Moving forward dialects should only be registered in a thread safe context. This matches the existing usage we have today, but it allows for removing quite a bit of expensive locking from the context.

This led to ~.5 a second compile time improvement when running one conversion pass on a very large .mlir file(hundreds of thousands of operations).

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


Compare: https://github.com/llvm/llvm-project/compare/ffa63dde8e97...5d699d18b32c


More information about the All-commits mailing list