From 2f9cce2cd6715bceeab0ec052e115ce64252fb88 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 3 Aug 2013 01:03:12 +0000 Subject: Minor address space code simplification. Remove assertion that the verifier should catch. llvm-svn: 187692 --- llvm/include/llvm/Transforms/Utils/Local.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/include') 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 Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &TD, User *GEP, bool NoAssumptions = false) { GEPOperator *GEPOp = cast(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); -- cgit v1.2.3