summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-02-19 18:49:22 +0000
committerDan Gohman <gohman@apple.com>2010-02-19 18:49:22 +0000
commitcf9c64e6e375e28c12222375c0192492709d7c1f (patch)
tree98ece5003876a2b9faa9b582b2036f1bc443c38e /llvm/lib
parentc5d61df0a96ec1802f5286d2eea9d4947e73dd72 (diff)
downloadbcm5719-llvm-cf9c64e6e375e28c12222375c0192492709d7c1f.tar.gz
bcm5719-llvm-cf9c64e6e375e28c12222375c0192492709d7c1f.zip
Add a comment.
llvm-svn: 96688
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index a0700ba4218..66c45176d5e 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -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;
OpenPOWER on IntegriCloud