5 ms·
No, compilers may be able to vectorize basic loops, but they won't for example turn four adjacent additions into a vector addition.
by exDM69 3y ago
No, compilers may be able to vectorize basic loops, but they won't for example turn four adjacent additions into a vector addition.
- JonChesterfield 3y agoThere's (at least) two vectorisers in LLVM. One does loops, the other acts on basic blocks. https://llvm.org/docs/Vectorizers.html#the-slp-vectorizer https://llvm.org/docs/Vectorizers.html#the-slp-vectorizer. Both really like alignment metadata on pointers. They certainly have limitations but the hit rate is reasonably good.