[Mlir-commits] [mlir] [mlir] Declare promised interfaces for all dialects (PR #78368)
Benjamin Kramer
llvmlistbot at llvm.org
Mon Mar 18 11:36:18 PDT 2024
d0k wrote:
> > 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?
>
> If Bufferization is doing `dyn_cast<BufferizationInterface>(op)`, then from the system point of view you are actually using it. But wouldn't OpFilter actually make it so that the dyn_cast is just not performed?
That's not what `mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp` does, it dyn_casts first and OpFilters second. Should that be fixed?
> > > > 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.
>
> Right we get a weak symbol injected, but that's still header-only to me, why do you consider it's not? I mean this seems inherent to any header-only library usage: some "code" will be present into the user, unless you're only using macros from a header of course! Inline functions from a header only library end up with similar symbols.
I don't consider those header-only dependencies, and there are build modes where this will break. The implementation is fine to give those symbols a home. But I guess so far MLIR has been fine with it so maybe it's not a big deal.
https://github.com/llvm/llvm-project/pull/78368
More information about the Mlir-commits
mailing list