@@ -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 (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 (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 (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 (m_Constant ())))
51285124 return nullptr ;
51295125
51305126 if (!ConstantExpr::isSupportedGetElementPtr (SrcTy))
@@ -5649,7 +5645,7 @@ static Constant *simplifyFPOp(ArrayRef<Value *> Ops, FastMathFlags FMF,
56495645 RoundingMode Rounding) {
56505646 // Poison is independent of anything else. It always propagates from an
56515647 // operand to a math result.
5652- if (any_of (Ops, [](Value *V) { return match (V, m_Poison ()); } ))
5648+ if (any_of (Ops, match (m_Poison ())))
56535649 return PoisonValue::get (Ops[0 ]->getType ());
56545650
56555651 for (Value *V : Ops) {
@@ -7116,7 +7112,7 @@ static Value *simplifyInstructionWithOperands(Instruction *I,
71167112
71177113 switch (I->getOpcode ()) {
71187114 default :
7119- if (llvm:: all_of (NewOps, [](Value *V) { return isa<Constant>(V); } )) {
7115+ if (all_of (NewOps, match ( m_Constant ()) )) {
71207116 SmallVector<Constant *, 8 > NewConstOps (NewOps.size ());
71217117 transform (NewOps, NewConstOps.begin (),
71227118 [](Value *V) { return cast<Constant>(V); });
0 commit comments