This is an archive of the discontinued LLVM Phabricator instance.

[WIP][LICM] Extend must execute to path taken on first iteration
AbandonedPublic

Authored by reames on Mar 8 2018, 10:38 PM.

Details

Summary

This is a work in progress similar in goal to https://reviews.llvm.org/D44287, but taking a different approach. The idea herein is to identify a path which is provably taken on the fist iteration. At the moment, this covers many of the same test cases as D44287, but in theory, the cases handled are partially non-overlapping. (Note: The tests posted are just the same ones from D44287 at the moment.)

If I decide to pursue this for real, I figured having a proof of concept to motivate the refactoring changes to support efficient implicit control flow reasoning would be worthwhile, thus the WIP patch.

Diff Detail

Event Timeline

reames created this revision.Mar 8 2018, 10:38 PM
reames updated this revision to Diff 137698.Mar 9 2018, 9:06 AM
mkazantsev added inline comments.Mar 11 2018, 10:26 PM
lib/Transforms/Utils/LoopUtils.cpp
1519

This comment looks out of sync. The method does not return true, and it does not have any ExitBlock as a parameter.

1520

Assert that the loop has one backedge?

1522

Asterisk misplaced.

1533

Make it Optional and return None as an option.

1601

How about if (LI.isLoopHeader(Next))? You have just check that you don't leave the current loop, so any header is either your header or a header of some inner loop.

reames planned changes to this revision.Jan 25 2019, 10:11 AM
reames abandoned this revision.Oct 19 2019, 2:40 PM

No longer actively working on this, may return to it in the future.