[llvm] r277039 - Revert r277038 until clearing why tests fail.
Alina Sbirlea via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 28 14:35:21 PDT 2016
Author: asbirlea
Date: Thu Jul 28 16:35:20 2016
New Revision: 277039
URL: http://llvm.org/viewvc/llvm-project?rev=277039&view=rev
Log:
Revert r277038 until clearing why tests fail.
Modified:
llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp?rev=277039&r1=277038&r2=277039&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp Thu Jul 28 16:35:20 2016
@@ -40,8 +40,9 @@ STATISTIC(NumScalarsVectorized, "Number
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;
}
More information about the llvm-commits
mailing list