This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] NFC. affine data copy generate utility return value cleanup
ClosedPublic

Authored by bondhugula on Jan 13 2022, 4:02 AM.

Details

Summary

Clean up return value on affineDataCopyGenerate utility. Return the
actual success/failure status instead of the "number of bytes" which
isn't being used in the codebase in any way. The success/failure status
wasn't being sent out earlier.

Diff Detail

Event Timeline

bondhugula created this revision.Jan 13 2022, 4:02 AM
bondhugula requested review of this revision.Jan 13 2022, 4:02 AM

Remove duplicated comments.

dcaballe accepted this revision.Jan 13 2022, 6:56 AM

LGTM. Just a minor comment.

mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp
98

Not sure I understand the LogicalResult -> void in runOnBlock. If runOnBlock is calling affineDataCopyGenerate which is now returning a LogicalResult, wouldn't it make sense that runOnBlock continues to return LogicalResult and and propagates the return value of affineDataCopyGenerate when appropriate?

This revision is now accepted and ready to land.Jan 13 2022, 6:56 AM
bondhugula added inline comments.Jan 13 2022, 4:07 PM
mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp
98

runOnBlock makes multiple calls to affineDataCopyGenerate and although we could make it return success if everything succeeded, the overall failure or success status of it isn't that meaningful or used in any way at the top level. runOnFunction itself calls runOnBlock multiple times and the IR is still valid and useful if even on partial failure. So I decided to not propagate "aggregate status" up further.