[PATCH] D98805: [NewPM] Verify LoopAnalysisResults after a loop pass
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 17 12:23:40 PDT 2021
aeubanks created this revision.
aeubanks added a reviewer: asbirlea.
Herald added a subscriber: hiraditya.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D98805
Files:
llvm/lib/Transforms/Scalar/LoopPassManager.cpp
Index: llvm/lib/Transforms/Scalar/LoopPassManager.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LoopPassManager.cpp
+++ llvm/lib/Transforms/Scalar/LoopPassManager.cpp
@@ -291,8 +291,15 @@
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())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98805.331345.patch
Type: text/x-patch
Size: 812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210317/58874ef8/attachment.bin>
More information about the llvm-commits
mailing list