This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ods] Add simple generator for return types
ClosedPublic

Authored by jpienaar on May 23 2020, 3:51 PM.

Details

Summary

Take advantage of equality constrains to generate the type inference interface.
This is used for equality and trivially built types. The type inference method
is only generated when no type inference trait is specified already. Avoids the
need for custom build methods for simple cases that have been increasing. More
work needed to consolidate more, but simplifies the specification and can
iterate implementation side post.

This reorders verification that changes some test error messages (two verifications that overlap and the original verification isn't reached to be triggered).

Diff Detail

Event Timeline

jpienaar created this revision.May 23 2020, 3:51 PM
Herald added a reviewer: silvas. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript

I feel like there must be some documentation somewhere that should be updated to describe this behavior?

silvas accepted this revision.May 26 2020, 3:50 PM

Awesome! Thanks so much for doing this :)

mlir/lib/TableGen/Operator.cpp
257

This comment seems a bit out of date?

262

any_of(concat(operands, results), [](op) { return op.IsVariadic()}) would be a bit more succicnt.

296

maybe a small comment explaining how we intend to use EquivalenceClasses.

This revision is now accepted and ready to land.May 26 2020, 3:50 PM
jpienaar updated this revision to Diff 266558.May 27 2020, 8:42 AM
jpienaar marked 3 inline comments as done.

Added documentation and address review comments

This revision was automatically updated to reflect the committed changes.