Test case and comment for PR9633.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130294 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Trick
2011-04-27 05:42:17 +00:00
parent 3f5c832909
commit 104f4adeac
2 changed files with 36 additions and 2 deletions

View File

@@ -4705,8 +4705,9 @@ const SCEV *ScalarEvolution::computeSCEVAtScope(const SCEV *V, const Loop *L) {
getAddRecExpr(NewOps, AddRec->getLoop(),
AddRec->getNoWrapFlags(SCEV::FlagNW));
AddRec = dyn_cast<SCEVAddRecExpr>(FoldedRec);
// In cases with "undef" values, a loop's own recurrence may
// fold into a constant. Go ahead and return the optimistic value.
// The addrec may be folded to a nonrecurrence, for example, if the
// induction variable is multiplied by zero after constant folding. Go
// ahead and return the folded value.
if (!AddRec)
return FoldedRec;
break;