Skip to content

Commit cce1216

Browse files
committed
!fixup address latest comments, thanks
1 parent 3a284f7 commit cce1216

File tree

2 files changed

+222
-232
lines changed

2 files changed

+222
-232
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,10 +1618,6 @@ static void computeKnownBitsFromOperator(const Operator *I,
16181618
Known.Zero.setLowBits(std::min(Known2.countMinTrailingZeros(),
16191619
Known3.countMinTrailingZeros()));
16201620

1621-
// Don't apply logic below for GEPs.
1622-
if (isa<GetElementPtrInst>(BO))
1623-
break;
1624-
16251621
auto *OverflowOp = dyn_cast<OverflowingBinaryOperator>(BO);
16261622
if (!OverflowOp || !Q.IIQ.hasNoSignedWrap(OverflowOp))
16271623
break;
@@ -9229,8 +9225,7 @@ bool llvm::matchSimpleRecurrence(const PHINode *P, BinaryOperator *&BO,
92299225
Instruction *I;
92309226
if (matchSimpleRecurrence(P, I, Start, Step)) {
92319227
BO = dyn_cast<BinaryOperator>(I);
9232-
if (BO)
9233-
return true;
9228+
return BO;
92349229
}
92359230
return false;
92369231
}
@@ -9279,13 +9274,8 @@ bool llvm::matchSimpleRecurrence(const PHINode *P, Instruction *&BO,
92799274
break; // Match!
92809275
}
92819276
case Instruction::GetElementPtr: {
9282-
Value *LL;
92839277
Value *LR;
9284-
if (!match(L, m_PtrAdd(m_Value(LL), m_Value(LR))))
9285-
continue;
9286-
9287-
// Find a recurrence.
9288-
if (LL == P) {
9278+
if (match(L, m_PtrAdd(m_Specific(P), m_Value(LR)))) {
92899279
// Found a match
92909280
L = LR;
92919281
break;

0 commit comments

Comments
 (0)