Skip to content

Commit 8a7f4ee

Browse files
[llvm] Use llvm::is_contained (NFC)
1 parent 972df2c commit 8a7f4ee

File tree

5 files changed

+7
-14
lines changed

5 files changed

+7
-14
lines changed

llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,7 @@ static RelaxAux initRelaxAux(LinkGraph &G) {
516516
RelaxAux Aux;
517517
Aux.Config.IsRV32 = G.getTargetTriple().isRISCV32();
518518
const auto &Features = G.getFeatures().getFeatures();
519-
Aux.Config.HasRVC =
520-
std::find(Features.begin(), Features.end(), "+c") != Features.end();
519+
Aux.Config.HasRVC = llvm::is_contained(Features, "+c");
521520

522521
for (auto &S : G.sections()) {
523522
if (!shouldRelax(S))

llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,11 +1053,9 @@ bool AArch64ExpandPseudo::expandMultiVecPseudo(
10531053
auto ContiguousRange = ContiguousClass.getRegisters();
10541054
auto StridedRange = StridedClass.getRegisters();
10551055
unsigned Opc;
1056-
if ((std::find(ContiguousRange.begin(), ContiguousRange.end(),
1057-
Tuple.asMCReg()) != std::end(ContiguousRange))) {
1056+
if (llvm::is_contained(ContiguousRange, Tuple.asMCReg())) {
10581057
Opc = ContiguousOp;
1059-
} else if ((std::find(StridedRange.begin(), StridedRange.end(),
1060-
Tuple.asMCReg()) != std::end(StridedRange))) {
1058+
} else if (llvm::is_contained(StridedRange, Tuple.asMCReg())) {
10611059
Opc = StridedOpc;
10621060
} else
10631061
llvm_unreachable("Cannot expand Multi-Vector pseudo");

llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,8 +1152,7 @@ void MFMASmallGemmSingleWaveOpt::applyIGLPStrategy(
11521152
if (Pred.getSUnit()->getInstr()->getOpcode() != AMDGPU::V_PERM_B32_e64)
11531153
continue;
11541154

1155-
if (Cand &&
1156-
std::find(Counted.begin(), Counted.end(), Cand) != Counted.end())
1155+
if (Cand && llvm::is_contained(Counted, Cand))
11571156
break;
11581157

11591158
for (auto &Succ : Pred.getSUnit()->Succs) {
@@ -1174,7 +1173,7 @@ void MFMASmallGemmSingleWaveOpt::applyIGLPStrategy(
11741173
}
11751174

11761175
Cand = VMEMLookup[MI];
1177-
if (std::find(Counted.begin(), Counted.end(), Cand) != Counted.end()) {
1176+
if (llvm::is_contained(Counted, Cand)) {
11781177
MissedAny = true;
11791178
break;
11801179
}

llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,7 @@ bool SILowerSGPRSpills::runOnMachineFunction(MachineFunction &MF) {
355355
int FI = TII->getNamedOperand(MI, AMDGPU::OpName::addr)->getIndex();
356356
assert(MFI.getStackID(FI) == TargetStackID::SGPRSpill);
357357

358-
bool IsCalleeSaveSGPRSpill =
359-
std::find(CalleeSavedFIs.begin(), CalleeSavedFIs.end(), FI) !=
360-
CalleeSavedFIs.end();
358+
bool IsCalleeSaveSGPRSpill = llvm::is_contained(CalleeSavedFIs, FI);
361359
if (IsCalleeSaveSGPRSpill) {
362360
// Spill callee-saved SGPRs into physical VGPR lanes.
363361

llvm/lib/Transforms/Scalar/SROA.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3126,8 +3126,7 @@ class llvm::sroa::AllocaSliceRewriter
31263126
if (IsDest) {
31273127
// Update the address component of linked dbg.assigns.
31283128
for (auto *DAI : at::getAssignmentMarkers(&II)) {
3129-
if (any_of(DAI->location_ops(),
3130-
[&](Value *V) { return V == II.getDest(); }) ||
3129+
if (llvm::is_contained(DAI->location_ops(), II.getDest()) ||
31313130
DAI->getAddress() == II.getDest())
31323131
DAI->replaceVariableLocationOp(II.getDest(), AdjustedPtr);
31333132
}

0 commit comments

Comments
 (0)