diff options
author | Duncan Sands <baldrick@free.fr> | 2009-04-18 20:16:54 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-04-18 20:16:54 +0000 |
commit | b10b5ac8d9da43ca2db61401a20af6b676c98438 (patch) | |
tree | 29d0c808adeb32fa9b508ee757582fc28b6e32de /lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp | |
parent | fa8ffc10b3edba947d20d5720435179054d8ba29 (diff) | |
download | external_llvm-b10b5ac8d9da43ca2db61401a20af6b676c98438.zip external_llvm-b10b5ac8d9da43ca2db61401a20af6b676c98438.tar.gz external_llvm-b10b5ac8d9da43ca2db61401a20af6b676c98438.tar.bz2 |
Don't try to make BUILD_VECTOR operands have the same
type as the vector element type: allow them to be of
a wider integer type than the element type all the way
through the system, and not just as far as LegalizeDAG.
This should be safe because it used to be this way
(the old type legalizer would produce such nodes), so
backends should be able to handle it. In fact only
targets which have legal vector types with an illegal
promoted element type will ever see this (eg: <4 x i16>
on ppc). This fixes a regression with the new type
legalizer (vec_splat.ll). Also, treat SCALAR_TO_VECTOR
the same as BUILD_VECTOR. After all, it is just a
special case of BUILD_VECTOR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp index f1d1f5b..7826270 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp @@ -347,6 +347,8 @@ SDValue DAGTypeLegalizer::ExpandOp_INSERT_VECTOR_ELT(SDNode *N) { SDValue DAGTypeLegalizer::ExpandOp_SCALAR_TO_VECTOR(SDNode *N) { DebugLoc dl = N->getDebugLoc(); MVT VT = N->getValueType(0); + assert(VT.getVectorElementType() == N->getOperand(0).getValueType() && + "SCALAR_TO_VECTOR operand type doesn't match vector element type!"); unsigned NumElts = VT.getVectorNumElements(); SmallVector<SDValue, 16> Ops(NumElts); Ops[0] = N->getOperand(0); |