aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/SROA.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-17 14:03:01 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-17 14:03:01 +0000
commit8bbff2348d378192b332db38394498d83ed4feeb (patch)
tree8f45e6b62c9f5f50c1452079c9522dcd6889ac55 /lib/Transforms/Scalar/SROA.cpp
parent6e43b7f6b20b39b041cf24d732ddb802bbd6471a (diff)
downloadexternal_llvm-8bbff2348d378192b332db38394498d83ed4feeb.zip
external_llvm-8bbff2348d378192b332db38394498d83ed4feeb.tar.gz
external_llvm-8bbff2348d378192b332db38394498d83ed4feeb.tar.bz2
Fix a secondary bug I introduced while fixing the first part of PR14478.
The first half of fixing this bug was actually in r170328, but was entirely coincidental. It did however get me to realize the nature of the bug, and adapt the test case to test more interesting behavior. In turn, that uncovered the rest of the bug which I've fixed here. This should fix two new asserts that showed up in the vectorize nightly tester. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SROA.cpp')
-rw-r--r--lib/Transforms/Scalar/SROA.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp
index ef16f46..1ac239e 100644
--- a/lib/Transforms/Scalar/SROA.cpp
+++ b/lib/Transforms/Scalar/SROA.cpp
@@ -2777,14 +2777,10 @@ private:
Value *Splat = getIntegerSplat(IRB, II.getValue(),
TD.getTypeSizeInBits(ElementTy)/8);
- if (NumElements > 1) {
+ Splat = convertValue(TD, IRB, Splat, ElementTy);
+ if (NumElements > 1)
Splat = getVectorSplat(IRB, Splat, NumElements);
- Type *SplatVecTy = VectorType::get(ElementTy, NumElements);
- if (Splat->getType() != SplatVecTy)
- Splat = convertValue(TD, IRB, Splat, SplatVecTy);
- }
-
Value *Old = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
getName(".oldload"));
V = insertVector(IRB, Old, Splat, BeginIndex, getName(".vec"));