This is an archive of the discontinued LLVM Phabricator instance.

[mlir][scf] Simplify the logic for `replaceLoopWithNewYields` for perfectly nested loops.
ClosedPublic

Authored by mravishankar on Sep 28 2022, 2:42 PM.

Details

Summary

Based on discussion in https://reviews.llvm.org/D134411, instead of
first modifying the inner most loop first followed by modifying the
outer loops from inside out, this patch restructures the logic to
start the modification from the outer most loop.

Diff Detail

Event Timeline

mravishankar created this revision.Sep 28 2022, 2:42 PM
mravishankar requested review of this revision.Sep 28 2022, 2:42 PM
nicolasvasilache accepted this revision.Sep 29 2022, 5:49 AM

Much better, thanks @mravishankar !

Please add a comment on (and maybe even an assert to limit the amount of) bounded recursion: https://discourse.llvm.org/t/rfc-update-to-mlir-developer-policy-on-recursion/62235

This revision is now accepted and ready to land.Sep 29 2022, 5:49 AM