When expanding a vector_shuffle, the element type may not be legal and may
authorBob Wilson <bob.wilson@apple.com>
Wed, 19 May 2010 18:48:32 +0000 (18:48 +0000)
committerBob Wilson <bob.wilson@apple.com>
Wed, 19 May 2010 18:48:32 +0000 (18:48 +0000)
need to be promoted.  The BUILD_VECTOR and EXTRACT_VECTOR_ELT nodes generated
here already allow the promoted type to be used without further changes, so
just do the promotion.  This fixes part of pr7167.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104141 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 5d69bf8f379594e06ff0c678cadd2804eb54de2b..62a37a5fd0aeeccdbc18ed4b4d2dfc650066b731 100644 (file)
@@ -2523,6 +2523,8 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node,
 
     EVT VT = Node->getValueType(0);
     EVT EltVT = VT.getVectorElementType();
+    if (getTypeAction(EltVT) == Promote)
+      EltVT = TLI.getTypeToTransformTo(*DAG.getContext(), EltVT);
     unsigned NumElems = VT.getVectorNumElements();
     SmallVector<SDValue, 8> Ops;
     for (unsigned i = 0; i != NumElems; ++i) {