[llvm-branch-commits] [llvm] DAG: Avoid forming shufflevector from a single extract_vector_elt (PR #122672)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 14 09:18:12 PST 2025


arsenm wrote:

> Isn't the condition in code in terms of VecIn.size() == 2? I believe that VecIn is the _unique_ input elements, right? Which is distinct from the number of elements in the destination type? (Am I just misreading? I only skimmed this.)

VecIn is collecting only extract_vector_elts feeding the build_vector. So it's true it's not only a 2 element vector, in general (but the standard case of building a complete vector is 2 elements). The other skipped elements are all constant or undef.

A 2 element shuffle just happens to the only case I care about which I'm trying to make legal (and really only the odd -> even case is of any use). 



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


More information about the llvm-branch-commits mailing list