New C code snippet is more viable for SLP vectorization in most architectures.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/docs/Vectorizers.rst | ||
---|---|---|
421–424 | I understand that integer division is a poor example for vectorization because most targets can't handle it. |
llvm/docs/Vectorizers.rst | ||
---|---|---|
421–424 | I was biased by AVX2 in my example (4 longs fits a ymm register) but agree that 'int' is less intrusive and more generic for the proposed code snippet. I will change it. |
LGTM - this is definitely better than division, but it might be better yet to have a simpler example and show how it translates to IR.
@spatel please commit this change on my behalf. This is my first patch and I still do not have write access to the repo. Thanks
I understand that integer division is a poor example for vectorization because most targets can't handle it.
But what is the intent of changing 'int' to 'long' in this example? That change appears to prevent vectorization (for most x86 targets at least).