1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[Target] Use llvm::any_of (NFC)

This commit is contained in:
Kazu Hirata 2020-12-24 19:43:26 -08:00
parent e247c5cb6c
commit 2fb3d0d5a0
5 changed files with 13 additions and 12 deletions

View File

@ -333,9 +333,9 @@ bool AArch64RegisterInfo::isReservedReg(const MachineFunction &MF,
}
bool AArch64RegisterInfo::isAnyArgRegReserved(const MachineFunction &MF) const {
return std::any_of(std::begin(*AArch64::GPR64argRegClass.MC),
std::end(*AArch64::GPR64argRegClass.MC),
[this, &MF](MCPhysReg r){return isReservedReg(MF, r);});
return llvm::any_of(*AArch64::GPR64argRegClass.MC, [this, &MF](MCPhysReg r) {
return isReservedReg(MF, r);
});
}
void AArch64RegisterInfo::emitReservedArgRegCallError(

View File

@ -325,9 +325,10 @@ bool AMDGPURewriteOutArguments::runOnFunction(Function &F) {
Value *ReplVal = Store.second->getValueOperand();
auto &ValVec = Replacements[Store.first];
if (llvm::find_if(ValVec,
if (llvm::any_of(ValVec,
[OutArg](const std::pair<Argument *, Value *> &Entry) {
return Entry.first == OutArg;}) != ValVec.end()) {
return Entry.first == OutArg;
})) {
LLVM_DEBUG(dbgs()
<< "Saw multiple out arg stores" << *OutArg << '\n');
// It is possible to see stores to the same argument multiple times,

View File

@ -560,8 +560,9 @@ static bool tryToFoldACImm(const SIInstrInfo *TII,
if (!UseReg.isVirtual())
return false;
if (llvm::find_if(FoldList, [UseMI](const FoldCandidate &FC) {
return FC.UseMI == UseMI; }) != FoldList.end())
if (llvm::any_of(FoldList, [UseMI](const FoldCandidate &FC) {
return FC.UseMI == UseMI;
}))
return false;
MachineRegisterInfo &MRI = UseMI->getParent()->getParent()->getRegInfo();

View File

@ -3434,7 +3434,7 @@ void RISCVTargetLowering::validateCCReservedRegs(
const Function &F = MF.getFunction();
const RISCVSubtarget &STI = MF.getSubtarget<RISCVSubtarget>();
if (std::any_of(std::begin(Regs), std::end(Regs), [&STI](auto Reg) {
if (llvm::any_of(Regs, [&STI](auto Reg) {
return STI.isRegisterReservedByUser(Reg.first);
}))
F.getContext().diagnose(DiagnosticInfoUnsupported{

View File

@ -538,9 +538,8 @@ static void updateAlignments(Range &Slices,
static void checkUnusedAlignments(ArrayRef<Slice> Slices,
const StringMap<const uint32_t> &Alignments) {
auto HasArch = [&](StringRef Arch) {
return llvm::find_if(Slices, [Arch](Slice S) {
return S.getArchString() == Arch;
}) != Slices.end();
return llvm::any_of(Slices,
[Arch](Slice S) { return S.getArchString() == Arch; });
};
for (StringRef Arch : Alignments.keys())
if (!HasArch(Arch))