diff options
Diffstat (limited to 'lib/Transforms/Scalar/SROA.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SROA.cpp | 8 |
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")); |