This is an archive of the discontinued LLVM Phabricator instance.

[LoopFlatten] Mark inner loop as deleted
ClosedPublic

Authored by nikic on Oct 7 2021, 1:03 PM.

Details

Summary

If a loop is flattened, the inner loop is removed and the LPM should be informed of this fact, so it can invalidate associated analyses. To support this, we relax an assertion in LPMUpdater to allow invalidating non-top-level loops when running in LoopNestMode, as the pass does not know how exactly it will get scheduled.

Diff Detail

Event Timeline

nikic created this revision.Oct 7 2021, 1:03 PM
nikic requested review of this revision.Oct 7 2021, 1:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2021, 1:03 PM

if we have a loop nest pass in one pass manager delete a loop without invalidating its analyses, then another loop pass in a different pass manager allocate a loop at the same address I think we could still see invalid cached analyses

LoopAnalysisManagerFunctionProxy::Result::invalidate() may walk through LoopInfo to get a list of loops to clear analyses, and if we delete a loop, we won't clear the corresponding cached analyses. We can always blow away the entire LoopAnalysisManagerFunctionProxy, but always properly invalidating seems cleaner and there's less chance of things silently going wrong.

nikic updated this revision to Diff 378341.Oct 8 2021, 1:03 PM
nikic edited the summary of this revision. (Show Details)

Always invalidate, independently of LoopNestMode.

aeubanks accepted this revision.Oct 8 2021, 1:13 PM
This revision is now accepted and ready to land.Oct 8 2021, 1:13 PM
This revision was landed with ongoing or failed builds.Oct 8 2021, 2:12 PM
This revision was automatically updated to reflect the committed changes.