This is an archive of the discontinued LLVM Phabricator instance.

[LoopPassManager] Implement and use LoopNestAnalysis::run() instead of manually creating LoopNests
Changes PlannedPublic

Authored by aeubanks on Aug 24 2022, 11:19 AM.

Details

Summary

The current code is basically just emulating what the analysis manager does.

Diff Detail

Event Timeline

aeubanks created this revision.Aug 24 2022, 11:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 11:19 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
aeubanks requested review of this revision.Aug 24 2022, 11:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 11:19 AM
aeubanks retitled this revision from [LoopPassManager] Directly use LoopNestAnalysis::run() to [LoopPassManager] Implement and use LoopNestAnalysis::run() instead of manually creating LoopNests.Aug 24 2022, 4:02 PM
aeubanks added a reviewer: asbirlea.
asbirlea accepted this revision.Aug 29 2022, 3:08 PM
This revision is now accepted and ready to land.Aug 29 2022, 3:08 PM
This revision was landed with ongoing or failed builds.Sep 2 2022, 10:59 AM
This revision was automatically updated to reflect the committed changes.
uabelho added a subscriber: uabelho.Sep 5 2022, 2:56 AM

Hello,

I bisected a crash back to this commit:

opt -passes='function(loop-flatten,loop(loop-unroll-and-jam,loop-deletion))' bbi-73307.ll -o /dev/null

crashes with

opt: ../include/llvm/Analysis/LoopInfo.h:160: const std::vector<LoopT *> &llvm::LoopBase<llvm::BasicBlock, llvm::Loop>::getSubLoops() const [BlockT = llvm::BasicBlock, LoopT = llvm::Loop]: Assertion `!isInvalid() && "Loop not in a valid state!"' failed.

aeubanks reopened this revision.Sep 13 2022, 10:15 AM

reverted

I think the issue is that the loop nest analysis is a loop analysis. If we already have the loop nest analysis cached, if there's an inner loop that gets modified (deleted in this case), the loop nest analysis on the outer-most loop is not invalidated. Perhaps the loop nest shouldn't be a loop analysis.

This revision is now accepted and ready to land.Sep 13 2022, 10:15 AM
aeubanks planned changes to this revision.Sep 13 2022, 10:15 AM