re PR tree-optimization/37021 (Fortran Complex reduction / multiplication not vectorized)

2013-03-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/37021
	* tree-vect-data-refs.c (vect_check_strided_load): Allow
	REALPART/IMAGPART_EXPRs around the supported refs.
	* tree-ssa-structalias.c (find_func_aliases): Assume that
	floating-point values are not used to transfer pointers.

	* gfortran.dg/vect/fast-math-pr37021.f90: New testcase.

From-SVN: r197158
This commit is contained in:
Richard Biener 2013-03-27 10:38:29 +00:00 committed by Richard Biener
parent 173536ed5f
commit 7d24f650fa
5 changed files with 39 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2013-03-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/37021
* tree-vect-data-refs.c (vect_check_strided_load): Allow
REALPART/IMAGPART_EXPRs around the supported refs.
* tree-ssa-structalias.c (find_func_aliases): Assume that
floating-point values are not used to transfer pointers.
2013-03-27 Alexander Ivchenko <alexander.ivchenko@intel.com>
* gcc/target.def (TARGET_HAS_IFUNC_P): New target hook.

View File

@ -1,3 +1,8 @@
2013-03-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/37021
* gfortran.dg/vect/fast-math-pr37021.f90: New testcase.
2013-03-27 Alexander Ivchenko <alexander.ivchenko@intel.com>
* g++.dg/ipa/ivinline-1.C: Add target nonpic.

View File

@ -0,0 +1,17 @@
! { dg-do compile }
subroutine to_product_of(self,a,b,a1,a2)
complex(kind=8) :: self (:)
complex(kind=8), intent(in) :: a(:,:)
complex(kind=8), intent(in) :: b(:)
integer a1,a2
self = ZERO
do i = 1,a1
do j = 1,a2
self(i) = self(i) + a(i,j)*b(j)
end do
end do
end subroutine
! { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } }
! { dg-final { cleanup-tree-dump "vect" } }

View File

@ -4631,7 +4631,11 @@ find_func_aliases (gimple origt)
get_constraint_for (lhsop, &lhsc);
if (code == POINTER_PLUS_EXPR)
if (FLOAT_TYPE_P (TREE_TYPE (lhsop)))
/* If the operation produces a floating point result then
assume the value is not produced to transfer a pointer. */
;
else if (code == POINTER_PLUS_EXPR)
get_constraint_for_ptr_offset (gimple_assign_rhs1 (t),
gimple_assign_rhs2 (t), &rhsc);
else if (code == BIT_AND_EXPR

View File

@ -2798,6 +2798,10 @@ vect_check_strided_load (gimple stmt, loop_vec_info loop_vinfo)
base = DR_REF (dr);
if (TREE_CODE (base) == REALPART_EXPR
|| TREE_CODE (base) == IMAGPART_EXPR)
base = TREE_OPERAND (base, 0);
if (TREE_CODE (base) == ARRAY_REF)
{
off = TREE_OPERAND (base, 1);