This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Shape] Add `shape.size_eq` to the shape dialect
AbandonedPublic

Authored by frgossen on Jun 26 2020, 1:39 AM.

Details

Summary

The new operation shape.size_eq compares equality of the shape dialect's size
values !shape.size and also supports index types.

Diff Detail

Event Timeline

frgossen created this revision.Jun 26 2020, 1:39 AM
Herald added a project: Restricted Project. · View Herald Transcript
silvas accepted this revision.Jun 26 2020, 10:50 AM

LGTM modulo incorporating our decision on the error case discussion from shape_eq.

frgossen edited the summary of this revision. (Show Details)Aug 26 2020, 3:07 AM
frgossen updated this revision to Diff 287898.Aug 26 2020, 3:12 AM

Address error handling

@jpienaar , can I land this?

jpienaar accepted this revision.Sep 21 2020, 3:44 PM
jpienaar added a subscriber: herhut.

LG, modulo I think the error discussion on the shape_eq one wasn't updated there or used here. But we can do those as uniform follow up too.

mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
156

I don't understand the equality part of errors. The behavior elsewhere is that an error is propagated, here it sounds like you can compare if the size (that was supposed to be there) is equal, and returns true if there are no sizes. I don't think we've defined equality of errors either (e.g., if I have two errors due to being non-broadcastable are they equal? equal only when the operands are the same too?). But it is above already. And we can cycle back on both.

I agree with @herhut on when shape_eq was added about UB (in https://reviews.llvm.org/D82528) or my follow up question about usage only where non-error.

This revision is now accepted and ready to land.Sep 21 2020, 3:44 PM
frgossen abandoned this revision.Nov 24 2020, 5:08 AM