diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp index 463a49f52283a..cdbf4f048a00f 100644 --- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp +++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseBufferRewriting.cpp @@ -952,9 +952,9 @@ createQuickSort(OpBuilder &builder, ModuleOp module, func::FuncOp func, Value cond = builder.create(loc, arith::CmpIPredicate::ule, lenLow, lenHigh); + Value c0 = constantIndex(builder, loc, 0); scf::IfOp ifOp = builder.create(loc, types, cond, /*else=*/true); - Value c0 = constantIndex(builder, loc, 0); auto mayRecursion = [&](Value low, Value high, Value len) { Value cond = builder.create(loc, arith::CmpIPredicate::ne, len, c0);