]> granicus.if.org Git - clang/commitdiff
Fix vector splat casts to cast element to the appropriate vector element before inser...
authorCraig Topper <craig.topper@gmail.com>
Mon, 6 Feb 2012 05:05:50 +0000 (05:05 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 6 Feb 2012 05:05:50 +0000 (05:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149855 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprScalar.cpp

index 1833a9083d6c83c94cd6b2318287757be003f23e..6f0d99f2f5f4617ead4ef8aea0fd6e82b8d07a05 100644 (file)
@@ -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);