If VecVT is an LMUL=8 VT, we can't concatenate the vectors as that
would create an illegal type. Instead we need to split the vectors
and emit two VECTOR_INTERLEAVE operations that can each be lowered.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
7715 | Whist is the reason that we don't expand LMUL=8 VECTOR_INTERLEAVE? I think DAGTypeLegalizer::SplitVecRes_VECTOR_DEINTERLEAVE does the same job. |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
7715 | The ISD::VECTOR_INTERLEAVE node takes 2 inputs and produces 2 results with the same number of elements. This is different than IR where it's 2 inputs and 1 result with 2 twice as many elements. The test cases that crash started in IR as interleaving 2 MUL=8 types to produce a LMUL=16 result. In SelectionDAG this is represented as 2 LMUL=8 inputs and 2 LMUL=8 outputs. Type legalization only sees the LMUL=8 types so all the types looks legal. The RISC-V lowering code concatenates the 2 LMUL=8 values into an LMUL=16 type which crashes because that isn't a legal type. This patch splits the inputs into LMUL=4 pieces and creates to INTERLEAVE operations. When each of the INTERLEAVE operations is then lowered the concatenation will only produce an LMUL=8 type. |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
7715 | Thank you. I misunderstood this. |
Whist is the reason that we don't expand LMUL=8 VECTOR_INTERLEAVE? I think DAGTypeLegalizer::SplitVecRes_VECTOR_DEINTERLEAVE does the same job.