aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-11-16 00:36:43 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-11-16 00:36:43 +0000
commita8fe22babac7822d3254cdf2b68d54f362bcbf9f (patch)
tree16e516921d57c185b8122a7fa32b20d1d78e138a /llvm/lib/Analysis/BasicAliasAnalysis.cpp
parent52c5020dae3e7038b59ccf2864babfe92d6a9e1e (diff)
downloadllvm-a8fe22babac7822d3254cdf2b68d54f362bcbf9f.zip
llvm-a8fe22babac7822d3254cdf2b68d54f362bcbf9f.tar.gz
llvm-a8fe22babac7822d3254cdf2b68d54f362bcbf9f.tar.bz2
Use correct size for address space in BasicAA.
The tests just hit this with a different sized address space since I haven't figured out how to use this to break it. I thought I committed this a long time ago, and I'm not sure why missing this hasn't caused any problems. llvm-svn: 194903
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index bf92969..b2c2011 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -326,6 +326,7 @@ DecomposeGEPExpression(const Value *V, int64_t &BaseOffs,
continue;
}
+ unsigned AS = GEPOp->getPointerAddressSpace();
// Walk the indices of the GEP, accumulating them into BaseOff/VarIndices.
gep_type_iterator GTI = gep_type_begin(GEPOp);
for (User::const_op_iterator I = GEPOp->op_begin()+1,
@@ -354,7 +355,7 @@ DecomposeGEPExpression(const Value *V, int64_t &BaseOffs,
// If the integer type is smaller than the pointer size, it is implicitly
// sign extended to pointer size.
unsigned Width = Index->getType()->getIntegerBitWidth();
- if (TD->getPointerSizeInBits() > Width)
+ if (TD->getPointerSizeInBits(AS) > Width)
Extension = EK_SignExt;
// Use GetLinearExpression to decompose the index into a C1*V+C2 form.
@@ -382,7 +383,7 @@ DecomposeGEPExpression(const Value *V, int64_t &BaseOffs,
// Make sure that we have a scale that makes sense for this target's
// pointer size.
- if (unsigned ShiftBits = 64-TD->getPointerSizeInBits()) {
+ if (unsigned ShiftBits = 64 - TD->getPointerSizeInBits(AS)) {
Scale <<= ShiftBits;
Scale = (int64_t)Scale >> ShiftBits;
}