summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-08-03 01:03:12 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-08-03 01:03:12 +0000
commit2f9cce2cd6715bceeab0ec052e115ce64252fb88 (patch)
tree2a0d2f2a10df2e6ad92109580bda587a7780b71b /llvm/include
parent05f1ae987b271753cb3619cbcaf8fb986f014504 (diff)
downloadbcm5719-llvm-2f9cce2cd6715bceeab0ec052e115ce64252fb88.tar.gz
bcm5719-llvm-2f9cce2cd6715bceeab0ec052e115ce64252fb88.zip
Minor address space code simplification.
Remove assertion that the verifier should catch. llvm-svn: 187692
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Transforms/Utils/Local.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/Local.h b/llvm/include/llvm/Transforms/Utils/Local.h
index 151dfa646b5..5e60286ba73 100644
--- a/llvm/include/llvm/Transforms/Utils/Local.h
+++ b/llvm/include/llvm/Transforms/Utils/Local.h
@@ -181,8 +181,7 @@ template<typename IRBuilderTy>
Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &TD, User *GEP,
bool NoAssumptions = false) {
GEPOperator *GEPOp = cast<GEPOperator>(GEP);
- unsigned AS = GEPOp->getPointerAddressSpace();
- Type *IntPtrTy = TD.getIntPtrType(GEP->getContext(), AS);
+ Type *IntPtrTy = TD.getIntPtrType(GEP->getType());
Value *Result = Constant::getNullValue(IntPtrTy);
// If the GEP is inbounds, we know that none of the addressing operations will
@@ -190,7 +189,7 @@ Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &TD, User *GEP,
bool isInBounds = GEPOp->isInBounds() && !NoAssumptions;
// Build a mask for high order bits.
- unsigned IntPtrWidth = TD.getPointerSizeInBits(AS);
+ unsigned IntPtrWidth = IntPtrTy->getScalarType()->getIntegerBitWidth();
uint64_t PtrSizeMask = ~0ULL >> (64 - IntPtrWidth);
gep_type_iterator GTI = gep_type_begin(GEP);
OpenPOWER on IntegriCloud