[Mlir-commits] [mlir] [mlir][canonicalize] Add filter-dialects option (PR #193041)

Mehdi Amini llvmlistbot at llvm.org
Wed Apr 22 06:13:11 PDT 2026


joker-eph wrote:

> I don't follow what you mean here. We can register the dialect more than once, that's alright. 

Only if it is the same dialect though: trying to register a dialect with the same name but different TypeID isn't OK.
So if we were unifying the map, then we need to account for registering a dialect by name which would introduce an entry without a TypeID followed by a registration of a dialect with a TypeID which should override it.  This is the kind of logic I was referring to, hardening things is a bit more complex when you have an "Optional" value (right now the pointer isn't "optional", we'd change it to it by allowing null).

> Or have a getter for the constructor object, use it systematically, and make it emit a diagnostic when there's no constructor, similarly to how this is currently done with an extra field, but not limited to the canonicalization logic. This becomes a mechanism that passes can use, not an ad-hoc fix for one pass.

I didn't follow what you mean with the getter and warning? How is this limited to canonicalization right now and not just generally applicable to any pass?

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


More information about the Mlir-commits mailing list