[all-commits] [llvm/llvm-project] 501fda: [mlir][Inliner] Add a new hook for checking if it ...

River Riddle via All-commits all-commits at lists.llvm.org
Wed Oct 28 21:55:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 501fda0167341f2db0da5198f70defb017a36178
      https://github.com/llvm/llvm-project/commit/501fda0167341f2db0da5198f70defb017a36178
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-10-28 (Wed, 28 Oct 2020)

  Changed paths:
    M mlir/docs/Tutorials/Toy/Ch-4.md
    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/Operation.h
    M mlir/include/mlir/Transforms/InliningUtils.h
    M mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/lib/Transforms/Utils/InliningUtils.cpp
    M mlir/test/Transforms/inlining.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.cpp

  Log Message:
  -----------
  [mlir][Inliner] Add a new hook for checking if it is legal to inline a callable into a call

In certain situations it isn't legal to inline a call operation, but this isn't something that is possible(at least not easily) to prevent with the current hooks. This revision adds a new hook so that dialects with call operations that shouldn't be inlined can prevent it.

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


  Commit: fa4174792a19072e415ea4ba6e7d91af046817c8
      https://github.com/llvm/llvm-project/commit/fa4174792a19072e415ea4ba6e7d91af046817c8
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-10-28 (Wed, 28 Oct 2020)

  Changed paths:
    M mlir/docs/Tutorials/Toy/Ch-4.md
    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/Transforms/InliningUtils.h
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp
    M mlir/lib/Dialect/SCF/SCF.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/lib/Transforms/Utils/InliningUtils.cpp
    M mlir/test/lib/Dialect/Test/TestDialect.cpp

  Log Message:
  -----------
  [mlir][Inliner] Add a `wouldBeCloned` flag to each of the `isLegalToInline` hooks.

Often times the legality of inlining can change depending on if the callable is going to be inlined in-place, or cloned. For example, some operations are not allowed to be duplicated and can only be inlined if the original callable will cease to exist afterwards. The new `wouldBeCloned` flag allows for dialects to hook into this when determining legality.

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


Compare: https://github.com/llvm/llvm-project/compare/5be50d79c0b8...fa4174792a19


More information about the All-commits mailing list