summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
diff options
context:
space:
mode:
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2019-08-01 22:18:56 +0000
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2019-08-01 22:18:56 +0000
commiteee9312a85c020f90beb186fe95835e36ae8ce1c (patch)
tree7d31ae2f30d7052c4e0bea84cf4507ca9fb0ec8d /llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
parentac7e5788ca03dac225fd92ac937593454bd36d21 (diff)
downloadbcm5719-llvm-eee9312a85c020f90beb186fe95835e36ae8ce1c.tar.gz
bcm5719-llvm-eee9312a85c020f90beb186fe95835e36ae8ce1c.zip
Relax load store vectorizer pointer strip checks
The previous change to fix crash in the vectorizer introduced performance regressions. The condition to preserve pointer address space during the search is too tight, we only need to match the size. Differential Revision: https://reviews.llvm.org/D65600 llvm-svn: 367624
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
index f799a45f567..19afe4157dc 100644
--- a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
@@ -339,14 +339,13 @@ bool Vectorizer::areConsecutivePointers(Value *PtrA, Value *PtrB,
const APInt &PtrDelta,
unsigned Depth) const {
unsigned PtrBitWidth = DL.getPointerTypeSizeInBits(PtrA->getType());
- unsigned PtrAS = PtrA->getType()->getPointerAddressSpace();
APInt OffsetA(PtrBitWidth, 0);
APInt OffsetB(PtrBitWidth, 0);
PtrA = PtrA->stripAndAccumulateInBoundsConstantOffsets(DL, OffsetA);
PtrB = PtrB->stripAndAccumulateInBoundsConstantOffsets(DL, OffsetB);
- if (PtrA->getType()->getPointerAddressSpace() != PtrAS ||
- PtrB->getType()->getPointerAddressSpace() != PtrAS)
+ if (DL.getTypeStoreSizeInBits(PtrA->getType()) != PtrBitWidth ||
+ DL.getTypeStoreSizeInBits(PtrB->getType()) != PtrBitWidth)
return false;
APInt OffsetDelta = OffsetB - OffsetA;
OpenPOWER on IntegriCloud