@@ -5057,14 +5057,12 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
5057
5057
}
5058
5058
5059
5059
// 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 ())))
5062
5061
return Ptr;
5063
5062
5064
5063
// getelementptr poison, idx -> poison
5065
5064
// 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>))
5068
5066
return PoisonValue::get (GEPTy);
5069
5067
5070
5068
// getelementptr undef, idx -> undef
@@ -5121,8 +5119,7 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
5121
5119
}
5122
5120
5123
5121
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 ()))) {
5126
5123
unsigned IdxWidth =
5127
5124
Q.DL .getIndexSizeInBits (Ptr->getType ()->getPointerAddressSpace ());
5128
5125
if (Q.DL .getTypeSizeInBits (Indices.back ()->getType ()) == IdxWidth) {
@@ -5152,8 +5149,7 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
5152
5149
}
5153
5150
5154
5151
// 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>))
5157
5153
return nullptr ;
5158
5154
5159
5155
if (!ConstantExpr::isSupportedGetElementPtr (SrcTy))
@@ -5691,7 +5687,7 @@ static Constant *simplifyFPOp(ArrayRef<Value *> Ops, FastMathFlags FMF,
5691
5687
RoundingMode Rounding) {
5692
5688
// Poison is independent of anything else. It always propagates from an
5693
5689
// operand to a math result.
5694
- if (any_of (Ops, [](Value *V) { return match (V, m_Poison ()); } ))
5690
+ if (any_of (Ops, IsaPred<PoisonValue> ))
5695
5691
return PoisonValue::get (Ops[0 ]->getType ());
5696
5692
5697
5693
for (Value *V : Ops) {
@@ -7155,7 +7151,7 @@ static Value *simplifyInstructionWithOperands(Instruction *I,
7155
7151
7156
7152
switch (I->getOpcode ()) {
7157
7153
default :
7158
- if (llvm:: all_of (NewOps, [](Value *V) { return isa <Constant>(V); } )) {
7154
+ if (all_of (NewOps, IsaPred <Constant>)) {
7159
7155
SmallVector<Constant *, 8 > NewConstOps (NewOps.size ());
7160
7156
transform (NewOps, NewConstOps.begin (),
7161
7157
[](Value *V) { return cast<Constant>(V); });
0 commit comments