This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Fix affine loop unroll for zero trip count loops
ClosedPublic

Authored by bondhugula on Oct 7 2021, 7:49 PM.

Details

Summary

Fix affine loop unroll for zero trip count loops. Add missing check.

Diff Detail

Event Timeline

bondhugula created this revision.Oct 7 2021, 7:49 PM
bondhugula requested review of this revision.Oct 7 2021, 7:50 PM
bondhugula updated this revision to Diff 378071.Oct 7 2021, 7:56 PM
bondhugula retitled this revision from [MLIR] Fix affine loop unroll corner case for full unroll to [MLIR] Fix affine loop unroll for zero trip count loops.
bondhugula edited the summary of this revision. (Show Details)

Update commit title/summary.

Simple clarification.

mlir/lib/Transforms/Utils/LoopUtils.cpp
1056

return failure() here ?, since nothing is done. I see that the return value is being used only at one place, and failure() would be more appropriate.

This comment was removed by bondhugula.
mlir/lib/Transforms/Utils/LoopUtils.cpp
1056

The failure() is meant to indicate the utility failed to do the desired transformation (i.e., it could not because of some condition that wasn't supported, handled, or other inability). This isn't really a failure but a trivial success (it has been unrolled trivially so to say).

dcaballe accepted this revision.Oct 8 2021, 12:52 AM

LGTM, thanks!

This revision is now accepted and ready to land.Oct 8 2021, 12:52 AM
bondhugula marked an inline comment as done.Oct 10 2021, 9:52 PM