This interface is implemented by memref.dim and tensor.dim. This change makes it possible to remove a build dependency of the Affine dialect on the Tensor dialect (and maybe also the MemRef dialect in the future).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Interfaces/ShapedOpInterfaces.h | ||
---|---|---|
2 | Nit: this line needs to have -*- C++ -*- somewhere to allow some editors to differentiate C and C++ headers. | |
22 | Nit: this needs a doc comment. | |
mlir/include/mlir/Interfaces/ShapedOpInterfaces.td | ||
24 | Bikeshed: how about ShapedDimOpInterface? Makes it clear where the op belongs and the "something-like" implies the reader has previous knowledge of "something". | |
mlir/lib/Interfaces/ShapedOpInterfaces.cpp | ||
19–23 | Are these tested somewhere? |
Thanks much @springerm , LGTM once other comments are addressed.
mlir/lib/Dialect/Affine/IR/AffineOps.cpp | ||
---|---|---|
11–12 | What is still required to sever this dependence? |
address comments
mlir/lib/Dialect/Affine/IR/AffineOps.cpp | ||
---|---|---|
11–12 | There are references to memref::CastOp, memref::GetGlobalOp, memref::ViewOp, memref::SubViewOp, memref::AllocOp in AffineOps.cpp. Functions that must be updated: AffineLoadOp::fold, AffineStoreOp::fold and isDimOpValidSymbol. Not sure how easy/difficult this would be. The folders are basically cross-dialect canonicalizations. | |
mlir/lib/Interfaces/ShapedOpInterfaces.cpp | ||
19–23 | It is not tested at the moment. Requires a fair bit of boilerplate code to set up dummy ops etc., so not worth it IMO. I can add a test case in a follow-up change if you'd prefer to have one. |
Missing doc comments.