Skip to content

Commit c86bb3d

Browse files
[mlir] Use a range-based for loop (NFC)
1 parent a6fa39d commit c86bb3d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mlir/lib/Dialect/SparseTensor/Transforms/LoopEmitter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,10 +2117,8 @@ bool LoopEmitter::genSliceBegin(OpBuilder &builder, Location loc, TensorId tid,
21172117
bufSize = MULI(bufSize, C_IDX(kSliceIterWidth));
21182118
// Additional two metadata {memSize, idx} at head.
21192119
bufSize = ADDI(bufSize, c2);
2120-
llvm::for_each(
2121-
slicePosBuffer[tid][lvl], [bufSize, loc, &builder](Value &cache) {
2122-
cache = genAlloca(builder, loc, bufSize, builder.getIndexType());
2123-
});
2120+
for (Value &cache : slicePosBuffer[tid][lvl])
2121+
cache = genAlloca(builder, loc, bufSize, builder.getIndexType());
21242122
}
21252123

21262124
if (sliceInfo.isInitialTensor() ||

0 commit comments

Comments
 (0)