This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tensor] Add some folders for insert/extract slice ops
ClosedPublic

Authored by antiagainst on Oct 8 2021, 9:36 AM.

Details

Summary
  • Fold extract_slice immediately after insert_slice.
  • Fold overlapping insert_slice.

Diff Detail

Event Timeline

antiagainst created this revision.Oct 8 2021, 9:36 AM
antiagainst requested review of this revision.Oct 8 2021, 9:36 AM
ThomasRaoux added inline comments.Oct 8 2021, 9:46 AM
mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
1044–1053

nit: We could also go up the insert chain if the slice are disjoint. Maybe we should have a TODO?

1308–1328

Can we just do an update in place? Or maybe better make it a folding?

antiagainst marked 2 inline comments as done.

Address comments

mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
1044–1053

Added a TODO.

1308–1328

Good point! Changed to a fold with inplace update.

ThomasRaoux accepted this revision.Oct 11 2021, 10:41 AM
This revision is now accepted and ready to land.Oct 11 2021, 10:41 AM