This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Make some functions public to use custom TypeIDs
ClosedPublic

Authored by math-fehr on Mar 22 2021, 8:59 AM.

Details

Summary

Currently, it is only possible to register an operation or a type
when the TypeID is defined at compile time. Same with InterfaceMaps
which can only be defined with compile-time defined interfaces.

With those changes, it is now possible to register types/operations
with custom TypeIDs. This is necessary to define new operations/types
at runtime.

Diff Detail

Event Timeline

math-fehr created this revision.Mar 22 2021, 8:59 AM
math-fehr requested review of this revision.Mar 22 2021, 8:59 AM
rriddle accepted this revision.Mar 22 2021, 10:38 AM

Thanks!

mlir/include/mlir/IR/Dialect.h
186

nit: Move this next to the templated addTypes.

mlir/include/mlir/IR/TypeSupport.h
57

nit: Can you wrap this in a non-templated get instead of exposing the constructor? Also, can you place it next to the other get?

This revision is now accepted and ready to land.Mar 22 2021, 10:38 AM

Address comments by moving functions to better place.

Also, use a 'get' function instead of exposing the AbstractType
constructor.

Fix phabricator diff.

I think I erased the first patch with the second one.

math-fehr marked 2 inline comments as done.Mar 22 2021, 12:42 PM

I addressed the comments.

Also, I forgot to precise that I can't land the patch!

This revision was automatically updated to reflect the committed changes.