diff --git a/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp b/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp @@ -185,9 +185,10 @@ if (!convOp.padding()) return im(imIdx); + auto *context = ScopedContext::getContext(); ValueHandle zeroIndex = std_constant_index(0); SmallVector conds = { - std_constant_int(/*value=*/1, /*width=*/1)}; + std_constant(BoolAttr::get(true, context))}; SmallVector clampedImIdx; for (auto iter : llvm::enumerate(imIdx)) { int idx = iter.index(); @@ -207,7 +208,6 @@ // When padding is involed, the indices will only be shifted to negative, // so having a max op is enough. - auto *context = ScopedContext::getContext(); auto maxMap = AffineMap::get(/*dimCount=*/1, 0, {getAffineDimExpr(/*position=*/0, context), getAffineConstantExpr(0, context)});