@@ -5057,14 +5057,12 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
50575057 }
50585058
50595059 // All-zero GEP is a no-op, unless it performs a vector splat.
5060- if (Ptr->getType () == GEPTy &&
5061- all_of (Indices, [](const auto *V) { return match (V, m_Zero ()); }))
5060+ if (Ptr->getType () == GEPTy && all_of (Indices, match_fn (m_Zero ())))
50625061 return Ptr;
50635062
50645063 // getelementptr poison, idx -> poison
50655064 // getelementptr baseptr, poison -> poison
5066- if (isa<PoisonValue>(Ptr) ||
5067- any_of (Indices, [](const auto *V) { return isa<PoisonValue>(V); }))
5065+ if (isa<PoisonValue>(Ptr) || any_of (Indices, IsaPred<PoisonValue>))
50685066 return PoisonValue::get (GEPTy);
50695067
50705068 // getelementptr undef, idx -> undef
@@ -5121,8 +5119,7 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
51215119 }
51225120
51235121 if (!IsScalableVec && Q.DL .getTypeAllocSize (LastType) == 1 &&
5124- all_of (Indices.drop_back (1 ),
5125- [](Value *Idx) { return match (Idx, m_Zero ()); })) {
5122+ all_of (Indices.drop_back (1 ), match_fn (m_Zero ()))) {
51265123 unsigned IdxWidth =
51275124 Q.DL .getIndexSizeInBits (Ptr->getType ()->getPointerAddressSpace ());
51285125 if (Q.DL .getTypeSizeInBits (Indices.back ()->getType ()) == IdxWidth) {
@@ -5152,8 +5149,7 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
51525149 }
51535150
51545151 // Check to see if this is constant foldable.
5155- if (!isa<Constant>(Ptr) ||
5156- !all_of (Indices, [](Value *V) { return isa<Constant>(V); }))
5152+ if (!isa<Constant>(Ptr) || !all_of (Indices, IsaPred<Constant>))
51575153 return nullptr ;
51585154
51595155 if (!ConstantExpr::isSupportedGetElementPtr (SrcTy))
@@ -5691,7 +5687,7 @@ static Constant *simplifyFPOp(ArrayRef<Value *> Ops, FastMathFlags FMF,
56915687 RoundingMode Rounding) {
56925688 // Poison is independent of anything else. It always propagates from an
56935689 // operand to a math result.
5694- if (any_of (Ops, [](Value *V) { return match (V, m_Poison ()); } ))
5690+ if (any_of (Ops, IsaPred<PoisonValue> ))
56955691 return PoisonValue::get (Ops[0 ]->getType ());
56965692
56975693 for (Value *V : Ops) {
@@ -7155,7 +7151,7 @@ static Value *simplifyInstructionWithOperands(Instruction *I,
71557151
71567152 switch (I->getOpcode ()) {
71577153 default :
7158- if (llvm:: all_of (NewOps, [](Value *V) { return isa <Constant>(V); } )) {
7154+ if (all_of (NewOps, IsaPred <Constant>)) {
71597155 SmallVector<Constant *, 8 > NewConstOps (NewOps.size ());
71607156 transform (NewOps, NewConstOps.begin (),
71617157 [](Value *V) { return cast<Constant>(V); });
0 commit comments