[LCSSA] Add expensive verification of LCSSA form for sub-loops.

This assertion makes sure all sub-loops are in LCSSA form before
bringing their parent in LCSSA form. This precondition was added to
formLCSSA in D56848.

Reviewers: davide, efriedma, mzolotukhin

Reviewed By: davide

Differential Revision: https://reviews.llvm.org/D56921

llvm-svn: 352958
This commit is contained in:
Florian Hahn 2019-02-02 14:42:27 +00:00
parent 44d6f9e131
commit 509b48a64a
1 changed files with 6 additions and 0 deletions

View File

@ -305,6 +305,12 @@ bool llvm::formLCSSA(Loop &L, DominatorTree &DT, LoopInfo *LI,
ScalarEvolution *SE) {
bool Changed = false;
#ifdef EXPENSIVE_CHECKS
// Verify all sub-loops are in LCSSA form already.
for (Loop *SubLoop: L)
assert(SubLoop->isRecursivelyLCSSAForm(DT, *LI) && "Subloop not in LCSSA!");
#endif
SmallVector<BasicBlock *, 8> ExitBlocks;
L.getExitBlocks(ExitBlocks);
if (ExitBlocks.empty())