This is an archive of the discontinued LLVM Phabricator instance.

Remove empty AffineExpr stride canonicalization in makeCanonicalStridedLayoutExpr
ClosedPublic

Authored by tpopp on Jul 29 2022, 6:32 AM.

Details

Summary

The "optimization" would replace the AffineMap for an empty shape with a 0 to represent its indexing (stride * dimension) logic. Meanwhile other pieces of core logic (such as getStridesAndOffset and makeStridedLinearLayoutMap) require strides for all dimensions to ensure no aliasing can occur which would occur if the shape was not empty. For now, this optimization is removed as different pieces of core types disagree on this, so the optimization should be caller supplied or should be consistent throughout the infrastructure.

Diff Detail

Event Timeline

tpopp created this revision.Jul 29 2022, 6:32 AM
tpopp requested review of this revision.Jul 29 2022, 6:32 AM
ftynse accepted this revision.Jul 29 2022, 7:00 AM
This revision is now accepted and ready to land.Jul 29 2022, 7:00 AM
tpopp added a comment.Aug 1 2022, 2:10 AM

I'm going to land this as I suspect there are no strong feelings over this change and there was a lack of failing tests to show people might rely on this, but if anyone has concerns, please feel free to revert and raise your concerns, as this commit was not in review for long. For any abstract concerns though, please keep in mind that the existing code failed in multiple situations, and only worked in limited code paths.