This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Remove incorrect folding for SubTensorInsertOp
ClosedPublic

Authored by mravishankar on Mar 2 2021, 1:10 PM.

Details

Summary

The SubTensorInsertOp has a requirement that dest type and result
type match. Just folding the tensor.cast operation violates this and
creates verification errors during canonicalization. Also fix other
canonicalization methods that werent inserting casts properly.

Diff Detail

Event Timeline

mravishankar created this revision.Mar 2 2021, 1:10 PM
mravishankar requested review of this revision.Mar 2 2021, 1:10 PM

Correcting previous incorrect update

hanchung requested changes to this revision.Mar 2 2021, 11:12 PM
hanchung added a subscriber: hanchung.
hanchung added inline comments.
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
2432–2434

[optional] I feel llvm::zip(op->getResults(), newOp->getResults()) looks better to me.

mlir/test/Dialect/Linalg/canonicalize.mlir
782

Should this be dim %arg0, %c1?

792

Let's add a new line at the end of file?

This revision now requires changes to proceed.Mar 2 2021, 11:12 PM
mravishankar marked an inline comment as done.

Address comments

mravishankar marked 2 inline comments as done.Mar 3 2021, 9:36 AM
nicolasvasilache accepted this revision.Mar 3 2021, 9:38 AM
nicolasvasilache added inline comments.
mlir/test/Dialect/Linalg/canonicalize.mlir
782

+1

hanchung accepted this revision.Mar 3 2021, 9:40 AM
This revision is now accepted and ready to land.Mar 3 2021, 9:40 AM
This revision was landed with ongoing or failed builds.Mar 3 2021, 1:58 PM
This revision was automatically updated to reflect the committed changes.