[llvm] [RISCV][GISEL] instruction-select for G_SPLAT_VECTOR (PR #111193)
Michael Maitland via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 4 11:44:10 PDT 2024
michaelmaitland wrote:
@tobias-stadler @aemerson I am including you here since I think this patch relates back to #108991. Here is a case where lowering from G_SPLAT_VECTOR to G_VMV_V_X_VL or G_VFMV_V_F_VL needs to happen, but the question is where and how.
* We don't do this conversion in the legalizer so that the generic combiner can simplify G_SPLAT_VECTOR.
* We don't do this conversion in the post legalizer based on the conversation in #108991.
* So I put it in instruction select pre-isel-lower, similiar to what we do for SelectionDAG.
I was under the impression that we can introduce new generic instructions during instruction selection. It seems like the restriction is that we must call select on them. Here is a case that highlights the awkwardness of this. The big problem here is that the `VL` operand of the G_VMV_V_X_VL or G_VFMV_V_F_VL instructions cannot be selected before we select the RISCV instruction, otherwise it will break `renderVLOp`. So we have to awkwardly select instructions after the fact by remembering what we introduced.
It would be really nice for the InstructionSelector to know that instructions need to be selected after selecting the current instruction.
https://github.com/llvm/llvm-project/pull/111193
More information about the llvm-commits
mailing list