Make SelectionDAG::getVectorShuffle work properly for VECTOR_SHUFFLE

nodes with operand types that differ from the result type. (This
doesn't normally happen right now, because
SelectionDAGLowering::visitShuffleVector normalizes vector shuffles.)

llvm-svn: 75081
This commit is contained in:
Dan Gohman 2009-07-09 00:46:33 +00:00
parent 031c5fec43
commit 6b04136756
1 changed files with 2 additions and 2 deletions

View File

@ -1187,7 +1187,7 @@ SDValue SelectionDAG::getVectorShuffle(MVT VT, DebugLoc dl, SDValue N1,
// Canonicalize shuffle undef, undef -> undef
if (N1.getOpcode() == ISD::UNDEF && N2.getOpcode() == ISD::UNDEF)
return N1;
return getUNDEF(VT);
// Validate that all indices in Mask are within the range of the elements
// input to the shuffle.
@ -1239,7 +1239,7 @@ SDValue SelectionDAG::getVectorShuffle(MVT VT, DebugLoc dl, SDValue N1,
if (MaskVec[i] >= 0 && MaskVec[i] != (int)i) Identity = false;
if (MaskVec[i] >= 0) AllUndef = false;
}
if (Identity)
if (Identity && NElts == N1.getValueType().getVectorNumElements())
return N1;
if (AllUndef)
return getUNDEF(VT);