Skip to content

Commit d5ca963

Browse files
committed
[SCEV] Fix thinko; revert a change
1 parent 8e8f059 commit d5ca963

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9571,14 +9571,15 @@ getConstantEvolvingPHIOperands(Instruction *UseInst, const Loop *L,
95719571
if (!OpInst || !canConstantEvolve(OpInst, L)) return nullptr;
95729572

95739573
PHINode *P = dyn_cast<PHINode>(OpInst);
9574-
if (!P) {
9574+
if (!P)
95759575
// If this operand is already visited, reuse the prior result.
95769576
// We may have P != PHI if this is the deepest point at which the
95779577
// inconsistent paths meet.
9578+
P = PHIMap.lookup(OpInst);
9579+
if (!P) {
95789580
// Recurse and memoize the results, whether a phi is found or not.
95799581
// This recursive call invalidates pointers into PHIMap.
9580-
P = PHIMap.lookup_or(
9581-
OpInst, getConstantEvolvingPHIOperands(OpInst, L, PHIMap, Depth + 1));
9582+
P = getConstantEvolvingPHIOperands(OpInst, L, PHIMap, Depth + 1);
95829583
PHIMap[OpInst] = P;
95839584
}
95849585
if (!P)

0 commit comments

Comments
 (0)