Skip to content

Commit 8e8bbbd

Browse files
[mlir] Use llvm::is_contained (NFC)
1 parent 6bd488d commit 8e8bbbd

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static bool isReachable(Block *from, Block *to, ArrayRef<Block *> except) {
279279
worklist.push_back(succ);
280280
while (!worklist.empty()) {
281281
Block *next = worklist.pop_back_val();
282-
if (llvm::find(except, next) != except.end())
282+
if (llvm::is_contained(except, next))
283283
continue;
284284
if (next == to)
285285
return true;

mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ transform::PadOp::apply(transform::TransformRewriter &rewriter,
17591759
if (options.copyBackOp != LinalgPaddingOptions::CopyBackOp::None) {
17601760
for (Value v : replacements) {
17611761
Operation *copyBackOp = v.getDefiningOp();
1762-
if (llvm::find(copyBackOps, copyBackOp) == copyBackOps.end())
1762+
if (!llvm::is_contained(copyBackOps, copyBackOp))
17631763
copyBackOps.push_back(copyBackOp);
17641764
}
17651765
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct LinalgOpInterface
125125
if (!isa<RankedTensorType, MemRefType>(operand.get().getType()))
126126
continue;
127127
// Only consider operands in `opOperands`.
128-
if (llvm::find(opOperands, &operand) == opOperands.end())
128+
if (!llvm::is_contained(opOperands, &operand))
129129
continue;
130130
// TODO: This could be generalized to other indexing maps. (All indexing
131131
// must be the same.)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ Value linalg::bufferizeToAllocation(
523523
// bufferize out-of-place.
524524
SmallVector<OpOperand *> outOfPlaceOperands, resultUses;
525525
auto addOutOfPlaceOperand = [&](OpOperand *operand) {
526-
if (llvm::find(outOfPlaceOperands, operand) == outOfPlaceOperands.end())
526+
if (!llvm::is_contained(outOfPlaceOperands, operand))
527527
outOfPlaceOperands.push_back(operand);
528528
};
529529
for (OpResult result : tensorResults) {

mlir/lib/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ struct MaskOpInterface
217217
SmallVector<Value> newReturnValues(maskOp->getNumResults(), Value());
218218
SmallVector<Value> newYieldedValues;
219219
for (const auto &it : llvm::enumerate(yieldOp.getOperands())) {
220-
if (llvm::find(maskedOp->getOpResults(), it.value()) !=
221-
maskedOp->getOpResults().end()) {
220+
if (llvm::is_contained(maskedOp->getOpResults(), it.value())) {
222221
newYieldedValues.push_back(it.value());
223222
} else {
224223
// This used to be a tensor result of the masked op, but is now a memref

0 commit comments

Comments
 (0)