Fix unused variable in release build.
authorMaheshRavishankar <ravishankarm@google.com>
Tue, 31 Aug 2021 02:29:34 +0000 (19:29 -0700)
committerMaheshRavishankar <ravishankarm@google.com>
Tue, 31 Aug 2021 02:34:52 +0000 (19:34 -0700)
Differential Revision: https://reviews.llvm.org/D108963

mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp

index 8172eac..ddcb6a6 100644 (file)
@@ -1214,9 +1214,8 @@ static Value getAsValue(OpBuilder &builder, Location loc, OpFoldResult ofr) {
   if (auto val = ofr.dyn_cast<Value>())
     return val;
   auto intVal = getConstantIntValue(ofr);
-  auto intAttr = ofr.dyn_cast<Attribute>().dyn_cast_or_null<IntegerAttr>();
   assert(intVal && "expected Value or IntegerAttr");
-  return builder.create<ConstantIndexOp>(loc, intAttr.getInt());
+  return builder.create<ConstantIndexOp>(loc, *intVal);
 }
 
 SmallVector<Value> PadTensorOp::getDestinationOperands(OpBuilder &b) {