This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add support for adding attribute+type traits/interfaces to tablegen defs
ClosedPublic

Authored by rriddle on Apr 9 2021, 3:06 PM.

Details

Summary

This matches the current support provided to operations, and allows attaching traits, interfaces, and using the DeclareInterfaceMethods utility. This was missed when attribute/type generation was first added.

Diff Detail

Event Timeline

rriddle created this revision.Apr 9 2021, 3:06 PM
rriddle requested review of this revision.Apr 9 2021, 3:06 PM

I am most likely not the right person to LG this, but, wow, thank you for adding this so quickly!!!

ftynse accepted this revision.Apr 13 2021, 2:14 PM
ftynse added a subscriber: ftynse.
ftynse added inline comments.
mlir/include/mlir/TableGen/Operator.h
178–179

Didn't the code in Trait.h/cpp add that?

mlir/lib/TableGen/Trait.cpp
2

Please add this file to CMakeLists.txt

81

Nit: something like getTraitClassName or getFullyQualifiedTraitName?

mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
360

Do we want to assert the trait subclass here for future-proofness?

This revision is now accepted and ready to land.Apr 13 2021, 2:14 PM
rriddle updated this revision to Diff 337846.Apr 15 2021, 11:29 AM
rriddle marked 4 inline comments as done.

update

Thanks for the review Alex!

This revision was landed with ongoing or failed builds.Apr 15 2021, 11:44 AM
This revision was automatically updated to reflect the committed changes.
mlir/lib/TableGen/CMakeLists.txt