This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Fix result type in FoldSourceTensorCast
ClosedPublic

Authored by springerm on Sep 23 2021, 9:07 PM.

Details

Summary
  • Do not discard static result type information that cannot be inferred from lower/upper padding.
  • Add optional argument to PadTensorOp::inferResultType for specifying known result dimensions.

Diff Detail

Event Timeline

springerm created this revision.Sep 23 2021, 9:07 PM
springerm requested review of this revision.Sep 23 2021, 9:07 PM
nicolasvasilache added a subscriber: ftynse.

Nice!

@ftynse also FYI, this avoids the creation of cast(pad) by folding on construction at the exact point the information is known and lost.
https://reviews.llvm.org/D110343 is still generally useful as it would also catch future cases.

This revision is now accepted and ready to land.Sep 23 2021, 11:09 PM
This revision was automatically updated to reflect the committed changes.