[all-commits] [llvm/llvm-project] 34a35a: [mlir] Move FunctionInterfaces to Interfaces direc...

Martin Erhart via All-commits all-commits at lists.llvm.org
Thu Aug 31 04:29:20 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 34a35a8b244243f5a4ad5d531007bccfeaa0b02e
      https://github.com/llvm/llvm-project/commit/34a35a8b244243f5a4ad5d531007bccfeaa0b02e
  Author: Martin Erhart <merhart at google.com>
  Date:   2023-08-31 (Thu, 31 Aug 2023)

  Changed paths:
    M mlir/docs/Interfaces.md
    M mlir/docs/Tutorials/Toy/Ch-4.md
    M mlir/examples/toy/Ch2/CMakeLists.txt
    M mlir/examples/toy/Ch2/include/toy/Dialect.h
    M mlir/examples/toy/Ch2/include/toy/Ops.td
    M mlir/examples/toy/Ch2/mlir/Dialect.cpp
    M mlir/examples/toy/Ch3/CMakeLists.txt
    M mlir/examples/toy/Ch3/include/toy/Dialect.h
    M mlir/examples/toy/Ch3/include/toy/Ops.td
    M mlir/examples/toy/Ch3/mlir/Dialect.cpp
    M mlir/examples/toy/Ch4/CMakeLists.txt
    M mlir/examples/toy/Ch4/include/toy/Dialect.h
    M mlir/examples/toy/Ch4/include/toy/Ops.td
    M mlir/examples/toy/Ch4/mlir/Dialect.cpp
    M mlir/examples/toy/Ch5/CMakeLists.txt
    M mlir/examples/toy/Ch5/include/toy/Dialect.h
    M mlir/examples/toy/Ch5/include/toy/Ops.td
    M mlir/examples/toy/Ch5/mlir/Dialect.cpp
    M mlir/examples/toy/Ch6/CMakeLists.txt
    M mlir/examples/toy/Ch6/include/toy/Dialect.h
    M mlir/examples/toy/Ch6/include/toy/Ops.td
    M mlir/examples/toy/Ch6/mlir/Dialect.cpp
    M mlir/examples/toy/Ch7/CMakeLists.txt
    M mlir/examples/toy/Ch7/include/toy/Dialect.h
    M mlir/examples/toy/Ch7/include/toy/Ops.td
    M mlir/examples/toy/Ch7/mlir/Dialect.cpp
    M mlir/include/mlir/Conversion/SCFToGPU/SCFToGPUPass.h
    M mlir/include/mlir/Dialect/Async/IR/Async.h
    M mlir/include/mlir/Dialect/Async/IR/AsyncOps.td
    M mlir/include/mlir/Dialect/Func/IR/FuncOps.h
    M mlir/include/mlir/Dialect/Func/IR/FuncOps.td
    M mlir/include/mlir/Dialect/GPU/IR/GPUDialect.h
    M mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Dialect/MLProgram/IR/MLProgram.h
    M mlir/include/mlir/Dialect/MLProgram/IR/MLProgramOps.td
    M mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterp.h
    M mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td
    M mlir/include/mlir/Dialect/Shape/IR/Shape.h
    M mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
    M mlir/include/mlir/Dialect/Transform/IR/TransformOps.h
    M mlir/include/mlir/Dialect/Transform/IR/TransformOps.td
    M mlir/include/mlir/IR/CMakeLists.txt
    R mlir/include/mlir/IR/FunctionImplementation.h
    R mlir/include/mlir/IR/FunctionInterfaces.h
    R mlir/include/mlir/IR/FunctionInterfaces.td
    M mlir/include/mlir/IR/TypeUtilities.h
    M mlir/include/mlir/Interfaces/CMakeLists.txt
    M mlir/include/mlir/Interfaces/CallInterfaces.td
    A mlir/include/mlir/Interfaces/FunctionImplementation.h
    A mlir/include/mlir/Interfaces/FunctionInterfaces.h
    A mlir/include/mlir/Interfaces/FunctionInterfaces.td
    M mlir/lib/Analysis/AliasAnalysis/LocalAliasAnalysis.cpp
    M mlir/lib/Analysis/CMakeLists.txt
    M mlir/lib/Conversion/MemRefToSPIRV/CMakeLists.txt
    M mlir/lib/Conversion/MemRefToSPIRV/MapMemRefStorageClassPass.cpp
    M mlir/lib/Dialect/Async/IR/Async.cpp
    M mlir/lib/Dialect/Async/IR/CMakeLists.txt
    M mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
    M mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
    M mlir/lib/Dialect/Async/Transforms/CMakeLists.txt
    M mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp
    M mlir/lib/Dialect/Bufferization/IR/CMakeLists.txt
    M mlir/lib/Dialect/Bufferization/TransformOps/BufferizationTransformOps.cpp
    M mlir/lib/Dialect/Bufferization/TransformOps/CMakeLists.txt
    M mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
    M mlir/lib/Dialect/Func/IR/CMakeLists.txt
    M mlir/lib/Dialect/Func/IR/FuncOps.cpp
    M mlir/lib/Dialect/GPU/CMakeLists.txt
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Dialect/LLVMIR/CMakeLists.txt
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/Linalg/IR/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/IR/LinalgDialect.cpp
    M mlir/lib/Dialect/Linalg/TransformOps/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/TransformOps/LinalgMatchOps.cpp
    M mlir/lib/Dialect/MLProgram/IR/CMakeLists.txt
    M mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp
    M mlir/lib/Dialect/PDLInterp/IR/CMakeLists.txt
    M mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp
    M mlir/lib/Dialect/SCF/IR/CMakeLists.txt
    M mlir/lib/Dialect/SCF/IR/SCF.cpp
    M mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt
    M mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
    M mlir/lib/Dialect/SPIRV/IR/TargetAndABI.cpp
    M mlir/lib/Dialect/Shape/IR/CMakeLists.txt
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/Dialect/Transform/IR/CMakeLists.txt
    M mlir/lib/Dialect/Transform/IR/TransformOps.cpp
    M mlir/lib/Dialect/Transform/Transforms/CMakeLists.txt
    M mlir/lib/Dialect/Transform/Transforms/InferEffects.cpp
    M mlir/lib/Dialect/Transform/Transforms/TransformInterpreterPassBase.cpp
    M mlir/lib/IR/BuiltinTypes.cpp
    M mlir/lib/IR/CMakeLists.txt
    R mlir/lib/IR/FunctionImplementation.cpp
    R mlir/lib/IR/FunctionInterfaces.cpp
    M mlir/lib/IR/TypeUtilities.cpp
    M mlir/lib/Interfaces/CMakeLists.txt
    A mlir/lib/Interfaces/FunctionImplementation.cpp
    A mlir/lib/Interfaces/FunctionInterfaces.cpp
    M mlir/lib/Interfaces/LoopLikeInterface.cpp
    M mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
    M mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
    M mlir/lib/Transforms/CMakeLists.txt
    M mlir/lib/Transforms/RemoveDeadValues.cpp
    M mlir/lib/Transforms/Utils/CMakeLists.txt
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    M mlir/lib/Transforms/Utils/InliningUtils.cpp
    M mlir/test/Dialect/LLVMIR/parameter-attrs-invalid.mlir
    M mlir/test/lib/Analysis/CMakeLists.txt
    M mlir/test/lib/Analysis/TestAliasAnalysis.cpp
    M mlir/test/lib/Analysis/TestCFGLoopInfo.cpp
    M mlir/test/lib/Analysis/TestMatchReduction.cpp
    M mlir/test/lib/Dialect/Test/CMakeLists.txt
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/IR/CMakeLists.txt
    M mlir/test/lib/IR/TestFunc.cpp
    M mlir/test/lib/IR/TestMatchers.cpp
    M mlir/test/lib/IR/TestVisitors.cpp
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
    M utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch2/BUILD.bazel
    M utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch3/BUILD.bazel
    M utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel
    M utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel
    M utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel
    M utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel
    M utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel

  Log Message:
  -----------
  [mlir] Move FunctionInterfaces to Interfaces directory and inherit from CallableOpInterface

Functions are always callable operations and thus every operation
implementing the `FunctionOpInterface` also implements the
`CallableOpInterface`. The only exception was the FuncOp in the toy
example. To make implementation of the `FunctionOpInterface` easier,
this commit lets `FunctionOpInterface` inherit from
`CallableOpInterface` and merges some of their methods. More precisely,
the `CallableOpInterface` has methods to get the argument and result
attributes and a method to get the result types of the callable region.
These methods are always implemented the same way as their analogues in
`FunctionOpInterface` and thus this commit moves all the argument and
result attribute handling methods to the callable interface as well as
the methods to get the argument and result types. The
`FuntionOpInterface` then does not have to declare them as well, but
just inherits them from the `CallableOpInterface`.
Adding the inheritance relation also required to move the
`FunctionOpInterface` from the IR directory to the Interfaces directory
since IR should not depend on Interfaces.

Reviewed By: jpienaar, springerm

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




More information about the All-commits mailing list