This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ods] Add nested OpTrait
ClosedPublic

Authored by jpienaar on Jul 17 2021, 11:52 AM.

Details

Summary

Allows for grouping OpTraits with list of OpTrait to make it easier to group OpTraits together without needing to use list concats (e.g., enable using [Traits, ..., UsefulGroupOfTraits, Others, ...] instead of [Traits, ...] # UsefulGroupOfTraits # [Others, ...]). Flatten in construction of Operation. This recurses here as the expectation is that these aren't expected to be deeply nested (most likely only 1 level of nesting).

Diff Detail

Event Timeline

jpienaar created this revision.Jul 17 2021, 11:52 AM
jpienaar requested review of this revision.Jul 17 2021, 11:52 AM
jpienaar retitled this revision from hia-hungDuan to [mlir][ods] Add nested OpTrait.Jul 17 2021, 2:27 PM
rriddle added inline comments.Jul 17 2021, 5:57 PM
mlir/include/mlir/IR/OpBase.td
1802

What about naming this something like OpTraitList?

jpienaar updated this revision to Diff 359629.Jul 18 2021, 7:43 AM

Updated to use OpTraitList

jpienaar marked an inline comment as done.Jul 18 2021, 7:43 AM
jpienaar added inline comments.
mlir/include/mlir/IR/OpBase.td
1802

Good idea

Chia-hungDuan added inline comments.Jul 19 2021, 3:23 AM
mlir/include/mlir/IR/OpBase.td
1800

typo?

mlir/test/mlir-tblgen/op-decl-and-defs.td
264–265

Does this need to be updated? Or the case below needs one more IsolatedFromAbove in the OpTraitList?

jpienaar updated this revision to Diff 359815.Jul 19 2021, 9:06 AM
jpienaar marked 3 inline comments as done.

Fix typo and comment documenting test case

Chia-hungDuan accepted this revision.Jul 19 2021, 8:22 PM
This revision is now accepted and ready to land.Jul 19 2021, 8:22 PM
This revision was automatically updated to reflect the committed changes.