From: Anna Thomas Date: Thu, 3 Jan 2019 17:44:44 +0000 (+0000) Subject: [UnrollRuntime] Add DomTree verification under debug mode X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5be1fd019419678fc5618bb309f3f62571c4fd2;p=llvm [UnrollRuntime] Add DomTree verification under debug mode 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 --- diff --git a/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/lib/Transforms/Utils/LoopUnrollRuntime.cpp index 2981e6e2c52..a60becac649 100644 --- a/lib/Transforms/Utils/LoopUnrollRuntime.cpp +++ b/lib/Transforms/Utils/LoopUnrollRuntime.cpp @@ -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.