[SelectionDAG] Add an assert in getNode() for EXTRACT_VECTOR_ELT.
When getNode() is called to create an EXTRACT_VECTOR_ELT, assert that the result VT is at least as wide as the vector element type. Review: Eli Friedman llvm-svn: 324061
This commit is contained in:
parent
0e50b6ed80
commit
ad089fe46e
|
@ -4450,6 +4450,10 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
|
|||
break;
|
||||
}
|
||||
case ISD::EXTRACT_VECTOR_ELT:
|
||||
assert(VT.getSizeInBits() >= N1.getValueType().getScalarSizeInBits() &&
|
||||
"The result of EXTRACT_VECTOR_ELT must be at least as wide as the \
|
||||
element type of the vector.");
|
||||
|
||||
// EXTRACT_VECTOR_ELT of an UNDEF is an UNDEF.
|
||||
if (N1.isUndef())
|
||||
return getUNDEF(VT);
|
||||
|
|
Loading…
Reference in New Issue