Fix opt build where compiled out assert leaves unused local variable.
authorMLIR Team <no-reply@google.com>
Wed, 5 Sep 2018 14:38:20 +0000 (07:38 -0700)
committerjpienaar <jpienaar@google.com>
Fri, 29 Mar 2019 20:09:44 +0000 (13:09 -0700)
PiperOrigin-RevId: 211631896

mlir/lib/Analysis/AffineStructures.cpp

index f42d4654a50c76b709a0f3b99c36937c7f667f43..bff76a837fdb46b37b3b8bebccc4bb8663359aeb 100644 (file)
@@ -38,9 +38,8 @@ static AffineExpr *toAffineExpr(ArrayRef<int64_t> eq, unsigned numDims,
                                 unsigned numSymbols,
                                 ArrayRef<AffineExpr *> localExprs,
                                 MLIRContext *context) {
-  unsigned numLocals = eq.size() - numDims - numSymbols - 1;
-
-  assert(numLocals == localExprs.size() &&
+  // Assert expected numLocals = eq.size() - numDims - numSymbols - 1
+  assert(eq.size() - numDims - numSymbols - 1 == localExprs.size() &&
          "unexpected number of local expressions");
 
   AffineExpr *expr = AffineConstantExpr::get(0, context);