This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add canonicalizer to remove redundant shape.cstr_broadcastable ops
ClosedPublic

Authored by ezhulenev on Feb 4 2022, 3:18 PM.

Diff Detail

Event Timeline

ezhulenev created this revision.Feb 4 2022, 3:18 PM
ezhulenev requested review of this revision.Feb 4 2022, 3:18 PM
frgossen accepted this revision.Feb 6 2022, 2:23 PM

That's a nice way of doing this. Thanks for adding this.

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

nit: Eliminate cstr_broadcastable operands from assuming_all that are subsumed by others?

527

You can even apply this canonicalization if there are other witnesses in the list.

mlir/test/Dialect/Shape/canonicalize.mlir
576

Maybe, check that it consumes the right witness
Although somewhat enforced with the CHECK-NEXT this could be easier to read

596

Maybe, check that it consumes the right witnesses

This revision is now accepted and ready to land.Feb 6 2022, 2:23 PM
ezhulenev marked 4 inline comments as done.Feb 6 2022, 2:38 PM
ezhulenev added inline comments.
mlir/lib/Dialect/Shape/IR/Shape.cpp
527

Added a TODO, will send a change in the next PR.

ezhulenev updated this revision to Diff 406290.Feb 6 2022, 2:38 PM
ezhulenev marked an inline comment as done.

Address comments

This revision was landed with ongoing or failed builds.Feb 6 2022, 2:46 PM
This revision was automatically updated to reflect the committed changes.