[all-commits] [llvm/llvm-project] fbc253: [mlir] FunctionOpInterface: make get/setFunctionTy...

Jeff Niu via All-commits all-commits at lists.llvm.org
Thu Dec 8 11:32:54 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fbc253fe81da4e1d6bfa2519e01e03f21d8c40a8
      https://github.com/llvm/llvm-project/commit/fbc253fe81da4e1d6bfa2519e01e03f21d8c40a8
  Author: Jeff Niu <jeff at modular.com>
  Date:   2022-12-08 (Thu, 08 Dec 2022)

  Changed paths:
    M mlir/examples/toy/Ch2/mlir/Dialect.cpp
    M mlir/examples/toy/Ch3/mlir/Dialect.cpp
    M mlir/examples/toy/Ch4/mlir/Dialect.cpp
    M mlir/examples/toy/Ch5/mlir/Dialect.cpp
    M mlir/examples/toy/Ch6/mlir/Dialect.cpp
    M mlir/examples/toy/Ch7/mlir/Dialect.cpp
    M mlir/include/mlir/IR/FunctionImplementation.h
    M mlir/include/mlir/IR/FunctionInterfaces.h
    M mlir/include/mlir/IR/FunctionInterfaces.td
    M mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
    M mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp
    M mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
    M mlir/lib/Dialect/Async/IR/Async.cpp
    M mlir/lib/Dialect/Func/IR/FuncOps.cpp
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp
    M mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp
    M mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
    M mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/IR/FunctionImplementation.cpp
    M mlir/lib/IR/FunctionInterfaces.cpp

  Log Message:
  -----------
  [mlir] FunctionOpInterface: make get/setFunctionType interface methods

This patch removes the concept of a `function_type`-named type attribute
as a requirement for implementors of FunctionOpInterface. Instead, this
type should be provided through two interface methods, `getFunctionType`
and `setFunctionTypeAttr` (*Attr because functions may use different
concrete function types), which should be automatically implemented by
ODS for ops that define a `$function_type` attribute.

This also allows FunctionOpInterface to materialize function types if
they don't carry them in an attribute, for example.

Importantly, all the function "helper" still accept an attribute name to
use in parsing and printing functions, for example.

Reviewed By: rriddle, lattner

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


  Commit: 81af171112aec5a4e38fcbc5415b7b10ee31f359
      https://github.com/llvm/llvm-project/commit/81af171112aec5a4e38fcbc5415b7b10ee31f359
  Author: Jeff Niu <jeff at modular.com>
  Date:   2022-12-08 (Thu, 08 Dec 2022)

  Changed paths:
    M mlir/include/mlir/TableGen/Operator.h

  Log Message:
  -----------
  [mlir][ods] Make Operator.h comments triple forward slash (NFC)Depends on D139447

Depends on D139447

Reviewed By: rriddle

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


  Commit: 15511c2e6cc4b0dcba0592bfd3a96b9b6be5db4a
      https://github.com/llvm/llvm-project/commit/15511c2e6cc4b0dcba0592bfd3a96b9b6be5db4a
  Author: Jeff Niu <jeff at modular.com>
  Date:   2022-12-08 (Thu, 08 Dec 2022)

  Changed paths:
    M mlir/include/mlir/TableGen/Operator.h
    M mlir/lib/TableGen/Operator.cpp
    M mlir/test/mlir-tblgen/op-decl-and-defs.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  -----------
  [mlir][ods] Generate remover methods with camelcase

The remove*Attr methods were not being generated with the correct
camelcase method.

Depends on D139470

Reviewed By: rriddle

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


  Commit: dd74e6b6f4fb7a4685086a4895c1934e043f875b
      https://github.com/llvm/llvm-project/commit/dd74e6b6f4fb7a4685086a4895c1934e043f875b
  Author: Jeff Niu <jeff at modular.com>
  Date:   2022-12-08 (Thu, 08 Dec 2022)

  Changed paths:
    M mlir/examples/toy/Ch2/include/toy/Ops.td
    M mlir/examples/toy/Ch2/mlir/Dialect.cpp
    M mlir/examples/toy/Ch3/include/toy/Ops.td
    M mlir/examples/toy/Ch3/mlir/Dialect.cpp
    M mlir/examples/toy/Ch4/include/toy/Ops.td
    M mlir/examples/toy/Ch4/mlir/Dialect.cpp
    M mlir/examples/toy/Ch5/include/toy/Ops.td
    M mlir/examples/toy/Ch5/mlir/Dialect.cpp
    M mlir/examples/toy/Ch6/include/toy/Ops.td
    M mlir/examples/toy/Ch6/mlir/Dialect.cpp
    M mlir/examples/toy/Ch7/include/toy/Ops.td
    M mlir/examples/toy/Ch7/mlir/Dialect.cpp
    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/MLProgram/IR/MLProgramOps.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/FunctionImplementation.h
    M mlir/include/mlir/IR/FunctionInterfaces.h
    M mlir/include/mlir/IR/FunctionInterfaces.td
    M mlir/include/mlir/IR/OpBase.td
    M mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
    M mlir/lib/Dialect/Async/IR/Async.cpp
    M mlir/lib/Dialect/Func/IR/FuncOps.cpp
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp
    M mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp
    M mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/IR/FunctionImplementation.cpp
    M mlir/lib/IR/FunctionInterfaces.cpp
    M mlir/test/IR/invalid-func-op.mlir

  Log Message:
  -----------
  [mlir] FunctionOpInterface: arg and result attrs dispatch to interface

This patch removes the `arg_attrs` and `res_attrs` named attributes as a
requirement for FunctionOpInterface and replaces them with interface
methods for the getters, setters, and removers of the relevent
attributes. This allows operations to use their own storage for the
argument and result attributes.

Depends on D139471

Reviewed By: rriddle

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


Compare: https://github.com/llvm/llvm-project/compare/f9b80ed7fb83...dd74e6b6f4fb


More information about the All-commits mailing list