This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Factor out common parts of the TLike constraint
ClosedPublic

Authored by krzysz00 on Jan 27 2022, 8:49 AM.

Details

Summary

Type constraints such as BoolLike and SignlessIntegerLike appear to
have been defined by copy-paste and all share an underlying TypesLike
structure that can be factored out.

This also allows for defining additional constraints of a similar
form, such as F32Like.

Diff Detail

Event Timeline

krzysz00 created this revision.Jan 27 2022, 8:49 AM
krzysz00 requested review of this revision.Jan 27 2022, 8:49 AM
rriddle accepted this revision.Jan 27 2022, 2:41 PM

Thanks!

mlir/include/mlir/IR/OpBase.td
908

Can this be renamed to something that encodes that fact that it includes Tensor/Vector? The name is a bit too general (which is also a problem of the fact that OpBase is a monolith of a file).

This revision is now accepted and ready to land.Jan 27 2022, 2:41 PM
krzysz00 added inline comments.Jan 27 2022, 3:03 PM
mlir/include/mlir/IR/OpBase.td
908

Good point, especially now that we have some abstractions running around.

How's ContainerOf<> sound to you?

krzysz00 updated this revision to Diff 404152.Jan 28 2022, 1:30 PM
  • Rename TypesLike to TypeOrocontainer
This revision was automatically updated to reflect the committed changes.