]> granicus.if.org Git - llvm/commitdiff
[UnrollRuntime] Add DomTree verification under debug mode
authorAnna Thomas <anna@azul.com>
Thu, 3 Jan 2019 17:44:44 +0000 (17:44 +0000)
committerAnna Thomas <anna@azul.com>
Thu, 3 Jan 2019 17:44:44 +0000 (17:44 +0000)
NFC: This adds the dom tree verification under debug mode at a point
just before we start unrolling the loop. This allows us to verify dom
tree at a state where it is much smaller and before the unrolling
actually happens.
This also implies we do not need to run -verify-dom-info everytime to
see if the DT is in a valid state when we transform the loop for runtime
unrolling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350334 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/LoopUnrollRuntime.cpp

index 2981e6e2c527c6973b04f6a0932dadacba3d4fd3..a60becac649749da761799b5afe3470e1e6cce9e 100644 (file)
@@ -927,6 +927,12 @@ bool llvm::UnrollRuntimeLoopRemainder(Loop *L, unsigned Count,
   // of its parent loops, so the Scalar Evolution pass needs to be run again.
   SE->forgetTopmostLoop(L);
 
+  // Verify that the Dom Tree is correct.
+#if !defined(NDEBUG)
+  if (DT)
+    assert(DT->verify(DominatorTree::VerificationLevel::Full));
+#endif
+
   // Canonicalize to LoopSimplifyForm both original and remainder loops. We
   // cannot rely on the LoopUnrollPass to do this because it only does
   // canonicalization for parent/subloops and not the sibling loops.