This is an archive of the discontinued LLVM Phabricator instance.

[TOSA] Fold consecutive concats on the same axis
ClosedPublic

Authored by gargaroff on May 23 2023, 7:13 AM.

Details

Summary

Consecutive concats that happen on the same axis can be folded into a single, bigger concat. This patch implements this folding by implementing the tosa::ConcatOp::fold method.

Diff Detail

Event Timeline

gargaroff created this revision.May 23 2023, 7:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2023, 7:13 AM
gargaroff requested review of this revision.May 23 2023, 7:13 AM
Lewuathe accepted this revision.May 23 2023, 7:37 PM
Lewuathe added inline comments.
mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
1050

The variable name can be more descriptive like findFoldableOperand or findFoldableConcat ?

1058

The comment should be Not foldable if axis are not the same to match the following code.

This revision is now accepted and ready to land.May 23 2023, 7:37 PM
This revision was automatically updated to reflect the committed changes.
gargaroff marked 2 inline comments as done.

Thanks for the review. Landed in 295a6ed5d54aca2d923b76b6388f9732eb37f548

mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
1058

Thanks. I have updated the comment in the commit as suggested.