This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Support repeated delayed registration of dialect interfaces
ClosedPublic

Authored by ftynse on Feb 12 2021, 7:12 AM.

Details

Summary

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.

Diff Detail

Event Timeline

ftynse created this revision.Feb 12 2021, 7:12 AM
ftynse requested review of this revision.Feb 12 2021, 7:12 AM
mehdi_amini added inline comments.Feb 12 2021, 10:03 AM
mlir/unittests/IR/DialectTest.cpp
120

I don't see a "death test" on double addition of different implementation of the same interface, can you try to add one?

mehdi_amini accepted this revision.Feb 12 2021, 10:03 AM
This revision is now accepted and ready to land.Feb 12 2021, 10:03 AM
ftynse updated this revision to Diff 323688.Feb 15 2021, 1:40 AM

Add death test

This revision was landed with ongoing or failed builds.Feb 15 2021, 1:46 AM
This revision was automatically updated to reflect the committed changes.