aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/ScalarEvolution.h
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-03-17 23:51:11 +0000
committerAndrew Trick <atrick@apple.com>2011-03-17 23:51:11 +0000
commitb12a754cce0c1d5542af605203a47820edba454d (patch)
tree384ff7a7b2bafcf8653b8c98c11787e00ec92bbe /include/llvm/Analysis/ScalarEvolution.h
parentead71d59a7685fbbbb92162556680abd9001d37b (diff)
downloadexternal_llvm-b12a754cce0c1d5542af605203a47820edba454d.zip
external_llvm-b12a754cce0c1d5542af605203a47820edba454d.tar.gz
external_llvm-b12a754cce0c1d5542af605203a47820edba454d.tar.bz2
Added isValidRewrite() to check the result of ScalarEvolutionExpander.
SCEV may generate expressions composed of multiple pointers, which can lead to invalid GEP expansion. Until we can teach SCEV to follow strict pointer rules, make sure no bad GEPs creep into IR. Fixes rdar://problem/9038671. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127839 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolution.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolution.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h
index 651f989..6df5433 100644
--- a/include/llvm/Analysis/ScalarEvolution.h
+++ b/include/llvm/Analysis/ScalarEvolution.h
@@ -618,6 +618,12 @@ namespace llvm {
const SCEV *getUMinFromMismatchedTypes(const SCEV *LHS,
const SCEV *RHS);
+ /// getPointerBase - Transitively follow the chain of pointer-type operands
+ /// until reaching a SCEV that does not have a single pointer operand. This
+ /// returns a SCEVUnknown pointer for well-formed pointer-type expressions,
+ /// but corner cases do exist.
+ const SCEV *getPointerBase(const SCEV *V);
+
/// getSCEVAtScope - Return a SCEV expression for the specified value
/// at the specified scope in the program. The L value specifies a loop
/// nest to evaluate the expression at, where null is the top-level or a