diff options
author | Andrew Trick <atrick@apple.com> | 2011-03-17 23:51:11 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-03-17 23:51:11 +0000 |
commit | b12a754cce0c1d5542af605203a47820edba454d (patch) | |
tree | 384ff7a7b2bafcf8653b8c98c11787e00ec92bbe /include/llvm/Analysis/ScalarEvolution.h | |
parent | ead71d59a7685fbbbb92162556680abd9001d37b (diff) |
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.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index 651f989fe6..6df543393f 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 |