diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2017-11-16 02:54:49 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2017-11-16 02:54:49 +0000 |
commit | 4d9a4d7ac8c7f5f915bb53a46ad4d108d6ad5bea (patch) | |
tree | b3c7b8684decd27b5ee23504e885a1b52375b497 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 396ed67950ce8559da1c7ea896a1cfe86fd3b27a (diff) | |
download | bcm5719-llvm-4d9a4d7ac8c7f5f915bb53a46ad4d108d6ad5bea.tar.gz bcm5719-llvm-4d9a4d7ac8c7f5f915bb53a46ad4d108d6ad5bea.zip |
Fix APInt bit size in processDbgDeclares
processDbgDeclares assumes pointer size is the same for different addr spaces.
It uses pointer size for addr space 0 for all pointers, which causes assertion
in stripAndAccumulateInBoundsConstantOffsets for amdgcn---amdgiz since
pointer in addr space 5 has different size than in addr space 0.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D40085
llvm-svn: 318370
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index ae5eebd9545..f795391553c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1142,7 +1142,7 @@ static void processDbgDeclares(FunctionLoweringInfo *FuncInfo) { // Look through casts and constant offset GEPs. These mostly come from // inalloca. - APInt Offset(DL.getPointerSizeInBits(0), 0); + APInt Offset(DL.getTypeSizeInBits(Address->getType()), 0); Address = Address->stripAndAccumulateInBoundsConstantOffsets(DL, Offset); // Check if the variable is a static alloca or a byval or inalloca |