diff options
author | Craig Topper <craig.topper@gmail.com> | 2012-02-06 05:05:50 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2012-02-06 05:05:50 +0000 |
commit | 5b5935d17db2d9b27b99d89f702986d8b9247a96 (patch) | |
tree | 513b6bef7cd6c4784075ef4ce63907dc30154c9a /clang | |
parent | 574e896976d65d72b7f0f275a4d88bac7e4225d0 (diff) | |
download | bcm5719-llvm-5b5935d17db2d9b27b99d89f702986d8b9247a96.tar.gz bcm5719-llvm-5b5935d17db2d9b27b99d89f702986d8b9247a96.zip |
Fix vector splat casts to cast element to the appropriate vector element before inserting into the vector. Fixes PR11930.
llvm-svn: 149855
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 1833a9083d6..6f0d99f2f5f 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -1190,6 +1190,8 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { case CK_VectorSplat: { llvm::Type *DstTy = ConvertType(DestTy); Value *Elt = Visit(const_cast<Expr*>(E)); + Elt = EmitScalarConversion(Elt, E->getType(), + DestTy->getAs<VectorType>()->getElementType()); // Insert the element in element zero of an undef vector llvm::Value *UnV = llvm::UndefValue::get(DstTy); |