[MLIR] Deduplicate dialect registration by ClassID
Summary: With the move towards dialect registration that does not depend only use static initialization, we are running into more cases where the dialects are registered by different methods. For example, TensorFlow still uses static initialization to register all MLIR core dialects, which prevents explicit registration of any of them when linking it in. We ran into this issue in https://github.com/google/iree/pull/982. To address potential issues with conflicts from non-standard allocators passed to registerDialectAllocator, made this method private. Now all dialects can only be registered with their constructor. Similarly deduplicates DialectHooks for consistency and makes their registration follow the same pattern. Differential Revision: https://reviews.llvm.org/D76329
Loading
Please sign in to comment