diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-12-01 01:45:39 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-12-01 01:45:39 +0000 |
| commit | 09ed0ff2acce631d57f3f523302eeb9164e9d39d (patch) | |
| tree | 897d5986ea36d307f84610482b301a79789db49c /llvm/lib | |
| parent | f0371198ececeb9c3c8e27cfa5154c5bdeaaa077 (diff) | |
| download | bcm5719-llvm-09ed0ff2acce631d57f3f523302eeb9164e9d39d.tar.gz bcm5719-llvm-09ed0ff2acce631d57f3f523302eeb9164e9d39d.zip | |
Fix the CodeGen/PowerPC/vec_constants.ll regression.
llvm-svn: 32057
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 4df521aef46..d564ff7b688 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -1958,13 +1958,17 @@ static bool isConstantSplat(const uint64_t Bits128[2], 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 @@ static SDOperand BuildSplatI(int Val, unsigned SplatSize, MVT::ValueType VT, 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 |

