[LCSSAVerification] Run verification only when asserts are enabled.
authorMichael Zolotukhin <mzolotukhin@apple.com>
Wed, 7 Feb 2018 00:13:08 +0000 (00:13 +0000)
committerMichael Zolotukhin <mzolotukhin@apple.com>
Wed, 7 Feb 2018 00:13:08 +0000 (00:13 +0000)
llvm-svn: 324429

llvm/lib/Analysis/LoopPass.cpp

index 9af717bafdca52668edaff896d58346f9a792c2f..d4e9021ee1fe8f5346a97b082262b05684d4539e 100644 (file)
@@ -151,7 +151,9 @@ void LPPassManager::markLoopAsDeleted(Loop &L) {
 bool LPPassManager::runOnFunction(Function &F) {
   auto &LIWP = getAnalysis<LoopInfoWrapperPass>();
   LI = &LIWP.getLoopInfo();
+#ifndef NDEBUG
   DominatorTree *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
+#endif
   bool Changed = false;
 
   // Collect inherited analysis from Module level pass manager.
@@ -226,7 +228,7 @@ bool LPPassManager::runOnFunction(Function &F) {
         // form (LoopPassPrinter for example). We should skip verification for
         // such passes.
         if (mustPreserveAnalysisID(LCSSAVerificationPass::ID))
-          CurrentLoop->isRecursivelyLCSSAForm(*DT, *LI);
+          assert(CurrentLoop->isRecursivelyLCSSAForm(*DT, *LI));
 
         // Then call the regular verifyAnalysis functions.
         verifyPreservedAnalysis(P);