[llvm] [RISCV][WIP] Improve lowering for generic two operand shuffle (PR #187048)

Ryan Buchner via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 19:56:54 PDT 2026


bababuck wrote:

> In general, this is an interesting idea, but the problem is that it breaks all pattern specific matching during the recursion step. In concept, we'd like to only use the original mask if we do the recursion and find that we end up generating a vrgather after all. (p.s. I think this likely explains all your failures.)

That makes sense. I tried to exclude optimizable cases with `if (!DAG.isSplatValue(V2) && !DAG.isSplatValue(V1) && ...` but wasn't enough. 

>All of the above seem non-trivial; I might start with exploring 3 as it seems useful for other purposes. Maybe bring this to a RISC-V sync up and we can discuss and get others opinions?

Thanks for providing guidance, 3 seems to make the most sense to me as well, I'm interested to see if/what other cases it hits. I'll see if I can get this slotted into the agenda for this week's meeting before working further on this.


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


More information about the llvm-commits mailing list