Add a comment.
authorDan Gohman <gohman@apple.com>
Fri, 19 Feb 2010 18:49:22 +0000 (18:49 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 19 Feb 2010 18:49:22 +0000 (18:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96688 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index a0700ba4218d42b80c683acac69915c27d5815e8..66c45176d5e886db3b2fb2845d34c962d64bcbfe 100644 (file)
@@ -1973,6 +1973,12 @@ ScalarEvolution::getAddRecExpr(SmallVectorImpl<const SCEV *> &Operands,
     return getAddRecExpr(Operands, L, HasNUW, HasNSW); // {X,+,0}  -->  X
   }
 
+  // It's tempting to want to call getMaxBackedgeTakenCount count here and
+  // use that information to infer NUW and NSW flags. However, computing a
+  // BE count requires calling getAddRecExpr, so we may not yet have a
+  // meaningful BE count at this point (and if we don't, we'd be stuck
+  // with a SCEVCouldNotCompute as the cached BE count).
+
   // If HasNSW is true and all the operands are non-negative, infer HasNUW.
   if (!HasNUW && HasNSW) {
     bool All = true;