http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60510
Bug ID: 60510
Summary: SLP blocks loop vectorization (with reduction)
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: kirill.yukhin at intel dot com
Hello,
This case is not vectorized:
$ cat f2.f
subroutine foo(a,x,y,n)
implicit none
integer n,i
real*8 y(n),x(n),a
do i=1,n
a=a+x(i)*y(i)+x(i)
enddo
return
end
When `+x(i)` removed, vectorization passes.
Compilation: ./build-x86_64-linux/gcc/gfortran -B./build-x86_64-linux/gcc -S
-Ofast -mavx2 f2.f -fno-unroll-loops -fdump-tree-vect-all
vect report says:
f2.f:7:0: note: type of def: 3.
f2.f:7:0: note: vect_is_simple_use: operand _13
f2.f:7:0: note: def_stmt: _13 = _12 + prephitmp_32;
f2.f:7:0: note: type of def: 3.
f2.f:7:0: note: Build SLP for # VUSE <.MEM_2>
_12 = *x_11(D)[_10];
f2.f:7:0: note: Build SLP failed: not grouped load # VUSE <.MEM_2>
_12 = *x_11(D)[_10];