[mlir][Inliner] Add a `wouldBeCloned` flag to each of the `isLegalToInline` hooks.
authorRiver Riddle <riddleriver@gmail.com>
Thu, 29 Oct 2020 04:48:48 +0000 (21:48 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 29 Oct 2020 04:49:28 +0000 (21:49 -0700)
commitfa4174792a19072e415ea4ba6e7d91af046817c8
tree5c5de67f3476e636aa048e5ae50e4d7c76839622
parent501fda0167341f2db0da5198f70defb017a36178
[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
14 files changed:
mlir/docs/Tutorials/Toy/Ch-4.md
mlir/examples/toy/Ch4/mlir/Dialect.cpp
mlir/examples/toy/Ch5/mlir/Dialect.cpp
mlir/examples/toy/Ch6/mlir/Dialect.cpp
mlir/examples/toy/Ch7/mlir/Dialect.cpp
mlir/include/mlir/Transforms/InliningUtils.h
mlir/lib/Dialect/Affine/IR/AffineOps.cpp
mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp
mlir/lib/Dialect/SCF/SCF.cpp
mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
mlir/lib/Dialect/Shape/IR/Shape.cpp
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
mlir/lib/Transforms/Utils/InliningUtils.cpp
mlir/test/lib/Dialect/Test/TestDialect.cpp