| Issue |
171608
|
| Summary |
[CodeGen] EVT::changeVectorElementType can't handle conversion from simple to extended vector types
|
| Labels |
good first issue,
llvm:SelectionDAG
|
| Assignees |
|
| Reporter |
RKSimon
|
As discussed here: https://github.com/llvm/llvm-project/pull/171459#discussion_r2606039181
https://github.com/llvm/llvm-project/blob/578a26ada2e51e90733b50d048b0d74ac48ab21c/llvm/include/llvm/CodeGen/ValueTypes.h#L100-L109
The problem is if the original vector was simple (e.g. v512i32) - but you change it to one that isn't (e.g. v512i64) - MVT::changeVectorElementType is called and will assert internally:
https://github.com/llvm/llvm-project/blob/578a26ada2e51e90733b50d048b0d74ac48ab21c/llvm/include/llvm/CodeGenTypes/MachineValueType.h#L211-L218
Ideally we'd do something similar to EVT::getVectorVT, check for MVT::INVALID_SIMPLE_VALUE_TYPE and fallback to changeExtendedVectorElementType if necessary.
This would then allow quite a few EVT::getVectorVT uses in DAGCombine etc. to be simplified to call EVT::changeElementType or EVT::changeVectorElementType directly without fear of an assert
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs