This is an archive of the discontinued LLVM Phabricator instance.

Fix FoldReshapeOpWithUnitExtent generating illegal reshape
ClosedPublic

Authored by asaadaldien on Apr 19 2021, 4:56 PM.

Details

Summary

This will prevent fusion that spans all dims and generates
(d0, d1, ...) -> () reshape that isn't legal

Diff Detail

Event Timeline

asaadaldien created this revision.Apr 19 2021, 4:56 PM
asaadaldien requested review of this revision.Apr 19 2021, 4:56 PM
asaadaldien edited the summary of this revision. (Show Details)Apr 19 2021, 4:59 PM
mravishankar requested changes to this revision.Apr 20 2021, 12:38 PM
mravishankar added inline comments.
mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
517

Could we update the logic above to not create such reassociationExprs to begin with?

This revision now requires changes to proceed.Apr 20 2021, 12:38 PM

Move validation within folding loop

asaadaldien marked an inline comment as done.Apr 20 2021, 3:26 PM
asaadaldien added inline comments.
mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
517

I moved the condition within the folding loop and added a comment to explain why this should fail the pattern. PTAL

mravishankar accepted this revision.Apr 20 2021, 9:53 PM
This revision is now accepted and ready to land.Apr 20 2021, 9:53 PM
This revision was automatically updated to reflect the committed changes.
asaadaldien marked an inline comment as done.