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

Benjamin Kramer llvmlistbot at llvm.org
Mon Mar 18 10:57:05 PDT 2024


d0k wrote:

> > It couples Tensor to Bufferization and to Transform dialect. While technically this can be made a header-only dependency (right now it's not),
> 
> The promise declarations are meant to be header only, why is it not right now?

It does depend on TypeIDs to be present.

> > After this change you're forced to load all the bufferization interfaces for all the ops, which breaks this use case.
> 
> The promise only forces you to load what you use right now: are you saying that you have ops in your IR for which you want to run the pass but you want the `dyn_cast<BufferizationOpIntertace>(op)` to intentionally fail? I don't quite see that as something that can (and more importantly should!) be supported. This is not the right mechanism, you need to look into the buffization pass itself, and/or inject an interface implementation that behaves as you'd expect for these operations.

I guess I can make it work through Bufferization's OpFilter, but that seems backwards to me. Why do I have to first load an extension interface just to not use it? Shouldn't I only load what I actually want to use?

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


More information about the Mlir-commits mailing list