diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-08-03 01:03:12 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-08-03 01:03:12 +0000 |
commit | 6b4dde71cfdcb2e1f2105dd8a677c14d8c3bb4b4 (patch) | |
tree | 6c20995c226b29101dc53676a637e2676673415e /include/llvm/Transforms/Utils/Local.h | |
parent | f3289e7d74ac7f4d03f54b56ab4b0d50795c1e7f (diff) | |
download | external_llvm-6b4dde71cfdcb2e1f2105dd8a677c14d8c3bb4b4.zip external_llvm-6b4dde71cfdcb2e1f2105dd8a677c14d8c3bb4b4.tar.gz external_llvm-6b4dde71cfdcb2e1f2105dd8a677c14d8c3bb4b4.tar.bz2 |
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/llvm/Transforms/Utils/Local.h')
-rw-r--r-- | include/llvm/Transforms/Utils/Local.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h index 151dfa6..5e60286 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); |