Skip to content

[llvm] Use llvm::any_of (NFC) #141444

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

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented May 26, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Kazu Hirata (kazutakahirata)

Changes

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

2 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp (+2-4)
  • (modified) llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp (+4-7)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp b/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp
index 4c88b7e09eee7..61c5dcd5ebada 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp
@@ -357,10 +357,8 @@ class AMDGPUWaitSGPRHazards {
 
       // Only consider implicit VCC specified by instruction descriptor.
       const bool HasImplicitVCC =
-          llvm::any_of(MI->getDesc().implicit_uses(),
-                       [](MCPhysReg Reg) { return isVCC(Reg); }) ||
-          llvm::any_of(MI->getDesc().implicit_defs(),
-                       [](MCPhysReg Reg) { return isVCC(Reg); });
+          llvm::any_of(MI->getDesc().implicit_uses(), isVCC) ||
+          llvm::any_of(MI->getDesc().implicit_defs(), isVCC);
 
       if (IsSetPC) {
         // All SGPR writes before a call/return must be flushed as the
diff --git a/llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp b/llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp
index 0af560f2b65f6..54a5bd400baf8 100644
--- a/llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp
+++ b/llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp
@@ -169,13 +169,10 @@ void checkUnspecifiedParameters(LVReader *Reader) {
   // `int foo_printf(const char *, ...)`, where the '...' is represented by a
   // DW_TAG_unspecified_parameters, i.e. we expect to find at least one child
   // for which getIsUnspecified() returns true.
-  EXPECT_EQ(std::any_of(
-                Elements->begin(), Elements->end(),
-                [](const LVElement *elt) {
-                  return elt->getIsSymbol() &&
-                         static_cast<const LVSymbol *>(elt)->getIsUnspecified();
-                }),
-            true);
+  EXPECT_TRUE(llvm::any_of(*Elements, [](const LVElement *elt) {
+    return elt->getIsSymbol() &&
+           static_cast<const LVSymbol *>(elt)->getIsUnspecified();
+  }));
 }
 
 // Check the basic properties on parsed DW_TAG_module.

@kazutakahirata kazutakahirata merged commit f8f2e65 into llvm:main May 26, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250525_llvm_any_of_llvm branch May 26, 2025 16:24
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants