[SCEV] Fix an unused variable in -DLLVM_ENABLE_ASSERTIONS=off build
authorFangrui Song <i@maskray.me>
Fri, 18 Sep 2020 23:16:14 +0000 (16:16 -0700)
committerFangrui Song <i@maskray.me>
Fri, 18 Sep 2020 23:19:05 +0000 (16:19 -0700)
llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp

index 165030c..7621f1f 100644 (file)
@@ -2382,8 +2382,8 @@ bool SCEVExpander::isHighCostExpansionHelper(
       costAndCollectOperands<SCEVNAryExpr>(WorkItem, TTI, CostKind, Worklist);
     BudgetRemaining -= Cost;
     return BudgetRemaining < 0;
-  } else if (const auto *NAry = dyn_cast<SCEVAddRecExpr>(S)) {
-    assert(NAry->getNumOperands() >= 2 &&
+  } else if (isa<SCEVAddRecExpr>(S)) {
+    assert(cast<SCEVAddRecExpr>(S)->getNumOperands() >= 2 &&
            "Polynomial should be at least linear");
     BudgetRemaining -= costAndCollectOperands<SCEVAddRecExpr>(
       WorkItem, TTI, CostKind, Worklist);