OSDN Git Service

[SLPVectorizer] Failure to beneficially vectorize 'copyable' elements in integer...
authorDinar Temirbulatov <dtemirbulatov@gmail.com>
Fri, 15 Sep 2017 06:56:39 +0000 (06:56 +0000)
committerDinar Temirbulatov <dtemirbulatov@gmail.com>
Fri, 15 Sep 2017 06:56:39 +0000 (06:56 +0000)
commit1dc1d99a0e750efd342c5aaa9837c800de409e6c
treeae3c34587df79f0374bf0364ce10fb8fa414d43d
parent72e6ac3761d42f780c7d1e31447954f0b5c784f7
[SLPVectorizer] Failure to beneficially vectorize 'copyable' elements in integer binary ops.

Patch tries to improve vectorization of the following code:

void add1(int * __restrict dst, const int * __restrict src) {
  *dst++ = *src++;
  *dst++ = *src++ + 1;
  *dst++ = *src++ + 2;
  *dst++ = *src++ + 3;
}
Allows to vectorize even if the very first operation is not a binary add, but just a load.

Reviewers: spatel, mzolotukhin, mkuper, hfinkel, RKSimon, filcab, ABataev, davide

Subscribers: llvm-commits, RKSimon

Differential Revision: https://reviews.llvm.org/D28907

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313348 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/X86/vect_copyable_in_binops.ll