aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-04-27 05:42:17 +0000
committerAndrew Trick <atrick@apple.com>2011-04-27 05:42:17 +0000
commit104f4adeac9f555530ad24be609dae9d09baea18 (patch)
treea3e5c7f63cd95f20a008ed0cbfa82108cd0f0523 /lib/Analysis/ScalarEvolution.cpp
parent3f5c8329098abbd885f69ff8a11af62561d9d41b (diff)
Test case and comment for PR9633.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 9396b07dab..1bef857e70 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -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;