This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tensor] Add canonicalization of `tensor.extract` from cast-like slice
Needs ReviewPublic

Authored by christopherbate on Aug 23 2023, 10:09 AM.

Details

Reviewers
nicolasvasilache
Summary

Adds a canonicalization for tensor.extract. When an extract occurs on
a rank-reducing (of unit-dimensions) tensor.extract_slice operation,
the tensor.extract can act on the source of the tensor.extract_slice.

Depends on D158635

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2023, 10:09 AM
christopherbate requested review of this revision.Aug 23 2023, 10:09 AM
mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
861

While this pattern seems fine to me with this check, I think the other comments in https://reviews.llvm.org/D158643 could still apply?