@@ -5028,14 +5028,12 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
50285028 }
50295029
50305030 // All-zero GEP is a no-op, unless it performs a vector splat.
5031- if (Ptr->getType () == GEPTy &&
5032- all_of (Indices, [](const auto *V) { return match (V, m_Zero ()); }))
5031+ if (Ptr->getType () == GEPTy && all_of (Indices, match_fn (m_Zero ())))
50335032 return Ptr;
50345033
50355034 // getelementptr poison, idx -> poison
50365035 // getelementptr baseptr, poison -> poison
5037- if (isa<PoisonValue>(Ptr) ||
5038- any_of (Indices, [](const auto *V) { return isa<PoisonValue>(V); }))
5036+ if (isa<PoisonValue>(Ptr) || any_of (Indices, match_fn (m_Poison ())))
50395037 return PoisonValue::get (GEPTy);
50405038
50415039 // getelementptr undef, idx -> undef
@@ -5092,8 +5090,7 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
50925090 }
50935091
50945092 if (!IsScalableVec && Q.DL .getTypeAllocSize (LastType) == 1 &&
5095- all_of (Indices.drop_back (1 ),
5096- [](Value *Idx) { return match (Idx, m_Zero ()); })) {
5093+ all_of (Indices.drop_back (1 ), match_fn (m_Zero ()))) {
50975094 unsigned IdxWidth =
50985095 Q.DL .getIndexSizeInBits (Ptr->getType ()->getPointerAddressSpace ());
50995096 if (Q.DL .getTypeSizeInBits (Indices.back ()->getType ()) == IdxWidth) {
@@ -5123,8 +5120,7 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
51235120 }
51245121
51255122 // Check to see if this is constant foldable.
5126- if (!isa<Constant>(Ptr) ||
5127- !all_of (Indices, [](Value *V) { return isa<Constant>(V); }))
5123+ if (!isa<Constant>(Ptr) || !all_of (Indices, match_fn (m_Constant ())))
51285124 return nullptr ;
51295125
51305126 if (!ConstantExpr::isSupportedGetElementPtr (SrcTy))
@@ -5662,7 +5658,7 @@ static Constant *simplifyFPOp(ArrayRef<Value *> Ops, FastMathFlags FMF,
56625658 RoundingMode Rounding) {
56635659 // Poison is independent of anything else. It always propagates from an
56645660 // operand to a math result.
5665- if (any_of (Ops, [](Value *V) { return match (V, m_Poison ()); } ))
5661+ if (any_of (Ops, match_fn ( m_Poison ())))
56665662 return PoisonValue::get (Ops[0 ]->getType ());
56675663
56685664 for (Value *V : Ops) {
@@ -7126,7 +7122,7 @@ static Value *simplifyInstructionWithOperands(Instruction *I,
71267122
71277123 switch (I->getOpcode ()) {
71287124 default :
7129- if (llvm:: all_of (NewOps, [](Value *V) { return isa<Constant>(V); } )) {
7125+ if (all_of (NewOps, match_fn ( m_Constant ()) )) {
71307126 SmallVector<Constant *, 8 > NewConstOps (NewOps.size ());
71317127 transform (NewOps, NewConstOps.begin (),
71327128 [](Value *V) { return cast<Constant>(V); });
0 commit comments