This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tensor] Fix bug in utility `tensor::isCastLikeExtractSliceOp`
ClosedPublic

Authored by christopherbate on Aug 23 2023, 9:41 AM.

Details

Summary

Fixes an issue where isCastLikeExtractSliceOp did not account for the fact
that tensor.extract_slice may drop non-unit dimensions. This change makes the
utility function behave inline with its name/description. The only user of this
function is in the FindPayloadReplacementOpInterface for the
tensor::ExtractSliceOp. This can potentially cause downstream projects to have
more "listener could not find replacement op" errors when interpreting Transform
IR, but the behavior is inline with the documented conservative behavior of the
Transform dialect's TrackingListener.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2023, 9:41 AM
christopherbate requested review of this revision.Aug 23 2023, 9:41 AM
springerm accepted this revision.Aug 24 2023, 12:57 AM
springerm added inline comments.
mlir/lib/Dialect/Tensor/Utils/Utils.cpp
96

no need to change this here, but I just noticed that CastLike is not really the correct term. It should be CastOrReshapeLike (or something like that...)

This revision is now accepted and ready to land.Aug 24 2023, 12:57 AM