Skip to content

Commit e525f91

Browse files
[llvm] Use llvm::is_contained (NFC) (llvm#101855)
1 parent be031b1 commit e525f91

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6229,10 +6229,7 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
62296229
&Call);
62306230
break;
62316231
}
6232-
Check(llvm::any_of(CBR->getIndirectDests(),
6233-
[LandingPadBB](const BasicBlock *IndDest) {
6234-
return IndDest == LandingPadBB;
6235-
}),
6232+
Check(llvm::is_contained(CBR->getIndirectDests(), LandingPadBB),
62366233
"Intrinsic's corresponding callbr must have intrinsic's parent basic "
62376234
"block in indirect destination list",
62386235
&Call);

llvm/lib/Transforms/Utils/LoopSimplify.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ static void placeSplitBlockCarefully(BasicBlock *NewBB,
8383
Loop *L) {
8484
// Check to see if NewBB is already well placed.
8585
Function::iterator BBI = --NewBB->getIterator();
86-
for (BasicBlock *Pred : SplitPreds) {
87-
if (&*BBI == Pred)
88-
return;
89-
}
86+
if (llvm::is_contained(SplitPreds, &*BBI))
87+
return;
9088

9189
// If it isn't already after an outside block, move it after one. This is
9290
// always good as it makes the uncond branch from the outside block into a

llvm/lib/Transforms/Utils/ValueMapper.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,7 @@ void Mapper::remapDbgRecord(DbgRecord &DR) {
575575
return;
576576

577577
// Otherwise, do some replacement.
578-
if (!IgnoreMissingLocals &&
579-
llvm::any_of(NewVals, [&](Value *V) { return V == nullptr; })) {
578+
if (!IgnoreMissingLocals && llvm::is_contained(NewVals, nullptr)) {
580579
V.setKillLocation();
581580
} else {
582581
// Either we have all non-empty NewVals, or we're permitted to ignore

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,8 +1406,7 @@ bool VectorCombine::foldShuffleOfBinops(Instruction &I) {
14061406
return false;
14071407

14081408
// Don't introduce poison into div/rem.
1409-
if (any_of(OldMask, [](int M) { return M == PoisonMaskElem; }) &&
1410-
B0->isIntDivRem())
1409+
if (llvm::is_contained(OldMask, PoisonMaskElem) && B0->isIntDivRem())
14111410
return false;
14121411

14131412
// TODO: Add support for addlike etc.

0 commit comments

Comments
 (0)