Don't cache PHI exit values from exhaustive evaluations, because

an individual exhaustive evaluation reflects only the exit value
implied by an individual exit, which may differ from the actual
exit value of the loop if there are other exits. This fixes PR4477.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74447 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2009-06-29 20:34:13 +00:00
parent 63de5c3b7e
commit cffddcd726
2 changed files with 78 additions and 1 deletions

View File

@ -3521,7 +3521,6 @@ ScalarEvolution::ComputeBackedgeTakenCountExhaustively(const Loop *L,
if (!CondVal) return getCouldNotCompute();
if (CondVal->getValue() == uint64_t(ExitWhen)) {
ConstantEvolutionLoopExitValue[PN] = PHIVal;
++NumBruteForceTripCountsComputed;
return getConstant(Type::Int32Ty, IterationNum);
}