[llvm] [RISCV][GISEL] Add IRTranslation for shufflevector on scalable vector types (PR #80378)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 05:46:30 PST 2024


michaelmaitland wrote:

> SelectionDAG doesn't support ISD::SHUFFLEVECTOR for scalable vectors. It only supports ISD::SPLAT_VECTOR. Are we trying to do something different for GISel for some reason?

I intend to write a patch after this that combines g_insert_element + g_shuffle_vector into g_splat_vector where appropriate. For scalable vectors, that is in all cases since the mask index vector is always zeroinit (undef case can be treated as zeroinit). 

I thought there is a case where fixed vectors can generate a non-splat vector which is why we kept the opcode. But I will defer to someone who knows more about this to answer why it’s currently different than SDAG. 

https://github.com/llvm/llvm-project/pull/80378


More information about the llvm-commits mailing list