Skip to content

Commit 3a284f7

Browse files
committed
!fixup use m_PtrAdd, thanks!
1 parent 31c4524 commit 3a284f7

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
@@ -9254,7 +9254,7 @@ bool llvm::matchSimpleRecurrence(const PHINode *P, Instruction *&BO,
92549254
switch (Opcode) {
92559255
default:
92569256
continue;
9257-
// TODO: Expand list -- xor, gep, uadd.sat etc.
9257+
// TODO: Expand list -- xor, uadd.sat etc.
92589258
case Instruction::LShr:
92599259
case Instruction::AShr:
92609260
case Instruction::Shl:
@@ -9279,12 +9279,11 @@ bool llvm::matchSimpleRecurrence(const PHINode *P, Instruction *&BO,
92799279
break; // Match!
92809280
}
92819281
case Instruction::GetElementPtr: {
9282-
if (LU->getNumOperands() != 2 ||
9283-
!cast<GetElementPtrInst>(L)->getSourceElementType()->isIntegerTy(8))
9282+
Value *LL;
9283+
Value *LR;
9284+
if (!match(L, m_PtrAdd(m_Value(LL), m_Value(LR))))
92849285
continue;
92859286

9286-
Value *LL = LU->getOperand(0);
9287-
Value *LR = LU->getOperand(1);
92889287
// Find a recurrence.
92899288
if (LL == P) {
92909289
// Found a match

0 commit comments

Comments
 (0)