Skip to content

[mlir] Use llvm::is_contained (NFC) #140986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ struct OpWithUnstructuredControlFlowBufferizableOpInterfaceExternalModel
// If the forwarded operand is already on the invocation stack, we ran
// into a loop and this operand cannot be used to compute the bufferized
// type.
if (llvm::find(invocationStack, opOperand->get()) !=
invocationStack.end())
if (llvm::is_contained(invocationStack, opOperand->get()))
continue;

// Compute the bufferized type of the forwarded operand.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,7 @@ void transform::TransformState::compactOpHandles() {
for (Value handle : opHandlesToCompact) {
Mappings &mappings = getMapping(handle, /*allowOutOfScope=*/true);
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
if (llvm::find(mappings.direct[handle], nullptr) !=
mappings.direct[handle].end())
if (llvm::is_contained(mappings.direct[handle], nullptr))
// Payload IR is removed from the mapping. This invalidates the respective
// iterators.
mappings.incrementTimestamp(handle);
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/lib/Analysis/TestTopologicalSort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct TestTopologicalSortAnalysisPass
return WalkResult::advance();
});

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