This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Add utility method to reshape ops to express output shape in terms of input shape.
ClosedPublic

Authored by mravishankar on Feb 12 2021, 2:08 PM.

Details

Summary

Resolving the dim of outputs of a tensor_reshape op in terms of its
input shape allows the op to be eliminated when its used only in its
dims. The init_tensor -> tensor_reshape canonicalization can be
simplified to use the dims of the output of the tensor_reshape which
gets canonicalized away later making the tensor_reshape dead.

Diff Detail

Event Timeline

mravishankar created this revision.Feb 12 2021, 2:08 PM
mravishankar requested review of this revision.Feb 12 2021, 2:08 PM
bondhugula added inline comments.
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
1266

You don't need to explicitly assign to nullptr - it has a default null init.

asaadaldien accepted this revision.Feb 16 2021, 11:13 AM
asaadaldien added inline comments.
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
1266
This revision is now accepted and ready to land.Feb 16 2021, 11:13 AM
mravishankar marked 2 inline comments as done.Feb 16 2021, 1:15 PM

Address comment

This revision was landed with ongoing or failed builds.Feb 16 2021, 1:42 PM
This revision was automatically updated to reflect the committed changes.
Harbormaster completed remote builds in B89436: Diff 324091.