llvm-project/llvm/test/Transforms/SLPVectorizer
Alexey Bataev 2a2f35d59c [SLP] Fix for PR31879: vectorize repeated scalar ops that don't get put
back into a vector

Previously the cost of the existing ExtractElement/ExtractValue
instructions was considered as a dead cost only if it was detected that
they have only one use. But these instructions may be considered
dead also if users of the instructions are also going to be vectorized,
like:
```
%x0 = extractelement <2 x float> %x, i32 0
%x1 = extractelement <2 x float> %x, i32 1
%x0x0 = fmul float %x0, %x0
%x1x1 = fmul float %x1, %x1
%add = fadd float %x0x0, %x1x1
```
This can be transformed to
```
%1 = fmul <2 x float> %x, %x
%2 = extractelement <2 x float> %1, i32 0
%3 = extractelement <2 x float> %1, i32 1
%add = fadd float %2, %3
```
because though `%x0` and `%x1` have 2 users each other, these users are
part of the vectorized tree and we can consider these `extractelement`
instructions as dead.

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

llvm-svn: 295056
2017-02-14 15:20:48 +00:00
..
AArch64 [SLP] Avoid signed integer overflow 2016-08-23 20:48:50 +00:00
AMDGPU [SLPVectorizer] Try different vectorization factors for store chains 2015-07-08 23:40:55 +00:00
ARM
PowerPC [SLP] Pass in correct alignment when query memory access cost 2016-05-31 20:41:19 +00:00
X86 [SLP] Fix for PR31879: vectorize repeated scalar ops that don't get put 2017-02-14 15:20:48 +00:00
XCore