Skip to content

Commit

Permalink
[llvm] Strip redundant lambda (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Dec 17, 2021
1 parent 91dfb32 commit 2b7be47
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp
Expand Up @@ -152,7 +152,7 @@ bool SVEIntrinsicOpts::coalescePTrueIntrinsicCalls(
// Remove the most encompassing ptrue, as well as any promoted ptrues, leaving
// behind only the ptrues to be coalesced.
PTrues.remove(MostEncompassingPTrue);
PTrues.remove_if([](auto *PTrue) { return isPTruePromoted(PTrue); });
PTrues.remove_if(isPTruePromoted);

// Hoist MostEncompassingPTrue to the start of the basic block. It is always
// safe to do this, since ptrue intrinsic calls are guaranteed to have no
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Expand Up @@ -5920,8 +5920,7 @@ static bool isSequentialOrUndefOrZeroInRange(ArrayRef<int> Mask, unsigned Pos,
/// from position Pos and ending in Pos+Size is undef or is zero.
static bool isUndefOrZeroInRange(ArrayRef<int> Mask, unsigned Pos,
unsigned Size) {
return llvm::all_of(Mask.slice(Pos, Size),
[](int M) { return isUndefOrZero(M); });
return llvm::all_of(Mask.slice(Pos, Size), isUndefOrZero);
}

/// Helper function to test whether a shuffle mask could be
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/IPO/GlobalOpt.cpp
Expand Up @@ -369,8 +369,7 @@ static bool isSafeSROAGEP(User *U) {
return false;
}

return llvm::all_of(U->users(),
[](User *UU) { return isSafeSROAElementUse(UU); });
return llvm::all_of(U->users(), isSafeSROAElementUse);
}

/// Return true if the specified instruction is a safe user of a derived
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/LowerTypeTests.cpp
Expand Up @@ -1802,7 +1802,7 @@ void LowerTypeTestsModule::replaceCfiUses(Function *Old, Value *New,
}

void LowerTypeTestsModule::replaceDirectCalls(Value *Old, Value *New) {
Old->replaceUsesWithIf(New, [](Use &U) { return isDirectCall(U); });
Old->replaceUsesWithIf(New, isDirectCall);
}

bool LowerTypeTestsModule::lower() {
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/Scalar/SCCP.cpp
Expand Up @@ -101,8 +101,7 @@ static bool tryToReplaceWithConstant(SCCPSolver &Solver, Value *V) {
Constant *Const = nullptr;
if (V->getType()->isStructTy()) {
std::vector<ValueLatticeElement> IVs = Solver.getStructLatticeValueFor(V);
if (any_of(IVs,
[](const ValueLatticeElement &LV) { return isOverdefined(LV); }))
if (llvm::any_of(IVs, isOverdefined))
return false;
std::vector<Constant *> ConstVals;
auto *ST = cast<StructType>(V->getType());
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Transforms/Utils/LoopPeel.cpp
Expand Up @@ -104,9 +104,7 @@ bool llvm::canPeel(Loop *L) {
// note that LoopPeeling currently can only update the branch weights of latch
// blocks and branch weights to blocks with deopt or unreachable do not need
// updating.
return all_of(Exits, [](const BasicBlock *BB) {
return IsBlockFollowedByDeoptOrUnreachable(BB);
});
return llvm::all_of(Exits, IsBlockFollowedByDeoptOrUnreachable);
}

// This function calculates the number of iterations after which the given Phi
Expand Down
7 changes: 2 additions & 5 deletions llvm/utils/TableGen/SubtargetEmitter.cpp
Expand Up @@ -1524,9 +1524,7 @@ static void collectVariantClasses(const CodeGenSchedModels &SchedModels,
if (OnlyExpandMCInstPredicates) {
// Ignore this variant scheduling class no transitions use any meaningful
// MCSchedPredicate definitions.
if (!any_of(SC.Transitions, [](const CodeGenSchedTransition &T) {
return hasMCSchedPredicates(T);
}))
if (llvm::none_of(SC.Transitions, hasMCSchedPredicates))
continue;
}

Expand All @@ -1548,8 +1546,7 @@ static void collectProcessorIndices(const CodeGenSchedClass &SC,
}

static bool isAlwaysTrue(const CodeGenSchedTransition &T) {
return llvm::all_of(T.PredTerm,
[](const Record *R) { return isTruePredicate(R); });
return llvm::all_of(T.PredTerm, isTruePredicate);
}

void SubtargetEmitter::emitSchedModelHelpersImpl(
Expand Down

0 comments on commit 2b7be47

Please sign in to comment.