summaryrefslogtreecommitdiff
path: root/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
commit6b4dde71cfdcb2e1f2105dd8a677c14d8c3bb4b4 (patch)
tree6c20995c226b29101dc53676a637e2676673415e /include
parentf3289e7d74ac7f4d03f54b56ab4b0d50795c1e7f (diff)
downloadllvm-6b4dde71cfdcb2e1f2105dd8a677c14d8c3bb4b4.tar.gz
llvm-6b4dde71cfdcb2e1f2105dd8a677c14d8c3bb4b4.tar.bz2
llvm-6b4dde71cfdcb2e1f2105dd8a677c14d8c3bb4b4.tar.xz
Minor address space code simplification.
Remove assertion that the verifier should catch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187692 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Transforms/Utils/Local.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h
index 151dfa646b..5e60286ba7 100644
--- a/include/llvm/Transforms/Utils/Local.h
+++ b/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);