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

Markus Böck llvmlistbot at llvm.org
Fri Feb 23 02:15:27 PST 2024


zero9178 wrote:

> > I feel like in prior lives, this would have been the job of some common registry of names and ids, at least for some definition of built-in things vs having the declarations organized into the directory structure of the "provider". That could just be a convention that upstream takes to keep the dependency graph sane, and downstreams could play a little looser if they want.
> 
> I've been thinking about some sort of project-level initialization (`initMlirCore`, `initEnzyme`, etc.) that would list such promises, but have hard time seeing how it wouldn't end up `#include`ing every single dialect and interface. Which could be acceptable given that `lib/IR` is clear of this and we only need headers. Adding string identifiers for interfaces and having a string/string map hardcoded or generated from tablegen feels too stringly.

I thought about this in the past too when I looked at the dependency tree of MLIR to figure out why my downstream project using `arith-expand` pass links-in/needs to build the sparse tensor dialect :) It feels a bit to me like we'd need build system support that has as inputs "set of dialects used" and "set of interfaces used" and based on these generates 1) code that registers these and 2) a list of extra libraries to link in that act as "intersection libraries" containing an interface implementation for a given dialect. Now getting this to work with both cmake and bazel seems scary... 

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


More information about the Mlir-commits mailing list