diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2014-08-07 22:47:27 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2014-08-07 22:47:27 +0000 |
commit | 4fb3c474560d58c04fc6e27aef78a74c91a30d92 (patch) | |
tree | b6ecfda2f76646bdd47ff27b2a9392d2759162c8 /llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | |
parent | 03c67849d12e8c53a636e873cef669d89dcc95af (diff) | |
download | bcm5719-llvm-4fb3c474560d58c04fc6e27aef78a74c91a30d92.tar.gz bcm5719-llvm-4fb3c474560d58c04fc6e27aef78a74c91a30d92.zip |
SLPVectorizer: Use the type of the value loaded/stored to get the ABI alignment
We were using the pointer type which is incorrect.
llvm-svn: 215162
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index d73e746d1ea..9fea4450a10 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -1990,6 +1990,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) { setInsertPointAfterBundle(E->Scalars); LoadInst *LI = cast<LoadInst>(VL0); + Type *ScalarLoadTy = LI->getType(); unsigned AS = LI->getPointerAddressSpace(); Value *VecPtr = Builder.CreateBitCast(LI->getPointerOperand(), @@ -1997,7 +1998,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) { unsigned Alignment = LI->getAlignment(); LI = Builder.CreateLoad(VecPtr); if (!Alignment) - Alignment = DL->getABITypeAlignment(LI->getPointerOperand()->getType()); + Alignment = DL->getABITypeAlignment(ScalarLoadTy); LI->setAlignment(Alignment); E->VectorizedValue = LI; ++NumVectorInstructions; @@ -2019,7 +2020,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) { VecTy->getPointerTo(AS)); StoreInst *S = Builder.CreateStore(VecValue, VecPtr); if (!Alignment) - Alignment = DL->getABITypeAlignment(SI->getPointerOperand()->getType()); + Alignment = DL->getABITypeAlignment(SI->getValueOperand()->getType()); S->setAlignment(Alignment); E->VectorizedValue = S; ++NumVectorInstructions; |