[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Chris Lattner sabre at nondot.org
Thu Nov 30 17:45:54 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCISelLowering.cpp updated: 1.237 -> 1.238
---
Log message:

Fix the CodeGen/PowerPC/vec_constants.ll regression.


---
Diffs of the changes:  (+9 -6)

 PPCISelLowering.cpp |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.237 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.238
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.237	Wed Nov 29 13:58:49 2006
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Thu Nov 30 19:45:39 2006
@@ -1958,13 +1958,17 @@
 static SDOperand BuildSplatI(int Val, unsigned SplatSize, MVT::ValueType VT,
                              SelectionDAG &DAG) {
   assert(Val >= -16 && Val <= 15 && "vsplti is out of range!");
-  
-  // Force vspltis[hw] -1 to vspltisb -1.
-  if (Val == -1) SplatSize = 1;
-  
+
   static const MVT::ValueType VTys[] = { // canonical VT to use for each size.
     MVT::v16i8, MVT::v8i16, MVT::Other, MVT::v4i32
   };
+
+  MVT::ValueType ReqVT = VT != MVT::Other ? VT : VTys[SplatSize-1];
+  
+  // Force vspltis[hw] -1 to vspltisb -1 to canonicalize.
+  if (Val == -1)
+    SplatSize = 1;
+  
   MVT::ValueType CanonicalVT = VTys[SplatSize-1];
   
   // Build a canonical splat for this value.
@@ -1973,8 +1977,7 @@
   Ops.assign(MVT::getVectorNumElements(CanonicalVT), Elt);
   SDOperand Res = DAG.getNode(ISD::BUILD_VECTOR, CanonicalVT,
                               &Ops[0], Ops.size());
-  if (VT == MVT::Other) return Res;
-  return DAG.getNode(ISD::BIT_CONVERT, VT, Res);
+  return DAG.getNode(ISD::BIT_CONVERT, ReqVT, Res);
 }
 
 /// BuildIntrinsicOp - Return a binary operator intrinsic node with the






More information about the llvm-commits mailing list