summaryrefslogtreecommitdiff
path: root/include/llvm/Transforms/Utils/Local.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Transforms/Utils/Local.h')
-rw-r--r--include/llvm/Transforms/Utils/Local.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h
index 21dd3fbe110..fd1b5556ef2 100644
--- a/include/llvm/Transforms/Utils/Local.h
+++ b/include/llvm/Transforms/Utils/Local.h
@@ -186,7 +186,8 @@ Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &TD, User *GEP,
bool isInBounds = cast<GEPOperator>(GEP)->isInBounds() && !NoAssumptions;
// Build a mask for high order bits.
- unsigned IntPtrWidth = TD.getPointerSizeInBits();
+ unsigned AS = cast<GEPOperator>(GEP)->getPointerAddressSpace();
+ unsigned IntPtrWidth = TD.getPointerSizeInBits(AS);
uint64_t PtrSizeMask = ~0ULL >> (64-IntPtrWidth);
for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e;