Fix a problem where we could infinitely recurse on phi nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19955 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-02-01 00:18:30 +00:00
parent 41ce39cbd7
commit caa7c19fb4

View File

@ -1163,7 +1163,7 @@ void ScalarEvolutionsImpl::UpdatePHIUserScalarEntries(Instruction *I,
std::set<Instruction*> &UpdatedInsts) {
std::map<Value*, SCEVHandle>::iterator SI = Scalars.find(I);
if (SI == Scalars.end()) return; // This scalar wasn't previous processed.
if (UpdatedInsts.insert(I).second) {
if (UpdatedInsts.insert(I).second && !isa<PHINode>(PN)) {
Scalars.erase(SI); // Remove the old entry
getSCEV(I); // Calculate the new entry