summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorJingyue Wu <jingyue@google.com>2016-07-11 18:13:28 +0000
committerJingyue Wu <jingyue@google.com>2016-07-11 18:13:28 +0000
commit641cfee9769afe7e0ff3f0dad12bf7d383687760 (patch)
tree05d3dd711a13e077cf439c529e1a36f517a3ef60 /llvm/lib/Transforms
parente8ae0b5eb48e15ffb7524ce68b76971e313d53ad (diff)
downloadbcm5719-llvm-641cfee9769afe7e0ff3f0dad12bf7d383687760.tar.gz
bcm5719-llvm-641cfee9769afe7e0ff3f0dad12bf7d383687760.zip
[SLSR] Call getPointerSizeInBits with the correct address space.
llvm-svn: 275083
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
index 77f0a78b928..292d0400a51 100644
--- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
@@ -505,7 +505,7 @@ void StraightLineStrengthReduce::allocateCandidatesAndFindBasisForGEP(
Value *ArrayIdx = GEP->getOperand(I);
uint64_t ElementSize = DL->getTypeAllocSize(*GTI);
if (ArrayIdx->getType()->getIntegerBitWidth() <=
- DL->getPointerSizeInBits()) {
+ DL->getPointerSizeInBits(GEP->getAddressSpace())) {
// Skip factoring if ArrayIdx is wider than the pointer size, because
// ArrayIdx is implicitly truncated to the pointer size.
factorArrayIndex(ArrayIdx, BaseExpr, ElementSize, GEP);
@@ -516,7 +516,7 @@ void StraightLineStrengthReduce::allocateCandidatesAndFindBasisForGEP(
Value *TruncatedArrayIdx = nullptr;
if (match(ArrayIdx, m_SExt(m_Value(TruncatedArrayIdx))) &&
TruncatedArrayIdx->getType()->getIntegerBitWidth() <=
- DL->getPointerSizeInBits()) {
+ DL->getPointerSizeInBits(GEP->getAddressSpace())) {
// Skip factoring if TruncatedArrayIdx is wider than the pointer size,
// because TruncatedArrayIdx is implicitly truncated to the pointer size.
factorArrayIndex(TruncatedArrayIdx, BaseExpr, ElementSize, GEP);
OpenPOWER on IntegriCloud