Skip to content

Commit fb1933c

Browse files
committed
ValueTracking: avoid compile-time blowup
1 parent 9a3f743 commit fb1933c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3537,9 +3537,11 @@ static bool isNonEqualPHIs(const PHINode *PN1, const PHINode *PN2,
35373537
continue; // Don't reprocess blocks that we have dealt with already.
35383538
const Value *IV1 = PN1->getIncomingValueForBlock(IncomBB);
35393539
const Value *IV2 = PN2->getIncomingValueForBlock(IncomBB);
3540+
const unsigned PhiRecursionLimit =
3541+
std::max(Depth, MaxAnalysisRecursionDepth - 2);
35403542
SimplifyQuery RecQ = Q.getWithoutCondContext();
35413543
RecQ.CxtI = IncomBB->getTerminator();
3542-
if (!isKnownNonEqual(IV1, IV2, DemandedElts, Depth + 1, RecQ))
3544+
if (!isKnownNonEqual(IV1, IV2, DemandedElts, PhiRecursionLimit, RecQ))
35433545
return false;
35443546
}
35453547
return true;

0 commit comments

Comments
 (0)