diff options
author | Alina Sbirlea <asbirlea@google.com> | 2016-07-28 21:35:20 +0000 |
---|---|---|
committer | Alina Sbirlea <asbirlea@google.com> | 2016-07-28 21:35:20 +0000 |
commit | 64acfb57bd614bd933d894379e3b7bf89bb45982 (patch) | |
tree | 061af3194e8d7a3323d2db457a52139e9a664b04 /llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp | |
parent | 7116eb6e16694c2d774e079a63b25fddb1b46c21 (diff) | |
download | bcm5719-llvm-64acfb57bd614bd933d894379e3b7bf89bb45982.tar.gz bcm5719-llvm-64acfb57bd614bd933d894379e3b7bf89bb45982.zip |
Revert r277038 until clearing why tests fail.
llvm-svn: 277039
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp index 3c7657bc433..0d6ae4c72fd 100644 --- a/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp @@ -40,8 +40,9 @@ STATISTIC(NumScalarsVectorized, "Number of scalar accesses vectorized"); namespace { -// FIXME: Assuming stack alignment of 4 is always good enough -static const unsigned StackAdjustedAlignment = 4; +// TODO: Remove this +static const unsigned TargetBaseAlign = 4; + typedef SmallVector<Instruction *, 8> InstrList; typedef MapVector<Value *, InstrList> InstrListMap; @@ -797,8 +798,8 @@ bool Vectorizer::vectorizeStoreChain( // so we can cheat and change it! Value *V = GetUnderlyingObject(S0->getPointerOperand(), DL); if (AllocaInst *AI = dyn_cast_or_null<AllocaInst>(V)) { - AI->setAlignment(StackAdjustedAlignment); - Alignment = StackAdjustedAlignment; + AI->setAlignment(TargetBaseAlign); + Alignment = TargetBaseAlign; } else { return false; } @@ -947,8 +948,8 @@ bool Vectorizer::vectorizeLoadChain( // so we can cheat and change it! Value *V = GetUnderlyingObject(L0->getPointerOperand(), DL); if (AllocaInst *AI = dyn_cast_or_null<AllocaInst>(V)) { - AI->setAlignment(StackAdjustedAlignment); - Alignment = StackAdjustedAlignment; + AI->setAlignment(TargetBaseAlign); + Alignment = TargetBaseAlign; } else { return false; } @@ -1028,10 +1029,10 @@ bool Vectorizer::vectorizeLoadChain( bool Vectorizer::accessIsMisaligned(unsigned SzInBytes, unsigned AddressSpace, unsigned Alignment) { - if (Alignment % SzInBytes == 0) - return false; bool Fast = false; bool Allows = TTI.allowsMisalignedMemoryAccesses(SzInBytes * 8, AddressSpace, Alignment, &Fast); - return !Allows || !Fast; + // TODO: Remove TargetBaseAlign + return !(Allows && Fast) && (Alignment % SzInBytes) != 0 && + (Alignment % TargetBaseAlign) != 0; } |