This is an archive of the discontinued LLVM Phabricator instance.

[runtimeunroll] Support epilogue unrolling with a parent loop
ClosedPublic

Authored by reames on Aug 20 2021, 11:02 AM.

Details

Summary

This patch adds support for unrolling inner loops using epilogue unrolling. Specifically, it handles the case where we use a remainder *loop*. If we use a remainder *block* (e.g. break the backedge when Count == 2), there's more work needed so that case is excluded from this patch.

p.s. The obvious solution of treating the epilogue block form as an optimization of epilogue loop and just emitting a loop for the Count == 2 with parent case fails tests related to pass manger loop visit order.

Diff Detail

Event Timeline

reames created this revision.Aug 20 2021, 11:02 AM
reames requested review of this revision.Aug 20 2021, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 20 2021, 11:02 AM
reames edited the summary of this revision. (Show Details)Aug 20 2021, 11:22 AM
reames added inline comments.Aug 22 2021, 1:13 PM
llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
425–426

FYI, this FIXME can be removed when D108521 has been landed.

reames updated this revision to Diff 369723.Aug 31 2021, 9:51 AM

Rebase and simplify after landing D108521

anna accepted this revision.Sep 2 2021, 10:42 AM

LGTM

llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
735

Can we add an LI.verify(DT) at the end of this transform, to make sure LI is in sync with CFG?

This revision is now accepted and ready to land.Sep 2 2021, 10:42 AM