[llvm] 519b019 - Verify MemorySSA after all updates.
Alina Sbirlea via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 11 18:49:14 PDT 2020
Author: Alina Sbirlea
Date: 2020-06-11T18:48:41-07:00
New Revision: 519b019a0a6cd50b34c90d1ec7004bb802d680e8
URL: https://github.com/llvm/llvm-project/commit/519b019a0a6cd50b34c90d1ec7004bb802d680e8
DIFF: https://github.com/llvm/llvm-project/commit/519b019a0a6cd50b34c90d1ec7004bb802d680e8.diff
LOG: Verify MemorySSA after all updates.
Verify after completing all updates.
Resolves PR46275.
Added:
llvm/test/Analysis/MemorySSA/pr46275.ll
Modified:
llvm/lib/Transforms/Utils/LoopUtils.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index d7ea9923ed2e..16603bfd0eb1 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -622,11 +622,11 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE,
if (MSSA) {
MSSAU->applyUpdates({{DominatorTree::Delete, Preheader, L->getHeader()}},
*DT);
- if (VerifyMemorySSA)
- MSSA->verifyMemorySSA();
SmallSetVector<BasicBlock *, 8> DeadBlockSet(L->block_begin(),
L->block_end());
MSSAU->removeBlocks(DeadBlockSet);
+ if (VerifyMemorySSA)
+ MSSA->verifyMemorySSA();
}
}
diff --git a/llvm/test/Analysis/MemorySSA/pr46275.ll b/llvm/test/Analysis/MemorySSA/pr46275.ll
new file mode 100644
index 000000000000..01b71b6a38e5
--- /dev/null
+++ b/llvm/test/Analysis/MemorySSA/pr46275.ll
@@ -0,0 +1,23 @@
+; RUN: opt -S -memoryssa -loop-deletion -loop-simplifycfg -verify-memoryssa < %s | FileCheck %s
+; REQUIRES: asserts
+
+; CHECK-LABEL: @foo()
+define void @foo() {
+entry:
+ br i1 false, label %for.body.lr.ph, label %for.end
+
+for.body.lr.ph: ; preds = %entry
+ br label %for.body
+
+for.body: ; preds = %for.body, %for.body.lr.ph
+ call void @foo()
+ call void @foo()
+ br i1 false, label %for.body, label %for.cond.for.end_crit_edge
+
+for.cond.for.end_crit_edge: ; preds = %for.body
+ unreachable
+
+for.end: ; preds = %entry
+ ret void
+}
+
More information about the llvm-commits
mailing list