aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-07-09 18:55:10 +0000
committerHal Finkel <hfinkel@anl.gov>2013-07-09 18:55:10 +0000
commitb9c8c40acbe120ebf44d2a81382ceee100bcd331 (patch)
treec0c5476392e8c6b7b41750a3cb287f4c67aa7956 /lib
parent7c2d8f7b5ea1d0abaed1176f87ea2509e65e82be (diff)
downloadexternal_llvm-b9c8c40acbe120ebf44d2a81382ceee100bcd331.zip
external_llvm-b9c8c40acbe120ebf44d2a81382ceee100bcd331.tar.gz
external_llvm-b9c8c40acbe120ebf44d2a81382ceee100bcd331.tar.bz2
WidenVecRes_BUILD_VECTOR must use the first operand's type
Because integer BUILD_VECTOR operands may have a larger type than the result's vector element type, and all operands must have the same type, when widening a BUILD_VECTOR node by adding UNDEFs, we cannot use the vector element type, but rather must use the type of the existing operands. Another bug found by llvm-stress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 2a5d721..2cd59ac 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -1872,7 +1872,10 @@ SDValue DAGTypeLegalizer::WidenVecRes_BUILD_VECTOR(SDNode *N) {
SDLoc dl(N);
// Build a vector with undefined for the new nodes.
EVT VT = N->getValueType(0);
- EVT EltVT = VT.getVectorElementType();
+
+ // Integer BUILD_VECTOR operands may be larger than the node's vector element
+ // type. The UNDEFs need to have the same type as the existing operands.
+ EVT EltVT = N->getOperand(0).getValueType();
unsigned NumElts = VT.getVectorNumElements();
EVT WidenVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);