This is an archive of the discontinued LLVM Phabricator instance.

[LoopUnroll] Clean up exit folding (NFC)
ClosedPublic

Authored by nikic on May 28 2021, 12:01 PM.

Details

Summary

This does some non-functional cleanup of exit folding during unrolling. The two main changes are:

  • First rewrite latch->header edges, which is unrelated to exit folding.
  • Combine folding for latch and non-latch exits. After the previous change, these use the same logic, with the caveat that for non-latch exits we currently only fold "known non-exit" cases, but not "known exit" cases.

I think this helps a lot to clarify this code and prepare it for future changes.

Diff Detail

Event Timeline

nikic created this revision.May 28 2021, 12:01 PM
nikic requested review of this revision.May 28 2021, 12:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2021, 12:01 PM
reames accepted this revision.May 28 2021, 1:16 PM

LGTM, this looks correct to me, and definitely helps to simplify the code!

This revision is now accepted and ready to land.May 28 2021, 1:16 PM
This revision was landed with ongoing or failed builds.May 28 2021, 1:31 PM
This revision was automatically updated to reflect the committed changes.