diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -1214,9 +1214,8 @@ if (auto val = ofr.dyn_cast()) return val; auto intVal = getConstantIntValue(ofr); - auto intAttr = ofr.dyn_cast().dyn_cast_or_null(); assert(intVal && "expected Value or IntegerAttr"); - return builder.create(loc, intAttr.getInt()); + return builder.create(loc, *intVal); } SmallVector PadTensorOp::getDestinationOperands(OpBuilder &b) {