This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Fold away empty PadTensorOp in canonicalizer
ClosedPublic

Authored by springerm on Jun 2 2021, 11:08 PM.

Details

Summary

Add a canonicalization patterns that folds away PadTensorOps where low and high are zero.

Also remove an existing PadTensorOp vectorization pattern, which was applied in very limited cases. All of those cases are handled by the canonicalization pattern. A more general vectorization pattern will be added in a subsequent commit.

Depends On D103137

Diff Detail

Event Timeline

springerm created this revision.Jun 2 2021, 11:08 PM
springerm requested review of this revision.Jun 2 2021, 11:08 PM
nicolasvasilache accepted this revision.Jun 4 2021, 2:52 AM
This revision is now accepted and ready to land.Jun 4 2021, 2:52 AM
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
358 ↗(On Diff #349799)

These should be unnecessary, we have:

isEqualConstantIntOrValue(ofr, b.getIndexAttr(0))
springerm updated this revision to Diff 350044.Jun 5 2021, 2:33 AM

no change

springerm updated this revision to Diff 350476.Jun 7 2021, 8:01 PM

small improvements

springerm updated this revision to Diff 350552.Jun 8 2021, 2:50 AM

no change

springerm abandoned this revision.Jun 13 2021, 6:23 PM

Same functionality has been submitted as D103984 in the meantime. Closing this differential.

springerm reclaimed this revision.Jun 13 2021, 6:38 PM

Reopening revision, so that I can submit the missing test case that checks for insertion of the tensor cast. Also, removing the generic vectorization pattern of PadTensorOp.

This revision is now accepted and ready to land.Jun 13 2021, 6:38 PM
This revision was landed with ongoing or failed builds.Jun 13 2021, 6:54 PM
This revision was automatically updated to reflect the committed changes.