[llvm] [llvm] Use llvm::any_of (NFC) (PR #141444)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun May 25 19:13:16 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/141444
None
>From e42484d04526a1d96a0cef77a36dbd1ff2e24d6d Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 25 May 2025 10:43:44 -0700
Subject: [PATCH] [llvm] Use llvm::any_of (NFC)
---
llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp | 6 ++----
.../DebugInfo/LogicalView/DWARFReaderTest.cpp | 11 ++++-------
2 files changed, 6 insertions(+), 11 deletions(-)
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.
More information about the llvm-commits
mailing list