Skip to content

Commit c8ea5c7

Browse files
committed
!fixup use m_PtrAdd, thanks!
1 parent b86bbb8 commit c8ea5c7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9238,7 +9238,7 @@ bool llvm::matchSimpleRecurrence(const PHINode *P, Instruction *&BO,
92389238
switch (Opcode) {
92399239
default:
92409240
continue;
9241-
// TODO: Expand list -- xor, gep, uadd.sat etc.
9241+
// TODO: Expand list -- xor, uadd.sat etc.
92429242
case Instruction::LShr:
92439243
case Instruction::AShr:
92449244
case Instruction::Shl:
@@ -9263,12 +9263,11 @@ bool llvm::matchSimpleRecurrence(const PHINode *P, Instruction *&BO,
92639263
break; // Match!
92649264
}
92659265
case Instruction::GetElementPtr: {
9266-
if (LU->getNumOperands() != 2 ||
9267-
!cast<GetElementPtrInst>(L)->getSourceElementType()->isIntegerTy(8))
9266+
Value *LL;
9267+
Value *LR;
9268+
if (!match(L, m_PtrAdd(m_Value(LL), m_Value(LR))))
92689269
continue;
92699270

9270-
Value *LL = LU->getOperand(0);
9271-
Value *LR = LU->getOperand(1);
92729271
// Find a recurrence.
92739272
if (LL == P) {
92749273
// Found a match

0 commit comments

Comments
 (0)