diff options
author | Nicola Zaghen <nicola.zaghen@imgtec.com> | 2019-12-13 09:55:45 +0000 |
---|---|---|
committer | Nicola Zaghen <nicola.zaghen@imgtec.com> | 2019-12-13 14:30:21 +0000 |
commit | 97572775d2fe088d8059b3a9423f6d8539fafe33 (patch) | |
tree | 634e93ae8cbc9e4d7691d65a864bc61dfe689026 /llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | |
parent | 56adcebfda84009b2825e69f71068685360abed7 (diff) | |
download | bcm5719-llvm-97572775d2fe088d8059b3a9423f6d8539fafe33.tar.gz bcm5719-llvm-97572775d2fe088d8059b3a9423f6d8539fafe33.zip |
Reland [DataLayout] Fix occurrences that size and range of pointers are assumed to be the same.
GEP index size can be specified in the DataLayout, introduced in D42123. However, there were still places
in which getIndexSizeInBits was used interchangeably with getPointerSizeInBits. This notably caused issues
with Instcombine's visitPtrToInt; but the unit tests was incorrect, so this remained undiscovered.
This fixes the buildbot failures.
Differential Revision: https://reviews.llvm.org/D68328
Patch by Joseph Faulls!
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index fd5a4682aa2..4abac988c2e 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -4930,7 +4930,7 @@ Instruction *InstCombiner::foldICmpUsingKnownBits(ICmpInst &I) { // Get scalar or pointer size. unsigned BitWidth = Ty->isIntOrIntVectorTy() ? Ty->getScalarSizeInBits() - : DL.getIndexTypeSizeInBits(Ty->getScalarType()); + : DL.getPointerTypeSizeInBits(Ty->getScalarType()); if (!BitWidth) return nullptr; |