diff --git a/llvm/include/llvm/Support/GenericDomTreeConstruction.h b/llvm/include/llvm/Support/GenericDomTreeConstruction.h index b9d398fee2b74..97c1f498fce81 100644 --- a/llvm/include/llvm/Support/GenericDomTreeConstruction.h +++ b/llvm/include/llvm/Support/GenericDomTreeConstruction.h @@ -813,7 +813,7 @@ struct SemiNCAInfo { LLVM_DEBUG(dbgs() << "\t\tMarking visited not affected " << BlockNamePrinter(Succ) << "\n"); UnaffectedOnCurrentLevel.push_back(SuccTN); -#ifndef NDEBUG +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS II.VisitedUnaffected.push_back(SuccTN); #endif } else { @@ -847,7 +847,7 @@ struct SemiNCAInfo { TN->setIDom(NCD); } -#if defined(LLVM_ENABLE_ABI_BREAKING_CHECKS) && !defined(NDEBUG) +#if LLVM_ENABLE_ABI_BREAKING_CHECKS && !defined(NDEBUG) for (const TreeNodePtr TN : II.VisitedUnaffected) assert(TN->getLevel() == TN->getIDom()->getLevel() + 1 && "TN should have been updated by an affected ancestor"); diff --git a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h index 227f6dfb8362c..7d8162607c986 100644 --- a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h @@ -325,7 +325,7 @@ class LPMUpdater { /// loops within them will be visited in postorder as usual for the loop pass /// manager. void addSiblingLoops(ArrayRef NewSibLoops) { -#if defined(LLVM_ENABLE_ABI_BREAKING_CHECKS) && !defined(NDEBUG) +#if LLVM_ENABLE_ABI_BREAKING_CHECKS && !defined(NDEBUG) for (Loop *NewL : NewSibLoops) assert(NewL->getParentLoop() == ParentL && "All of the new loops must be siblings of the current loop!"); diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index dd7c89034ca09..1ba05af2b7cb1 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -1919,7 +1919,7 @@ bool IndVarSimplify::run(Loop *L) { // Create a rewriter object which we'll use to transform the code with. SCEVExpander Rewriter(*SE, DL, "indvars"); -#ifndef NDEBUG +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS Rewriter.setDebugType(DEBUG_TYPE); #endif diff --git a/llvm/lib/Transforms/Scalar/LoopPassManager.cpp b/llvm/lib/Transforms/Scalar/LoopPassManager.cpp index a4f2dbf9a5828..2f61b7b48ddd1 100644 --- a/llvm/lib/Transforms/Scalar/LoopPassManager.cpp +++ b/llvm/lib/Transforms/Scalar/LoopPassManager.cpp @@ -293,7 +293,7 @@ PreservedAnalyses FunctionToLoopPassAdaptor::run(Function &F, Updater.CurrentL = L; Updater.SkipCurrentLoop = false; -#ifndef NDEBUG +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS // Save a parent loop pointer for asserts. Updater.ParentL = L->getParentLoop(); #endif diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 73ed611e8de8c..66d60e170000b 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -5905,7 +5905,7 @@ LSRInstance::LSRInstance(Loop *L, IVUsers &IU, ScalarEvolution &SE, // Configure SCEVExpander already now, so the correct mode is used for // isSafeToExpand() checks. -#ifndef NDEBUG +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS Rewriter.setDebugType(DEBUG_TYPE); #endif Rewriter.disableCanonicalMode(); @@ -6981,7 +6981,7 @@ static bool ReduceLoopStrength(Loop *L, IVUsers &IU, ScalarEvolution &SE, SmallVector DeadInsts; const DataLayout &DL = L->getHeader()->getModule()->getDataLayout(); SCEVExpander Rewriter(SE, DL, "lsr", false); -#ifndef NDEBUG +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS Rewriter.setDebugType(DEBUG_TYPE); #endif unsigned numFolded = Rewriter.replaceCongruentIVs(L, &DT, DeadInsts, &TTI); diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp index 912c02c2ed3ae..b9c257f0dbcb2 100644 --- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp @@ -1016,7 +1016,7 @@ bool simplifyLoopIVs(Loop *L, ScalarEvolution *SE, DominatorTree *DT, LoopInfo *LI, const TargetTransformInfo *TTI, SmallVectorImpl &Dead) { SCEVExpander Rewriter(*SE, SE->getDataLayout(), "indvars"); -#ifndef NDEBUG +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS Rewriter.setDebugType(DEBUG_TYPE); #endif bool Changed = false;