llvm.org GIT mirror llvm / ad445a6
Change asserts at the top of getVectorShuffle to check that LHS and RHS have the same type as the result. Previously the asserts were only checking that RHS and LHS were the same type and had the same element type as the result. All downstream code for ISD::VECTOR_SHUFFLE requires the types to be the same. Also removed one unnecessary check of matched element counts that was present in the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188051 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 6 years ago
1 changed file(s) with 3 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
12971297
12981298 SDValue SelectionDAG::getVectorShuffle(EVT VT, SDLoc dl, SDValue N1,
12991299 SDValue N2, const int *Mask) {
1300 assert(N1.getValueType() == N2.getValueType() && "Invalid VECTOR_SHUFFLE");
1301 assert(VT.isVector() && N1.getValueType().isVector() &&
1302 "Vector Shuffle VTs must be a vectors");
1303 assert(VT.getVectorElementType() == N1.getValueType().getVectorElementType()
1304 && "Vector Shuffle VTs must have same element type");
1300 assert(VT == N1.getValueType() && VT == N2.getValueType() &&
1301 "Invalid VECTOR_SHUFFLE");
13051302
13061303 // Canonicalize shuffle undef, undef -> undef
13071304 if (N1.getOpcode() == ISD::UNDEF && N2.getOpcode() == ISD::UNDEF)
13551352 for (unsigned i = 0; i != NElts; ++i) {
13561353 if (MaskVec[i] >= 0 && MaskVec[i] != (int)i) Identity = false;
13571354 }
1358 if (Identity && NElts == N1.getValueType().getVectorNumElements())
1355 if (Identity && NElts)
13591356 return N1;
13601357
13611358 FoldingSetNodeID ID;