This is an archive of the discontinued LLVM Phabricator instance.

[LoopNest] Extend `LPMUpdater` and adaptor to handle loop-nest passes
ClosedPublic

Authored by TaWeiTu on Sep 11 2020, 10:43 AM.

Details

Summary

This is a follow-up patch of D87045.

The patch implements "loop-nest mode" for LPMUpdater and FunctionToLoopPassAdaptor in which only top-level loops are operated.

createFunctionToLoopPassAdaptor decides whether the returned adaptor is in loop-nest mode or not based on the given pass. If the pass is a loop-nest pass or the pass is a LoopPassManager which contains only loop-nest passes, the loop-nest version of adaptor is returned; otherwise, the normal (loop) version of adaptor is returned.

Diff Detail

Event Timeline

TaWeiTu created this revision.Sep 11 2020, 10:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 11 2020, 10:43 AM
TaWeiTu requested review of this revision.Sep 11 2020, 10:43 AM
TaWeiTu edited the summary of this revision. (Show Details)Sep 11 2020, 10:49 AM
TaWeiTu added reviewers: Whitney, ychen, etiotto, fhahn.
TaWeiTu updated this revision to Diff 291283.Sep 11 2020, 11:15 AM
Whitney accepted this revision.Sep 15 2020, 5:29 AM

LGTM.

This revision is now accepted and ready to land.Sep 15 2020, 5:29 AM
TaWeiTu updated this revision to Diff 295165.Sep 29 2020, 8:01 PM

Rebased on top of the current master. Add comments about loop/loop-nest mode.

TaWeiTu updated this revision to Diff 296123.Oct 5 2020, 2:21 AM
asbirlea added inline comments.
llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
242

s/will no/will not

264

legibility:
(!LoopNestMode || !L.getParentLoop())
or more detailed
(!LoopNestMode || (LoopNestMode && !L.getParentLoop()))
?

TaWeiTu updated this revision to Diff 296571.Oct 6 2020, 6:25 PM
TaWeiTu added a reviewer: asbirlea.

Address comments.

TaWeiTu updated this revision to Diff 298988.Oct 19 2020, 3:27 AM
asbirlea added inline comments.Nov 16 2020, 5:39 PM
llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
473

Could you clarify this?

TaWeiTu updated this revision to Diff 305662.Nov 16 2020, 10:48 PM

Clarify the specializations of createFunctionToLoopPassAdaptor()

Since D87045 has been landed, is there any objection against committing this patch as well?
I'll wait for a few days to see whether the reviewers are happy with the patch or not before landing it.
Thanks!

Since D87045 has been landed, is there any objection against committing this patch as well?

No objection from me.