Skip to content

Commit 98b461f

Browse files
kazutakahirataJaddyen
authored andcommitted
[mlir] Use llvm::is_contained (NFC) (llvm#140986)
1 parent fb15c2f commit 98b461f

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

mlir/include/mlir/Dialect/Bufferization/IR/UnstructuredControlFlow.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ struct OpWithUnstructuredControlFlowBufferizableOpInterfaceExternalModel
5454
// If the forwarded operand is already on the invocation stack, we ran
5555
// into a loop and this operand cannot be used to compute the bufferized
5656
// type.
57-
if (llvm::find(invocationStack, opOperand->get()) !=
58-
invocationStack.end())
57+
if (llvm::is_contained(invocationStack, opOperand->get()))
5958
continue;
6059

6160
// Compute the bufferized type of the forwarded operand.

mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,8 +807,7 @@ void transform::TransformState::compactOpHandles() {
807807
for (Value handle : opHandlesToCompact) {
808808
Mappings &mappings = getMapping(handle, /*allowOutOfScope=*/true);
809809
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
810-
if (llvm::find(mappings.direct[handle], nullptr) !=
811-
mappings.direct[handle].end())
810+
if (llvm::is_contained(mappings.direct[handle], nullptr))
812811
// Payload IR is removed from the mapping. This invalidates the respective
813812
// iterators.
814813
mappings.incrementTimestamp(handle);

mlir/test/lib/Analysis/TestTopologicalSort.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct TestTopologicalSortAnalysisPass
5353
return WalkResult::advance();
5454
});
5555

56-
if (llvm::find(selectedOps, nullptr) != selectedOps.end()) {
56+
if (llvm::is_contained(selectedOps, nullptr)) {
5757
root->emitError("invalid test case: some indices are missing among the "
5858
"selected ops");
5959
return WalkResult::skip();

0 commit comments

Comments
 (0)