This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] [TOSA]: Move reshape(reshape(x)) -> reshape(x) from canonicalization to fold
ClosedPublic

Authored by mgehre-amd on Jul 14 2023, 12:20 AM.

Details

Summary

reshape(reshape(x)) -> reshape(x) can be directly written as a fold instead of a canonicalization,
to help other passes cleanup while they work.

This initially broke ReshapeConverterExpand/Collapse, which relies on creating foldable reshapes and a carefully crafted
benefit priority of patterns.
I turned this into a single pattern on reshapes, which does expand and/or collapse as needed in one go.

Diff Detail

Event Timeline

mgehre-amd created this revision.Jul 14 2023, 12:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2023, 12:20 AM
mgehre-amd requested review of this revision.Jul 14 2023, 12:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2023, 12:20 AM
eric-k256 accepted this revision.Jul 14 2023, 4:22 PM

Looks okay to me.

This revision is now accepted and ready to land.Jul 14 2023, 4:22 PM
This revision was landed with ongoing or failed builds.Jul 17 2023, 1:14 AM
This revision was automatically updated to reflect the committed changes.