summaryrefslogtreecommitdiffstats
path: root/llvm/include
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
commit87716c93c2f73a8b64ef3cf5c99519c9216c2720 (patch)
treeb15cb934f2a55dfb03de700bbc2f783f011a840f /llvm/include
parent4c753376cb35ae911bde2301ca2b9e9706f43008 (diff)
downloadbcm5719-llvm-87716c93c2f73a8b64ef3cf5c99519c9216c2720.tar.gz
bcm5719-llvm-87716c93c2f73a8b64ef3cf5c99519c9216c2720.zip
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. llvm-svn: 127839
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Analysis/ScalarEvolution.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h
index 651f989fe61..6df543393f2 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolution.h
+++ b/llvm/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
OpenPOWER on IntegriCloud