[PATCH] D76329: [MLIR] Deduplicate dialect registration by ClassID

Geoffrey Martin-Noble via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 17 15:08:05 PDT 2020


GMNGeoffrey created this revision.
GMNGeoffrey added reviewers: rriddle, mehdi_amini.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar.
Herald added 1 blocking reviewer(s): rriddle.
Herald added a project: LLVM.

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.

This potentially introduces some issues if callers using non-standard
dialect registration functions passed to registerDialectAllocator and
they are silently overridden.

Similarly deduplicates DialectHooks for consistency.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76329

Files:
  mlir/include/mlir/IR/Dialect.h
  mlir/include/mlir/IR/DialectHooks.h
  mlir/lib/IR/Dialect.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76329.250916.patch
Type: text/x-patch
Size: 6253 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200317/198c6053/attachment.bin>


More information about the llvm-commits mailing list