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

Philip Reames via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 14 08:00:40 PST 2025


https://github.com/preames commented:

I don't think the heuristic here is quite what you want.  I believe this heuristic disables both of the following cases:
* BuildVector w/one non-zero non-undef element
* BuildVector w/one non-zero non-undef source, repeated 100 times (i.e. splat or select of two splats)

Disabling the former seems defensible, doing so for the second less so.  

Though honestly, I'm not sure of this change as a whole.  Having a single canonical form seems valuable here.  If the target isn't optimally lowering the splat or select of splat case in the shuffle lowering, maybe we should just adjust the target lowering to do so?

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


More information about the llvm-branch-commits mailing list