aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-04-16 21:34:54 +0000
committerDan Gohman <gohman@apple.com>2009-04-16 21:34:54 +0000
commitb7a63e719f68d228b8f40c63eefa61ec94fa7730 (patch)
tree587ee3ce2e1621d01f7e0165c4cc4608adb3e9ee /lib
parentba6a6125f561d92163491c8756c816d5a3666452 (diff)
downloadexternal_llvm-b7a63e719f68d228b8f40c63eefa61ec94fa7730.zip
external_llvm-b7a63e719f68d228b8f40c63eefa61ec94fa7730.tar.gz
external_llvm-b7a63e719f68d228b8f40c63eefa61ec94fa7730.tar.bz2
Handle a pointer type correctly in SCEVExpander::visitAddRecExpr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69310 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ScalarEvolutionExpander.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp
index 0e0eb55..c27bbdc 100644
--- a/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -227,6 +227,8 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) {
// If this is a simple linear addrec, emit it now as a special case.
if (S->isAffine()) { // {0,+,F} --> i*F
Value *F = expand(S->getOperand(1));
+ if (isa<PointerType>(F->getType()))
+ F = InsertCastOfTo(Instruction::PtrToInt, F, TD.getIntPtrType());
// IF the step is by one, just return the inserted IV.
if (ConstantInt *CI = dyn_cast<ConstantInt>(F))