This patch adds the two MVTs to fix a legalizer crash when using vector
shuffles of <256 x i16> and <128 x i16> on RISC-V. The legalizer can't
promote the operand of v256i32 = any_extend_vector_inreg v128i16.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This does feel like an imbalance in the legal RISCV vector types. Is it really worth adding another legalization case rather than just adding more simple vector types or making v256i32 illegal?
Yeah it's definitely an imbalance. I've been thinking that we need to round out the legal RVV vector types to an agreed-upon max vector length, like 512 or 1024 bytes.
But then again this is a crash in LLVM where there shouldn't be one, so I was kind of assuming that we'd do both. The downside, though, is that we might not have enough test cases to prevent regressions in this legalizer case.
If I had to choose one, I'd add more MVTs up to 512B/1024B depending on what people generally see as a useful maximum. I'm willing to go with the majority.
Okay, sounds like that's the way to go, thanks. It's a shame we don't have a way of testing the various legalizers without a suitable target.
llvm/include/llvm/CodeGen/ValueTypes.td | ||
---|---|---|
185 ↗ | (On Diff #342745) | Should we add blank lines between different element widths here too? |
- add blank lines between scalable-vector elt tys
llvm/include/llvm/CodeGen/ValueTypes.td | ||
---|---|---|
185 ↗ | (On Diff #342745) | Ah yeah I missed that one, thanks! |
clang-tidy: warning: invalid case style for function 'PromoteIntOp_EXTEND_VECTOR_INREG' [readability-identifier-naming]
not useful