aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-09 00:14:52 +0000
committerDan Gohman <gohman@apple.com>2009-05-09 00:14:52 +0000
commitd586a4fef1bca15f3c4324d0238c417664111a88 (patch)
tree9bb2b31871a4af99ec61e7199467411aff806297
parent5cae0f2f762a1d620879f332a79803cc2fc8f0e7 (diff)
downloadexternal_llvm-d586a4fef1bca15f3c4324d0238c417664111a88.tar.gz
external_llvm-d586a4fef1bca15f3c4324d0238c417664111a88.tar.bz2
external_llvm-d586a4fef1bca15f3c4324d0238c417664111a88.zip
Don't attempt to handle unsized types in ScalarEvolution's GEP analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71302 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/ScalarEvolution.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index c53d1f5aae..3f2656240e 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -1935,6 +1935,9 @@ SCEVHandle ScalarEvolution::createNodeForGEP(User *GEP) {
const Type *IntPtrTy = TD->getIntPtrType();
Value *Base = GEP->getOperand(0);
+ // Don't attempt to analyze GEPs over unsized objects.
+ if (!cast<PointerType>(Base->getType())->getElementType()->isSized())
+ return getUnknown(GEP);
SCEVHandle TotalOffset = getIntegerSCEV(0, IntPtrTy);
gep_type_iterator GTI = gep_type_begin(GEP);
for (GetElementPtrInst::op_iterator I = next(GEP->op_begin()),