diff options
author | Richard Biener <rguenther@suse.de> | 2013-03-27 10:38:29 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-03-27 10:38:29 +0000 |
commit | 7d24f650fa1886c29e2431c969e5b7e6f8a50836 (patch) | |
tree | 92e4267a0b2c2fc61b604712594ccbfdf4f9e8c9 /gcc | |
parent | 173536ed5f1dffb39cd220678d9e246bbafd86f6 (diff) | |
download | gcc-7d24f650fa1886c29e2431c969e5b7e6f8a50836.zip gcc-7d24f650fa1886c29e2431c969e5b7e6f8a50836.tar.gz gcc-7d24f650fa1886c29e2431c969e5b7e6f8a50836.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/vect/fast-math-pr37021.f90 | 17 | ||||
-rw-r--r-- | gcc/tree-ssa-structalias.c | 6 | ||||
-rw-r--r-- | gcc/tree-vect-data-refs.c | 4 |
5 files changed, 39 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f00cb04..b90cc67 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5b26dad..17d5889 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-pr37021.f90 b/gcc/testsuite/gfortran.dg/vect/fast-math-pr37021.f90 new file mode 100644 index 0000000..d2eebd4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/vect/fast-math-pr37021.f90 @@ -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" } } diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 236b86a..c588e87 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -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 diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 579f603..188581f 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -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); |