This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Shape] Fold `shape.shape_eq`
ClosedPublic

Authored by frgossen on Jun 25 2020, 2:02 AM.

Details

Summary

Fold shape.shape_eq.

Depends On D82528

Diff Detail

Event Timeline

frgossen created this revision.Jun 25 2020, 2:02 AM
Herald added a project: Restricted Project. · View Herald Transcript
frgossen updated this revision to Diff 273382.Jun 25 2020, 8:27 AM

Remove CHECK-DAGs

silvas accepted this revision.Jun 25 2020, 10:09 AM

LGTM, modulo splitting into two ops and a nit.

mlir/lib/Dialect/Shape/IR/Shape.cpp
491

can you use std::equal or check in STLExtras.h if we have a range version? That should make this more compact.

(actually, adding range_equal to STLExtras.h would be cool, then after splitting into two ops this could be just llvm::range_equal(lhs.cast<DenseIntElementsAttr>(), rhs.cast<DenseIntElementsAttr>()))

This revision is now accepted and ready to land.Jun 25 2020, 10:09 AM
frgossen updated this revision to Diff 273656.Jun 26 2020, 4:02 AM
frgossen marked 2 inline comments as done.

Simplify folding

This revision now requires review to proceed.Jun 26 2020, 4:02 AM
frgossen added inline comments.Jun 26 2020, 4:02 AM
mlir/lib/Dialect/Shape/IR/Shape.cpp
491

Turns out there is actually == defined on these.
Thanks!

frgossen retitled this revision from [MLIR][Shape] Fold `shape.eq` for shapes. to [MLIR][Shape] Fold `shape.shape_eq`.Jun 29 2020, 6:58 AM
frgossen edited the summary of this revision. (Show Details)
silvas accepted this revision.Jul 13 2020, 10:04 AM
jpienaar accepted this revision.Jul 19 2020, 3:08 PM
This revision is now accepted and ready to land.Jul 19 2020, 3:08 PM
This revision was automatically updated to reflect the committed changes.