This is an archive of the discontinued LLVM Phabricator instance.

[mlir][OpFormatGen] Add support for anchoring optional groups with types
ClosedPublic

Authored by rriddle on Jan 20 2021, 6:20 PM.

Details

Summary

This revision adds support for using either operand or result types to anchor an optional group. It also removes the arbitrary restriction that type directives must refer to variables in the same group, which is overly limiting for a declarative format syntax.

Fixes PR#48784

Diff Detail

Event Timeline

rriddle created this revision.Jan 20 2021, 6:20 PM
rriddle requested review of this revision.Jan 20 2021, 6:20 PM
jpienaar accepted this revision.Jan 22 2021, 11:08 AM
jpienaar added a subscriber: jpienaar.

Thanks!

mlir/test/mlir-tblgen/op-format.mlir
234

Could we add a negative test to clearly show differnce between what a and b allows?

mlir/tools/mlir-tblgen/OpFormatGen.cpp
1761

Could this have been a type switch?

1770

Could you expand the request here?

This revision is now accepted and ready to land.Jan 22 2021, 11:08 AM
This revision was automatically updated to reflect the committed changes.
rriddle marked 3 inline comments as done.

Nice, thank you River!