[Mlir-commits] [mlir] [mlir][bufferization] Support custom types (1/N) (PR #142986)
Han-Chung Wang
llvmlistbot at llvm.org
Mon Jun 30 16:55:24 PDT 2025
================
@@ -1030,7 +1027,7 @@ bufferization::detail::unknownGetAliasingValues(OpOperand &opOperand) {
}
bool bufferization::detail::defaultHasTensorSemantics(Operation *op) {
- auto isaTensor = [](Type t) { return isa<TensorType>(t); };
+ auto isaTensor = [](Type t) { return isa<TensorLikeType>(t); };
----------------
hanhanW wrote:
Just a note, since I spent some time on this. Because the interface implementation for builtin types locate at `bufferization::BufferizationDialect::initialize()`, any pass that expects the registration need to add the bufferization to the dependent dialect.
> Dialects must be loaded in the MLIRContext before entities from these dialects (operations, types, attributes, …) can be created.
https://mlir.llvm.org/docs/PassManagement/#dependent-dialects
My understanding was that a dialect should be registered if we're going to create the ops/types/attrs. The rule no longer hold today.
https://github.com/llvm/llvm-project/blob/12409a18f609f965fbd40aba77a0b50dcdba147f/mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp#L102-L122
https://github.com/llvm/llvm-project/pull/142986
More information about the Mlir-commits
mailing list