[runtimeunroll] Under EXPENSIVE_CHECKS, validate loop info
authorPhilip Reames <listmail@philipreames.com>
Thu, 2 Sep 2021 23:27:45 +0000 (16:27 -0700)
committerPhilip Reames <listmail@philipreames.com>
Thu, 2 Sep 2021 23:28:46 +0000 (16:28 -0700)
Requested in review comment on D108476

llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp

index 86aa43c..105c628 100644 (file)
@@ -939,10 +939,12 @@ bool llvm::UnrollRuntimeLoopRemainder(
   // of its parent loops, so the Scalar Evolution pass needs to be run again.
   SE->forgetTopmostLoop(L);
 
-  // Verify that the Dom Tree is correct.
+  // Verify that the Dom Tree and Loop Info are correct.
 #if defined(EXPENSIVE_CHECKS) && !defined(NDEBUG)
-  if (DT)
+  if (DT) {
     assert(DT->verify(DominatorTree::VerificationLevel::Full));
+    LI->verify(*DT);
+  }
 #endif
 
   // For unroll factor 2 remainder loop will have 1 iteration.