This is an archive of the discontinued LLVM Phabricator instance.

[mlir] fix outdated assert in affine symbol verification
ClosedPublic

Authored by ftynse on Jan 20 2023, 5:47 AM.

Details

Summary

The verification of affine value classification for symbols was
expecting, incorrectly, that the dimension operand of memref.dim was
being produced by a constant-like operation. This is legacy of the
dimension being an attribute originally, and was never updated after it
was switched to be an operation. Treat such cases conservatively and
classify the value as non-symbol.

A more advanced version could attempt to check that the value would be a
valid symbol for all possible values the dimension attribute could take,
but this does not seem immediately useful.

Fixes #59993.

Diff Detail

Event Timeline

ftynse created this revision.Jan 20 2023, 5:47 AM
ftynse requested review of this revision.Jan 20 2023, 5:47 AM
ftynse edited the summary of this revision. (Show Details)Jan 20 2023, 5:48 AM
bondhugula accepted this revision.Jan 20 2023, 8:27 AM

LGTM.

mlir/lib/Dialect/Affine/IR/AffineOps.cpp
341

Sounds fine. Thanks for fixing this.

345–346

I just noticed something more to fix/generalize here. Instead of listing out ViewOp, SubViewOp, we need to have ViewLikeOpInterface and AllocLikeOpInterface here.

This revision is now accepted and ready to land.Jan 20 2023, 8:27 AM
bondhugula added inline comments.Jan 20 2023, 8:27 AM
mlir/lib/Dialect/Affine/IR/AffineOps.cpp
345–346

I can fix this part in another revision.

ftynse marked 2 inline comments as done.Jan 23 2023, 7:17 AM
ftynse added inline comments.
mlir/lib/Dialect/Affine/IR/AffineOps.cpp
345–346

It would be nice, thanks!

This revision was automatically updated to reflect the committed changes.