Skip to content

Commit dfa86f2

Browse files
committed
!fixup address latest comments, thanks
1 parent 54043da commit dfa86f2

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;
@@ -9227,8 +9223,7 @@ bool llvm::matchSimpleRecurrence(const PHINode *P, BinaryOperator *&BO,
92279223
Instruction *I;
92289224
if (matchSimpleRecurrence(P, I, Start, Step)) {
92299225
BO = dyn_cast<BinaryOperator>(I);
9230-
if (BO)
9231-
return true;
9226+
return BO;
92329227
}
92339228
return false;
92349229
}
@@ -9277,13 +9272,8 @@ bool llvm::matchSimpleRecurrence(const PHINode *P, Instruction *&BO,
92779272
break; // Match!
92789273
}
92799274
case Instruction::GetElementPtr: {
9280-
Value *LL;
92819275
Value *LR;
9282-
if (!match(L, m_PtrAdd(m_Value(LL), m_Value(LR))))
9283-
continue;
9284-
9285-
// Find a recurrence.
9286-
if (LL == P) {
9276+
if (match(L, m_PtrAdd(m_Specific(P), m_Value(LR)))) {
92879277
// Found a match
92889278
L = LR;
92899279
break;

0 commit comments

Comments
 (0)