This is an archive of the discontinued LLVM Phabricator instance.

[mlir] allow for re-registering extension ops
ClosedPublic

Authored by ftynse on May 13 2022, 9:05 AM.

Details

Summary

Op registration mechanism does not allow for ops with the same name to be
re-registered. This is okay to avoid name conflicts and debug
double-registration, but may be problematic for dialect extensions that may get
registered several times (unlike dialects that are deduplicated in the
registry). When registering ops through the Transform dialect extension
mechanism, check first if the ops are already registered and only complain in
the case of repeated registration with the same name but different TypeID.

Diff Detail

Event Timeline

ftynse created this revision.May 13 2022, 9:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 9:05 AM
ftynse requested review of this revision.May 13 2022, 9:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 9:05 AM
nicolasvasilache accepted this revision.May 13 2022, 9:51 AM

Thanks!
It does indeed lead to surprising behavior that dialects safely get deduped but dynamically registered ops don't.
I imagine we could improve things more generally but seems intrusive, confining to the transform dialect sgtm for now.

This revision is now accepted and ready to land.May 13 2022, 9:51 AM
This revision was automatically updated to reflect the committed changes.