This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Add folders and canonicalizers for linalg.reshape/linalg.tensor_reshape operations.
ClosedPublic

Authored by mravishankar on May 11 2020, 10:52 PM.

Diff Detail

Event Timeline

mravishankar created this revision.May 11 2020, 10:52 PM
nicolasvasilache accepted this revision.May 12 2020, 5:44 PM

Looks good but please fix the test and address the TensorReshape / memref folding discrepancy.

mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
395

i < e ?

415

we now have value.getDefiningOp<OpTy>() that does this in a more idiomatic way (here and below)

1248

I don't get this, TensorReshape operates on tensors ?

mlir/test/Dialect/Linalg/llvm.mlir
227

no hardcoded names (e.g. %9) in tests please: capture what you need and wildcard the rest.

This revision is now accepted and ready to land.May 12 2020, 5:44 PM
mravishankar marked 4 inline comments as done.

Addressing comments

mravishankar added inline comments.May 12 2020, 10:27 PM
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
1248

Thanks for catching this. Copy-paste error.

This revision was automatically updated to reflect the committed changes.
rriddle added inline comments.May 27 2020, 12:35 PM
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
464

Drop the extra semicolon here.