This is an archive of the discontinued LLVM Phabricator instance.

[Linalg] Remove Optional from getStaticLoopRanges interface method.
ClosedPublic

Authored by hanchung on Apr 27 2022, 11:54 PM.

Details

Summary

It is very wrong if the ranges can't be infered. It's also checked in
verifyStructuredOpInterface, so we don't need the Optional return type.

Diff Detail

Event Timeline

hanchung created this revision.Apr 27 2022, 11:54 PM
hanchung requested review of this revision.Apr 27 2022, 11:54 PM
hanchung updated this revision to Diff 425961.Apr 28 2022, 9:07 PM

update comments

springerm added inline comments.Apr 29 2022, 5:31 AM
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
1011

What if getShapesToLoopsMap fails? Should we maybe assert?

hanchung updated this revision to Diff 426593.May 3 2022, 12:59 AM

add asserts

hanchung marked an inline comment as done.May 3 2022, 1:00 AM
hanchung added inline comments.
mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
1011

good point, this is expected to only be called by a valid Linalg op. I added an assert and comments to it.

springerm accepted this revision.May 3 2022, 4:20 AM
This revision is now accepted and ready to land.May 3 2022, 4:20 AM
This revision was automatically updated to reflect the committed changes.
hanchung marked an inline comment as done.