This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Add scf.for loop peeling to codegen strategy
ClosedPublic

Authored by springerm on Aug 31 2021, 11:09 PM.

Details

Summary

Only scf.for loops are supported at the moment. linalg.tiled_loop support will be added in a subsequent commit.

Only static tensor sizes are fully supported. Loops for dynamic tensor sizes can be peeled, but the generated code is not optimal due to a missing canonicalization pattern.

Diff Detail

Event Timeline

springerm created this revision.Aug 31 2021, 11:09 PM
springerm requested review of this revision.Aug 31 2021, 11:09 PM
springerm updated this revision to Diff 370710.Sep 4 2021, 1:31 AM

no change

springerm updated this revision to Diff 371250.Sep 7 2021, 8:29 PM

Do not use markers anymore. Instead, peel loops right after generating them.

I'll let this one simmer until you had a chance to decide whether you update scf.for peeling to be consistent with linalg.tiled_loop peeling.
Ping me if you want me to review.

springerm edited the summary of this revision. (Show Details)Sep 10 2021, 3:48 AM

This is ready for review now.

LGTM, thanks!

This revision is now accepted and ready to land.Sep 13 2021, 12:46 PM
This revision was landed with ongoing or failed builds.Sep 13 2021, 6:35 PM
This revision was automatically updated to reflect the committed changes.