This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Shape] Make shape_eq nary
ClosedPublic

Authored by bkramer on Mar 1 2021, 1:38 PM.

Details

Summary

This gets rid of a dubious shape_eq %a, %a fold, that folds shape_eq
even if %a is not an Attribute.

Diff Detail

Event Timeline

bkramer created this revision.Mar 1 2021, 1:38 PM
bkramer requested review of this revision.Mar 1 2021, 1:38 PM
jpienaar accepted this revision.Mar 2 2021, 8:50 AM

LGTM, I'll leave more to Tres who knows these better

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

Could you add a comment? (Initially I was confused, but then I realized this was just a convenience builder for binary case to probably retain current call behavior).

mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
494

Set to nullptr explicitly? (makes check in 522 simpler to see)

509

So this results in a linear sequence of compares all with firstShape as lhs?

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

Nit: I prefer logical operator

This revision is now accepted and ready to land.Mar 2 2021, 8:50 AM
tpopp added inline comments.Mar 3 2021, 5:30 AM
mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
511

Are these tabs?

tpopp accepted this revision.Mar 3 2021, 5:30 AM
bkramer marked 3 inline comments as done.Mar 3 2021, 7:27 AM
bkramer added inline comments.
mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
509

Right.

511

No, it's just phab's way of saying that indentation increased.

This revision was automatically updated to reflect the committed changes.
bkramer marked an inline comment as done.