llvm.org GIT mirror llvm / a49df17
[SelectionDAG] Add asserts to verify the vectorness of input and output types of TRUNCATE/ZERO_EXTEND/ANY_EXTEND/SIGN_EXTEND agree As a result of the underlying cause of PR41678 we created an ANY_EXTEND node with a scalar result type and v1i1 input type. Ideally we would have asserted for this instead of letting it go through to instruction selection and generate bad machine IR Differential Revision: https://reviews.llvm.org/D61463 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359836 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 1 year, 4 months ago
1 changed file(s) with 12 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
43384338 case ISD::SIGN_EXTEND:
43394339 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
43404340 "Invalid SIGN_EXTEND!");
4341 assert(VT.isVector() == Operand.getValueType().isVector() &&
4342 "SIGN_EXTEND result type type should be vector iff the operand "
4343 "type is vector!");
43414344 if (Operand.getValueType() == VT) return Operand; // noop extension
43424345 assert((!VT.isVector() ||
43434346 VT.getVectorNumElements() ==
43544357 case ISD::ZERO_EXTEND:
43554358 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
43564359 "Invalid ZERO_EXTEND!");
4360 assert(VT.isVector() == Operand.getValueType().isVector() &&
4361 "ZERO_EXTEND result type type should be vector iff the operand "
4362 "type is vector!");
43574363 if (Operand.getValueType() == VT) return Operand; // noop extension
43584364 assert((!VT.isVector() ||
43594365 VT.getVectorNumElements() ==
43704376 case ISD::ANY_EXTEND:
43714377 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
43724378 "Invalid ANY_EXTEND!");
4379 assert(VT.isVector() == Operand.getValueType().isVector() &&
4380 "ANY_EXTEND result type type should be vector iff the operand "
4381 "type is vector!");
43734382 if (Operand.getValueType() == VT) return Operand; // noop extension
43744383 assert((!VT.isVector() ||
43754384 VT.getVectorNumElements() ==
43974406 case ISD::TRUNCATE:
43984407 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
43994408 "Invalid TRUNCATE!");
4409 assert(VT.isVector() == Operand.getValueType().isVector() &&
4410 "TRUNCATE result type type should be vector iff the operand "
4411 "type is vector!");
44004412 if (Operand.getValueType() == VT) return Operand; // noop truncate
44014413 assert((!VT.isVector() ||
44024414 VT.getVectorNumElements() ==