Skip to content

Commit 03697cf

Browse files
[mlir] Use llvm::find_if (NFC) (#139912)
1 parent b6c7d7c commit 03697cf

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,10 @@ void AffineDataCopyGeneration::runOnBlock(Block *block,
126126
// moment; we do a check later and report an error with location info.
127127

128128
// Get to the first load, store, or for op (that is not a copy nest itself).
129-
auto curBegin =
130-
std::find_if(block->begin(), block->end(), [&](Operation &op) {
131-
return isa<AffineLoadOp, AffineStoreOp, AffineForOp>(op) &&
132-
copyNests.count(&op) == 0;
133-
});
129+
auto curBegin = llvm::find_if(*block, [&](Operation &op) {
130+
return isa<AffineLoadOp, AffineStoreOp, AffineForOp>(op) &&
131+
copyNests.count(&op) == 0;
132+
});
134133

135134
// Create [begin, end) ranges.
136135
auto it = curBegin;

mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ LogicalResult SparseTensorEncodingAttr::verify(
791791
return emitError() << "unexpected coordinate bitwidth: " << crdWidth;
792792

793793
// Verify every COO segment.
794-
auto *it = std::find_if(lvlTypes.begin(), lvlTypes.end(), isSingletonLT);
794+
auto *it = llvm::find_if(lvlTypes, isSingletonLT);
795795
while (it != lvlTypes.end()) {
796796
if (it == lvlTypes.begin() ||
797797
!(it - 1)->isa<LevelFormat::Compressed, LevelFormat::LooseCompressed>())
@@ -829,7 +829,7 @@ LogicalResult SparseTensorEncodingAttr::verify(
829829
}
830830

831831
// TODO: audit formats that actually are supported by backend.
832-
if (auto it = std::find_if(lvlTypes.begin(), lvlTypes.end(), isNOutOfMLT);
832+
if (auto it = llvm::find_if(lvlTypes, isNOutOfMLT);
833833
it != std::end(lvlTypes)) {
834834
if (it != lvlTypes.end() - 1)
835835
return emitError() << "expected n_out_of_m to be the last level type";

0 commit comments

Comments
 (0)