aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorMicah Villmow <villmow@gmail.com>2012-10-24 15:52:52 +0000
committerMicah Villmow <villmow@gmail.com>2012-10-24 15:52:52 +0000
commit12d9127833b08733090eabb2b55d1184db8da395 (patch)
tree7cd4873f9416a670b3bc2b3e92e02da1d67d1854 /llvm/lib/Analysis/ScalarEvolutionExpander.cpp
parentc6317dbf5ed134f3dc54a92848707831f8787fb2 (diff)
downloadllvm-12d9127833b08733090eabb2b55d1184db8da395.zip
llvm-12d9127833b08733090eabb2b55d1184db8da395.tar.gz
llvm-12d9127833b08733090eabb2b55d1184db8da395.tar.bz2
Add in support for getIntPtrType to get the pointer type based on the address space.
This checkin also adds in some tests that utilize these paths and updates some of the clients. llvm-svn: 166578
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 111bfb4..0295da5 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -417,7 +417,9 @@ Value *SCEVExpander::expandAddToGEP(const SCEV *const *op_begin,
// array indexing.
SmallVector<const SCEV *, 8> ScaledOps;
if (ElTy->isSized()) {
- const SCEV *ElSize = SE.getSizeOfExpr(ElTy);
+ Type *IntPtrTy = SE.TD ? SE.TD->getIntPtrType(PTy) :
+ IntegerType::getInt64Ty(PTy->getContext());
+ const SCEV *ElSize = SE.getSizeOfExpr(ElTy, IntPtrTy);
if (!ElSize->isZero()) {
SmallVector<const SCEV *, 8> NewOps;
for (unsigned i = 0, e = Ops.size(); i != e; ++i) {