[mlir] Support repeated delayed registration of dialect interfaces
authorAlex Zinenko <zinenko@google.com>
Mon, 15 Feb 2021 09:39:13 +0000 (10:39 +0100)
committerAlex Zinenko <zinenko@google.com>
Mon, 15 Feb 2021 09:46:26 +0000 (10:46 +0100)
commit34ea608a473a5c67263c49255551ea348ffc1700
tree41bafa2f84fe1bf6296265f7cdb6a436dd3ab539
parentf8d3f47e1fd09392aa30df83849b25acd8c59a25
[mlir] Support repeated delayed registration of dialect interfaces

Dialects themselves do not support repeated addition of interfaces with the
same TypeID. However, in case of delayed registration, the registry may contain
such an interface, or have the same interface registered several times due to,
e.g., dependencies. Make sure we delayed registration does not attempt to add
an interface with the same TypeID more than once.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D96606
mlir/include/mlir/IR/Dialect.h
mlir/lib/IR/Dialect.cpp
mlir/unittests/IR/DialectTest.cpp