[llvm] dca8209 - [llvm] Use llvm::any_of (NFC) (#104443)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 15 17:59:14 PDT 2024
Author: Kazu Hirata
Date: 2024-08-15T17:59:10-07:00
New Revision: dca820951c86b79b0b26d92f7c715f3d4305f8e8
URL: https://github.com/llvm/llvm-project/commit/dca820951c86b79b0b26d92f7c715f3d4305f8e8
DIFF: https://github.com/llvm/llvm-project/commit/dca820951c86b79b0b26d92f7c715f3d4305f8e8.diff
LOG: [llvm] Use llvm::any_of (NFC) (#104443)
Added:
Modified:
llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
index 21ce0ac17d6186..18643c6b44485e 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
@@ -1533,9 +1533,9 @@ LineCoverageStats::LineCoverageStats(
// if there is any starting segment at this line with a counter, it must be
// mapped
- Mapped |= std::any_of(
- LineSegments.begin(), LineSegments.end(),
- [](const auto *Seq) { return Seq->IsRegionEntry && Seq->HasCount; });
+ Mapped |= any_of(LineSegments, [](const auto *Seq) {
+ return Seq->IsRegionEntry && Seq->HasCount;
+ });
if (!Mapped) {
return;
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index d818d3ba51c59d..3ea2ba235ca39c 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -9074,8 +9074,8 @@ AArch64InstrInfo::getOutliningCandidateInfo(
// link register.
outliner::Candidate &FirstCand = RepeatedSequenceLocs[0];
bool ModStackToSaveLR = false;
- if (std::any_of(FirstCand.begin(), std::prev(FirstCand.end()),
- [](const MachineInstr &MI) { return MI.isCall(); }))
+ if (any_of(drop_end(FirstCand),
+ [](const MachineInstr &MI) { return MI.isCall(); }))
ModStackToSaveLR = true;
// Handle the last instruction separately. If this is a tail call, then the
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
index 3b9195b4e3d85f..1199052ca97e9c 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -6074,8 +6074,8 @@ ARMBaseInstrInfo::getOutliningCandidateInfo(
// check if the range contains a call. These require a save + restore of
// the link register.
outliner::Candidate &FirstCand = RepeatedSequenceLocs[0];
- if (std::any_of(FirstCand.begin(), std::prev(FirstCand.end()),
- [](const MachineInstr &MI) { return MI.isCall(); }))
+ if (any_of(drop_end(FirstCand),
+ [](const MachineInstr &MI) { return MI.isCall(); }))
NumBytesToCreateFrame += Costs.SaveRestoreLROnStack;
// Handle the last instruction separately. If it is tail call, then the
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index e54314cc7d00af..c2951bf6dbf78f 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -13090,9 +13090,9 @@ bool ARMAsmParser::isMnemonicVPTPredicable(StringRef Mnemonic,
"vshrn", "vsli", "vsri", "vstrb", "vstrd",
"vstrw", "vsub"};
- return std::any_of(
- std::begin(predicable_prefixes), std::end(predicable_prefixes),
- [&Mnemonic](const char *prefix) { return Mnemonic.starts_with(prefix); });
+ return any_of(predicable_prefixes, [&Mnemonic](const char *prefix) {
+ return Mnemonic.starts_with(prefix);
+ });
}
std::unique_ptr<ARMOperand> ARMAsmParser::defaultCondCodeOp() {
More information about the llvm-commits
mailing list