Skip to content

[mlir-tblgen] Use llvm::any_of (NFC) #102795

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
merged 1 commit into from
Aug 12, 2024

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels Aug 11, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 11, 2024

@llvm/pr-subscribers-mlir-core

@llvm/pr-subscribers-mlir

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/102795.diff

1 Files Affected:

  • (modified) mlir/tools/mlir-tblgen/OmpOpGen.cpp (+5-6)
diff --git a/mlir/tools/mlir-tblgen/OmpOpGen.cpp b/mlir/tools/mlir-tblgen/OmpOpGen.cpp
index 51eb43f322e6ad..ffa2e17cc8f916 100644
--- a/mlir/tools/mlir-tblgen/OmpOpGen.cpp
+++ b/mlir/tools/mlir-tblgen/OmpOpGen.cpp
@@ -73,12 +73,11 @@ static StringRef extractOmpClauseName(Record *clause) {
 static bool verifyArgument(DagInit *arguments, StringRef argName,
                            Init *argInit) {
   auto range = zip_equal(arguments->getArgNames(), arguments->getArgs());
-  return std::find_if(
-             range.begin(), range.end(),
-             [&](std::tuple<llvm::StringInit *const &, llvm::Init *const &> v) {
-               return std::get<0>(v)->getAsUnquotedString() == argName &&
-                      std::get<1>(v) == argInit;
-             }) != range.end();
+  return llvm::any_of(
+      range, [&](std::tuple<llvm::StringInit *const &, llvm::Init *const &> v) {
+        return std::get<0>(v)->getAsUnquotedString() == argName &&
+               std::get<1>(v) == argInit;
+      });
 }
 
 /// Check that the given string record value, identified by its name \c value,

Copy link
Member

@skatrak skatrak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, thank you.

@kazutakahirata kazutakahirata merged commit 0801a37 into llvm:main Aug 12, 2024
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_mlir_any_of branch August 12, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants