[llvm] [SPIR-V] Add implementation of G_SPLAT_VECTOR opcode and fix invalid types processing (PR #84766)

Vyacheslav Levytskyy via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 08:19:40 PDT 2024


VyacheslavLevytskyy wrote:

> #80378 G_SPLAT_VECTOR is only for scalable vectors. Does SPIR-V support scalable vectors?

Motivation to implement G_SPLAT_VECTOR is that SPIR-V Backend depends on code patterns created by GlobalISel. Where it was a G_BUILD_VECTOR before, now we see G_SPLAT_VECTOR. Both variants are semantically correct, whereas past pattern "<3 x ...> = G_BUILD_VECTOR %10,  %10,  %10" now is replaced by "<3 x ...> = G_SPLAT_VECTOR %10". According to https://llvm.org/docs/GlobalISel/GenericOpcode.html#g-splat-vector it creates "a vector where all elements are the scalar from the source operand", so does the current PR to avoid crashes on a new GlobalISel cod pattern.

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


More information about the llvm-commits mailing list