Skip to content

Commit 52b1f7a

Browse files
kazutakahirataTIFitis
authored andcommitted
[mlir] Use llvm::is_contained (NFC) (llvm#140012)
1 parent d345c1f commit 52b1f7a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ struct LinalgOpPartialReductionInterface
511511
for (auto [resultNum, dimExpr] :
512512
llvm::enumerate(partialMap.getResults())) {
513513
unsigned dim = cast<AffineDimExpr>(dimExpr).getPosition();
514-
if (llvm::find(reductionDims, dim) != reductionDims.end()) {
514+
if (llvm::is_contained(reductionDims, dim)) {
515515
partialReductionDims.push_back(resultNum);
516516
}
517517
}
@@ -553,7 +553,7 @@ struct LinalgOpPartialReductionInterface
553553
unsigned dim = cast<AffineDimExpr>(dimExpr).getPosition();
554554
resultSizes.push_back(sizes[dim]);
555555

556-
if (llvm::find(reductionDims, dim) != reductionDims.end()) {
556+
if (llvm::is_contained(reductionDims, dim)) {
557557
// Reduction dims are reduced, and are always outputed in the same
558558
// place. So use offset 0 for them.
559559
resultOffsets.push_back(b.getIndexAttr(0));

mlir/lib/Dialect/Mesh/IR/MeshOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,7 @@ LogicalResult ShiftOp::verifySymbolUses(SymbolTableCollection &symbolTable) {
15051505

15061506
auto meshAxes = getMeshAxes();
15071507
auto shiftAxis = getShiftAxis().getZExtValue();
1508-
if (llvm::find(meshAxes, shiftAxis) == meshAxes.end()) {
1508+
if (!llvm::is_contained(meshAxes, shiftAxis)) {
15091509
return emitError() << "Invalid shift axis " << shiftAxis
15101510
<< ". It must be one of the grouping mesh axes.";
15111511
}

mlir/lib/Dialect/Quant/IR/QuantOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ LogicalResult verifySubChannelQuantization(
122122
//
123123
// Therefore, we explicitly disallow the case where d = 0 to maintain
124124
// consistency and avoid these issues.
125-
if (llvm::find(tensorType.getShape(), 0) != tensorType.getShape().end()) {
125+
if (llvm::is_contained(tensorType.getShape(), 0)) {
126126
return op->emitError() << "tensor dimension size of zero is not allowed "
127127
"with sub-channel quantization";
128128
}

0 commit comments

Comments
 (0)