[PATCH] D27919: [Loop Vectorizer] Interleave vs Gather - in some cases Gather is better.

Elena Demikhovsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 07:10:43 PST 2016


delena created this revision.
delena added reviewers: mkuper, Ayal, anemet.
delena added a subscriber: llvm-commits.
delena set the repository for this revision to rL LLVM.
Herald added a subscriber: mzolotukhin.

The bug is described in PR31426.
The cost of Load instruction is calculated in the following order isConsecultive - isInterleave - isGather - scalar.
When a Load instruction belongs to Interleave group, the "Gather" option is not checked at all. But when the interleave factor exceeds the maximum, the cost is high and the "Gather" is preferred in this case. The following loop is not vectorized on AVX-512 due to this bug:
for (i=0; i<N; ++i)

  B[i] = A[i*5]


Repository:
  rL LLVM

https://reviews.llvm.org/D27919

Files:
  ../../ver4/lib/Transforms/Vectorize/LoopVectorize.cpp
  ../../ver4/test/Transforms/LoopVectorize/X86/gather-vs-interleave.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27919.81947.patch
Type: text/x-patch
Size: 5888 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161219/22b42481/attachment.bin>


More information about the llvm-commits mailing list