[llvm] [SLP]Vectorize gathered loads (PR #107461)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 03:44:50 PDT 2024


alexey-bataev wrote:

> A couple of minors - but its not an easy patch to review tbh!

Yep, I understand, actually already split the patch into several pieces.

The idea behind this one is pretty simple. Final gather/buildvector nodes may have scalar loads, which are not vectorized (since they are part of the gather nodes) but may form full vector loads, being combined. This patch walks over all gather nodes, "gathering" and sorting gathered scalar loads and then tries to build vector loads, which later are reshuffled between the gather nodes. As I said in the description, it allows later to add support for segmented loads (kind of AOS to SOA load kind for RISC-V RVV) and may help with the removal of the alternate opcodes support.
Currently, alternate nodes may depend on each other because of the consecutive loads between their operands. Because of that we cannot simply remove alternate vectorization. But this approach may help to remove most of the stuff for it, since we'll be able to vectorize loads in between 

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


More information about the llvm-commits mailing list