Page MenuHomePhabricator

[MLIR] Generate inferReturnTypes declaration using InferTypeOpInterface trait.
ClosedPublic

Authored by jurahul on Dec 3 2020, 10:16 AM.

Details

Summary
  • Instead of hardcoding the parameters and return types of 'inferReturnTypes', use the InferTypeOpInterface trait to generate the method declaration.
  • Fix InferTypeOfInterface to use fully qualified type for inferReturnTypes results.

Diff Detail

Event Timeline

jurahul created this revision.Dec 3 2020, 10:16 AM
jurahul requested review of this revision.Dec 3 2020, 10:16 AM
jurahul updated this revision to Diff 309390.Dec 3 2020, 3:38 PM

Fix clang-tidy warning

jpienaar accepted this revision.Dec 3 2020, 3:56 PM

Nice, thanks!

mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
296–302

methods?

1746

How about hoisting the loop into a lambda function? I think it could read easier (just a suggestion)

1753

Nit: && "unable to find inferReturnTypes interface method" ?

This revision is now accepted and ready to land.Dec 3 2020, 3:56 PM
jurahul updated this revision to Diff 309400.Dec 3 2020, 4:18 PM

Address feedback

jurahul marked 3 inline comments as done.Dec 3 2020, 4:19 PM
jurahul added inline comments.
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
1746

Is this something you had in mind?

This revision was landed with ongoing or failed builds.Dec 4 2020, 9:09 AM
This revision was automatically updated to reflect the committed changes.
jurahul marked an inline comment as done.