[Mlir-commits] [mlir] [mlir] Declare promised interfaces for all dialects (PR #78368)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Feb 19 05:39:37 PST 2024


================
@@ -8,8 +8,11 @@
 
 #include "mlir/Dialect/Affine/IR/AffineOps.h"
 #include "mlir/Dialect/Arith/IR/Arith.h"
+#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h"
 #include "mlir/Dialect/Complex/IR/Complex.h"
 #include "mlir/Dialect/Tensor/IR/Tensor.h"
+#include "mlir/Dialect/Transform/IR/TransformInterfaces.h"
----------------
ftynse wrote:

The issue I see is that we don't want Tensor/IR, or any other dialect definition for that matter, to depend on the Transform dialect. The latter is a sort of utility that would belong to lib/IR or lib/Transforms, but for now matures as a separate dialect and should remain loosely tied to the rest of the infrastructure. So far, this was solved by having Tensor/TransformOps in a separate library that depends on both Transform and Tensor dialects. I'm a bit surprised that we are not running into a dependency cycle here, probably just cmake not modeling header-level dependencies, but other build systems will complain.

I see two temporary solutions:
1. Revert to depending on Transform here, at least not creating a dependency cycle. (I can see about factoring out the interfaces part of the transform into a separate library because we only ever those, not the rest of lib/IR.)
2. Consider putting these promises in the [`TensorTransformDialectExtension`](https://github.com/llvm/llvm-project/blob/d022f32c73c57b59a9121eba909f5034e89c628e/mlir/lib/Dialect/Tensor/TransformOps/TensorTransformOps.cpp#L222). Not entirely convinced this is the best place though as one may be needing these implementations even without the additional ops provided by the tensor transform extension.

https://github.com/llvm/llvm-project/pull/78368


More information about the Mlir-commits mailing list