1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[NewPM] Verify LoopAnalysisResults after a loop pass

All loop passes should preserve all analyses in LoopAnalysisResults. Add
checks for those.

Note that due to PR44815, we don't check LAR's ScalarEvolution.
Apparently calling SE.verify() can change its results.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D98805
This commit is contained in:
Arthur Eubanks 2021-03-17 12:21:59 -07:00
parent 7965564c8e
commit 57267d06c3

View File

@ -291,8 +291,15 @@ PreservedAnalyses FunctionToLoopPassAdaptor::run(Function &F,
else
PI.runAfterPass<Loop>(*Pass, *L, PassPA);
// FIXME: We should verify the set of analyses relevant to Loop passes
// are preserved.
#ifndef NDEBUG
// LoopAnalysisResults should always be valid.
// Note that we don't LAR.SE.verify() because that can change observed SE
// queries. See PR44815.
LAR.DT.verify();
LAR.LI.verify(LAR.DT);
if (LAR.MSSA)
LAR.MSSA->verifyMemorySSA();
#endif
// If the loop hasn't been deleted, we need to handle invalidation here.
if (!Updater.skipCurrentLoop())