Page MenuHomePhabricator

[UnrollRuntime] Support multi-exiting blocks to LatchExit
Changes PlannedPublic

Authored by anna on Jan 8 2019, 12:41 PM.

Details

Summary

This patch implements runtime unrolling for multi-exit loops where
there are multiple exiting blocks that go to the latchExit.
This requires updating the ConnectProlog and ConnectEpilog code.

For this patch, the implementation is only for remainder code which is
prolog code. Added test cases for various scenarios.
No DT or LI changes required.

Diff Detail

Event Timeline

anna created this revision.Jan 8 2019, 12:41 PM
mkazantsev added inline comments.Jan 10 2019, 9:40 PM
lib/Transforms/Utils/LoopUnrollRuntime.cpp
105

Line too long.

121

Could you please add more comments on this piece of logic? I don't quite understand it. Why do we make difference between phi latch inputs that come from inside the loop and from outside the loop?

124

Maybe dyn_cast here and remove cast on line below?

137

That looks like it can go as a separate NFC.

142

Why can we expect that? Other usage in code accounts for nullptr case.

efriedma added inline comments.
lib/Transforms/Utils/LoopUnrollRuntime.cpp
508

I don't like the "!DT" check; if the domtree is required to unroll certain loops, we should just assert that the caller always passes a domtree. (I haven't reviewed the logic carefully to see if the dominates() check is strictly necessary.)

anna planned changes to this revision.Jan 22 2019, 5:39 AM

need to update comments and address review comments. moving out of queue for now.