Select G_INSERT_VECTOR_ELT when insert index is defined with G_CONSTANT,
and can be folded like an immediate, for MIPS32 with MSA.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
When I apply this match to the master branch I get a couple of failed tests:
- CodeGen/Mips/GlobalISel/legalizer/insert_vector_elt_imm_index.mir
- CodeGen/Mips/GlobalISel/llvm-ir/insert_vector_elt_imm_index.ll
LLVM ERROR: unable to legalize instruction: %8:_(<16 x s32>) = G_INSERT_VECTOR_ELT %6:_, %7:_(s32), %5:_(s32) (in function: insert_i8)
Are there any other patches need to be applied first?
Comment Actions
D69513 goes first, following what SDAG does
%8:_(<16 x s8>) = G_INSERT_VECTOR_ELT %6:_, %7:_(s8), %5:_(s32)
should change only insert elt scalar type, and leave vector scalar type as is
%8:_(<16 x s8>) = G_INSERT_VECTOR_ELT %6:_, %7:_(s32), %5:_(s32) (in function: insert_i8)
insert instruction is selected based on vector type, inserted scalar is always i32 (i32 or i64 for mips64)