This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tosa] Make tosa.resize to linalg avoid redundant loads for unit width
ClosedPublic

Authored by rsuderman on Dec 13 2022, 4:14 PM.

Details

Summary

When using a tosa resize for ?x1x1x? to ?x1x?x? we should avoid doing a 2D
interpolation as only two unique values are loaded. As the extract operation
performance numerical computation on its values the superfluous extracts may
fail to be coalesced. Instead we only interpolate between the values if there
are multiple values to interpolate between.

For the integer case we also perform scaling by the scaling-factor to apply
the same integer scaling behavior as interpolation.

Diff Detail

Event Timeline

rsuderman created this revision.Dec 13 2022, 4:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2022, 4:14 PM
rsuderman requested review of this revision.Dec 13 2022, 4:14 PM
NatashaKnk accepted this revision.Dec 15 2022, 12:18 PM
This revision is now accepted and ready to land.Dec 15 2022, 12:18 PM
jpienaar accepted this revision.Dec 15 2022, 12:28 PM
jpienaar added inline comments.
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
1672

Style here is to elide {}

rsuderman marked an inline comment as done.Dec 15 2022, 4:24 PM