This is an archive of the discontinued LLVM Phabricator instance.

Don't fail if unable to promote loops during unrolling
ClosedPublic

Authored by nimiwio on Dec 8 2021, 11:03 AM.

Details

Summary

When the unroll factor is 1, we should only fail "unrolling" when the trip count also is determined to be 1 and it is unable to be promoted.

Diff Detail

Event Timeline

nimiwio created this revision.Dec 8 2021, 11:03 AM
nimiwio requested review of this revision.Dec 8 2021, 11:03 AM
nimiwio planned changes to this revision.Dec 8 2021, 11:44 AM

Sorry didn't mean to send this for review quite yet, I still need to tweak this a bit, and add tests.

nimiwio updated this revision to Diff 392965.Dec 8 2021, 3:56 PM

Add checks for trip count and tests

bondhugula added a subscriber: bondhugula.

Is this ready for review?

mlir/test/Transforms/scf-loop-unroll.mlir
53

Use test.foo. (That will eventually make it easier to get rid of all unregistered ops.)

nimiwio updated this revision to Diff 394072.Dec 13 2021, 3:46 PM
nimiwio marked an inline comment as done.

Use test.foo

Is this ready for review?

Yes this is ready now for review

bondhugula accepted this revision.Dec 21 2021, 10:27 AM
bondhugula added inline comments.
mlir/test/Dialect/Affine/unroll.mlir
634

We don't need this test case - it's redundant and isn't testing anything more?

637

Please use test.foo.

641

You can drop the %{{.*}} = part.

This revision is now accepted and ready to land.Dec 21 2021, 10:27 AM
bondhugula added inline comments.Dec 21 2021, 10:27 AM
mlir/test/Transforms/scf-loop-unroll.mlir
60–76

Likewise.

nimiwio updated this revision to Diff 395900.Dec 22 2021, 10:32 AM
nimiwio marked 4 inline comments as done.

Address comments

bondhugula accepted this revision.Jan 10 2022, 6:59 AM

Thank you for the review! Can this be landed?

This revision was automatically updated to reflect the committed changes.