Skip to content

Commit fe78303

Browse files
committed
[InstSimpl, InstComb] Fix missed IsaPred changes
1 parent 7051cc7 commit fe78303

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/lib/Analysis/InstructionSimplify.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5033,7 +5033,7 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
50335033

50345034
// getelementptr poison, idx -> poison
50355035
// getelementptr baseptr, poison -> poison
5036-
if (isa<PoisonValue>(Ptr) || any_of(Indices, match_fn(m_Poison())))
5036+
if (isa<PoisonValue>(Ptr) || any_of(Indices, IsaPred<PoisonValue>))
50375037
return PoisonValue::get(GEPTy);
50385038

50395039
// getelementptr undef, idx -> undef
@@ -5120,7 +5120,7 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
51205120
}
51215121

51225122
// Check to see if this is constant foldable.
5123-
if (!isa<Constant>(Ptr) || !all_of(Indices, match_fn(m_Constant())))
5123+
if (!isa<Constant>(Ptr) || !all_of(Indices, IsaPred<Constant>))
51245124
return nullptr;
51255125

51265126
if (!ConstantExpr::isSupportedGetElementPtr(SrcTy))
@@ -5658,7 +5658,7 @@ static Constant *simplifyFPOp(ArrayRef<Value *> Ops, FastMathFlags FMF,
56585658
RoundingMode Rounding) {
56595659
// Poison is independent of anything else. It always propagates from an
56605660
// operand to a math result.
5661-
if (any_of(Ops, match_fn(m_Poison())))
5661+
if (any_of(Ops, IsaPred<PoisonValue>))
56625662
return PoisonValue::get(Ops[0]->getType());
56635663

56645664
for (Value *V : Ops) {
@@ -7122,7 +7122,7 @@ static Value *simplifyInstructionWithOperands(Instruction *I,
71227122

71237123
switch (I->getOpcode()) {
71247124
default:
7125-
if (all_of(NewOps, match_fn(m_Constant()))) {
7125+
if (all_of(NewOps, IsaPred<Constant>)) {
71267126
SmallVector<Constant *, 8> NewConstOps(NewOps.size());
71277127
transform(NewOps, NewConstOps.begin(),
71287128
[](Value *V) { return cast<Constant>(V); });

llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ bool InstCombinerImpl::foldIntegerTypedPHI(PHINode &PN) {
340340
Instruction *InstCombinerImpl::foldPHIArgIntToPtrToPHI(PHINode &PN) {
341341
// convert ptr2int ( phi[ int2ptr(ptr2int(x))] ) --> ptr2int ( phi [ x ] )
342342
// Make sure all uses of phi are ptr2int.
343-
if (!all_of(PN.users(), match_fn(m_PtrToInt(m_Value()))))
343+
if (!all_of(PN.users(), IsaPred<PtrToIntInst>))
344344
return nullptr;
345345

346346
// Iterating over all operands to check presence of target pointers for
@@ -1299,7 +1299,7 @@ static Value *simplifyUsingControlFlow(InstCombiner &Self, PHINode &PN,
12991299
// \ /
13001300
// phi [v1] [v2]
13011301
// Make sure all inputs are constants.
1302-
if (!all_of(PN.operands(), match_fn(m_ConstantInt())))
1302+
if (!all_of(PN.operands(), IsaPred<ConstantInt>))
13031303
return nullptr;
13041304

13051305
BasicBlock *BB = PN.getParent();

0 commit comments

Comments
 (0)