From 1230cf25bafa057498cfbf1e6186f841b8f67ebb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 1 Feb 2005 00:18:30 +0000 Subject: [PATCH] Fix a problem where we could infinitely recurse on phi nodes. llvm-svn: 19955 --- llvm/lib/Analysis/ScalarEvolution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index ad08489cdb36..d400b4b3fd85 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -1163,7 +1163,7 @@ void ScalarEvolutionsImpl::UpdatePHIUserScalarEntries(Instruction *I, std::set &UpdatedInsts) { std::map::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(PN)) { Scalars.erase(SI); // Remove the old entry getSCEV(I); // Calculate the new entry -- GitLab