Verify MemorySSA after all updates.

Verify after completing all updates.
Resolves PR46275.
This commit is contained in:
Alina Sbirlea 2020-06-11 18:16:33 -07:00
parent 10bd67c1bd
commit 519b019a0a
2 changed files with 25 additions and 2 deletions

View File

@ -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();
}
}

View File

@ -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
}