summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-20 17:44:17 +0000
committerDan Gohman <gohman@apple.com>2009-07-20 17:44:17 +0000
commit16e96c047f425de0623a2fe4052644a1a8e328b4 (patch)
tree16f1d708ac8fea0d1d3889bab2112123bb36f180 /llvm/lib/Analysis/ScalarEvolutionExpander.cpp
parent33a3fd0b9c76d85c478de582d6a26d79c8ddefbb (diff)
downloadbcm5719-llvm-16e96c047f425de0623a2fe4052644a1a8e328b4.tar.gz
bcm5719-llvm-16e96c047f425de0623a2fe4052644a1a8e328b4.zip
Update this comment.
llvm-svn: 76438
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 20d6e20601f..b6af26a08e5 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -215,13 +215,11 @@ static bool FactorOutConstant(const SCEV *&S,
/// expandAddToGEP - Expand a SCEVAddExpr with a pointer type into a GEP
/// instead of using ptrtoint+arithmetic+inttoptr. This helps
-/// BasicAliasAnalysis analyze the result. However, it suffers from the
-/// underlying bug described in PR2831. Addition in LLVM currently always
-/// has two's complement wrapping guaranteed. However, the semantics for
-/// getelementptr overflow are ambiguous. In the common case though, this
-/// expansion gets used when a GEP in the original code has been converted
-/// into integer arithmetic, in which case the resulting code will be no
-/// more undefined than it was originally.
+/// BasicAliasAnalysis analyze the result.
+///
+/// Design note: This depends on ScalarEvolution not recognizing inttoptr
+/// and ptrtoint operators, as they may introduce pointer arithmetic
+/// which may not be safely converted into getelementptr.
///
/// Design note: It might seem desirable for this function to be more
/// loop-aware. If some of the indices are loop-invariant while others
OpenPOWER on IntegriCloud