summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-11-16 20:50:54 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-11-16 20:50:54 +0000
commite6e811277f045ee3d61cd62622d71005c47eb48d (patch)
tree7d3d8fa4880b377e58779495a1657d0777863825 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent4fe5b640ee935f983db9445dc9fdb4009d4fa639 (diff)
downloadllvm-e6e811277f045ee3d61cd62622d71005c47eb48d.tar.gz
llvm-e6e811277f045ee3d61cd62622d71005c47eb48d.tar.bz2
llvm-e6e811277f045ee3d61cd62622d71005c47eb48d.tar.xz
Fix assert on unaligned access to global with different address space size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index bac06ccaf5..85e5494b8e 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -6372,7 +6372,7 @@ unsigned SelectionDAG::InferPtrAlignment(SDValue Ptr) const {
int64_t GVOffset = 0;
const TargetLowering *TLI = TM.getTargetLowering();
if (TLI->isGAPlusOffset(Ptr.getNode(), GV, GVOffset)) {
- unsigned PtrWidth = TLI->getPointerTy().getSizeInBits();
+ unsigned PtrWidth = TLI->getPointerTypeSizeInBits(GV->getType());
APInt KnownZero(PtrWidth, 0), KnownOne(PtrWidth, 0);
llvm::ComputeMaskedBits(const_cast<GlobalValue*>(GV), KnownZero, KnownOne,
TLI->getDataLayout());