[cfe-commits] r149855 - /cfe/trunk/lib/CodeGen/CGExprScalar.cpp
Craig Topper
craig.topper at gmail.com
Sun Feb 5 21:05:50 PST 2012
Author: ctopper
Date: Sun Feb 5 23:05:50 2012
New Revision: 149855
URL: http://llvm.org/viewvc/llvm-project?rev=149855&view=rev
Log:
Fix vector splat casts to cast element to the appropriate vector element before inserting into the vector. Fixes PR11930.
Modified:
cfe/trunk/lib/CodeGen/CGExprScalar.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=149855&r1=149854&r2=149855&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Sun Feb 5 23:05:50 2012
@@ -1190,6 +1190,8 @@
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);
More information about the cfe-commits
mailing list