This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ods] Handle DeclareOpInterfaceMethods<InferTypeOpInterface> in formatgen
ClosedPublic

Authored by jpienaar on Jan 3 2022, 7:29 PM.

Details

Summary

Previously it would not consider ops with DeclareOpInterfaceMethods<InferTypeOpInterface> as having the InferTypeOpInterface
interfaces added. The OpInterface nested inside DeclareOpInterfaceMethods is not retained so that one could query it, so check for the the C++ class directly (a bit raw/low level).

Diff Detail

Event Timeline

jpienaar created this revision.Jan 3 2022, 7:29 PM
jpienaar requested review of this revision.Jan 3 2022, 7:29 PM

Your description does not seem correct to me, can you revise?

jpienaar retitled this revision from [mlir][ods] Handle DeclareOpInterfaceMethods in formatgen to [mlir][ods] Handle DeclareOpInterfaceMethods<InferTypeOpInterface> in formatgen.Jan 3 2022, 8:14 PM
jpienaar edited the summary of this revision. (Show Details)

Your description does not seem correct to me, can you revise?

Seems I omitted some words indeed. Revised.

mehdi_amini accepted this revision.Jan 3 2022, 8:29 PM
mehdi_amini added inline comments.
mlir/tools/mlir-tblgen/OpFormatGen.cpp
2357

Should we have a method op.hasCppInterface("::mlir::InferTypeOpInterface") or something like that?

This revision is now accepted and ready to land.Jan 3 2022, 8:29 PM
jpienaar added inline comments.Jan 4 2022, 8:04 AM
mlir/tools/mlir-tblgen/OpFormatGen.cpp
2357

Good idea, I'll do that in follow up (I'm not crazy about the C++ names , so might consider if there is a different way to do this/some unwrapping like is done for OpTraitList).

This revision was automatically updated to reflect the committed changes.