[llvm-dev] Extending SLP Vectorizer to deal with aggregates?
Robison, Arch via llvm-dev
llvm-dev at lists.llvm.org
Wed Oct 14 08:40:49 PDT 2015
I'm looking for a sanity check on extending SLP Vectorizer to deal with aggregates.
I'd like to vectorize Julia tuple operations. The Julia compiler lowers tuples to LLVM arrays, not LLVM vectors. I've tried making Julia lower tuples to LLVM vectors, but that hurt performance when SLP Vectorizer was not applicable, because of extraction/insertion overhead. I.e., the Julia lowering is too early to make the right choice on vector vs. array representation of tuples. So instead I'd like to make SLP Vectorizer vectorize idioms involving aggregates. A sample of the idiom is at https://gist.github.com/ArchRobison/e762cd55b8cfc0e019a3 .
1. Identify stores of arrays. E.g. "store [4 x float]".
2. Walk chains backwards from the array stores, similar to the way SLPVectorizer already walks chains.
3. If vectorization is applicable, replace array construction/load/store with vector construction/load/store. Vector load/stores will be unaligned.
Does this sound like a reasonable approach? If it sounds too Julia-specific, I could do it as a custom Julia pass.
- Arch D. Robison
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev