This is an archive of the discontinued LLVM Phabricator instance.

[mlir][MemRef] Bail out for unsupported cases in FoldMemRefAliasOps pass
ClosedPublic

Authored by hanchung on Aug 10 2023, 6:05 PM.

Details

Summary

The pass uses computeSuffixProduct method which only allows static
shapes. This revision adds an early-exit for dynamic cases to avoid
crash.

Diff Detail

Event Timeline

hanchung created this revision.Aug 10 2023, 6:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 6:05 PM
hanchung requested review of this revision.Aug 10 2023, 6:05 PM
mravishankar accepted this revision.Aug 10 2023, 8:47 PM

Accepting since it is needed to fix downstream failures, but a proper fix would be to handle dynamic cases as well

mlir/lib/Dialect/MemRef/Transforms/FoldMemRefAliasOps.cpp
65–71

Could you add some comments for the early exit? I think computeSuffixProduct can be made to handle dynamic shapes, but isn't part of this patch

This revision is now accepted and ready to land.Aug 10 2023, 8:47 PM
hanchung added inline comments.Aug 11 2023, 11:02 AM
mlir/lib/Dialect/MemRef/Transforms/FoldMemRefAliasOps.cpp
65–71

The other version of computeSuffixProduct can handle dynamic cases using AffineExpr ops, but that needs more work..

hanchung updated this revision to Diff 549463.Aug 11 2023, 11:15 AM

address comments and fix typos in the lit test.

This revision was landed with ongoing or failed builds.Aug 11 2023, 2:53 PM
This revision was automatically updated to reflect the committed changes.