Patchwork [4/5] Do not create the temporary array for reductions into VAR_DECLs.

login
register
mail settings
Submitter Sebastian Pop
Date Jan. 18, 2011, 5:38 a.m.
Message ID <1295329083-27160-5-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/79252/
State New
Headers show

Comments

Sebastian Pop - Jan. 18, 2011, 5:38 a.m.
2011-01-17  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-sese-to-poly.c (close_phi_written_to_memory): Also allow
	VAR_DECLs.

	* gfortran.dg/graphite/interchange-3.f90: Un-XFAILed.
---
 gcc/ChangeLog.graphite                             |    7 +++++++
 gcc/graphite-sese-to-poly.c                        |    3 ++-
 .../gfortran.dg/graphite/interchange-3.f90         |    2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)
Richard Guenther - Jan. 18, 2011, 10:05 a.m.
On Mon, 17 Jan 2011, Sebastian Pop wrote:

> 2011-01-17  Sebastian Pop  <sebastian.pop@amd.com>
> 
> 	* graphite-sese-to-poly.c (close_phi_written_to_memory): Also allow
> 	VAR_DECLs.
> 
> 	* gfortran.dg/graphite/interchange-3.f90: Un-XFAILed.
> ---
>  gcc/ChangeLog.graphite                             |    7 +++++++
>  gcc/graphite-sese-to-poly.c                        |    3 ++-
>  .../gfortran.dg/graphite/interchange-3.f90         |    2 +-
>  3 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
> index 0167f22..b222d37 100644
> --- a/gcc/ChangeLog.graphite
> +++ b/gcc/ChangeLog.graphite
> @@ -1,5 +1,12 @@
>  2011-01-17  Sebastian Pop  <sebastian.pop@amd.com>
>  
> +	* graphite-sese-to-poly.c (close_phi_written_to_memory): Also allow
> +	VAR_DECLs.
> +
> +	* gfortran.dg/graphite/interchange-3.f90: Un-XFAILed.
> +
> +2011-01-17  Sebastian Pop  <sebastian.pop@amd.com>
> +
>  	* graphite-dependences.c (reduction_dr_1): Allow several reductions
>  	in a reduction PBB.
>  	* graphite-sese-to-poly.c (split_reduction_stmt): Do not split PBBs
> diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
> index c578025..dd8f9f3 100644
> --- a/gcc/graphite-sese-to-poly.c
> +++ b/gcc/graphite-sese-to-poly.c
> @@ -2968,7 +2968,8 @@ close_phi_written_to_memory (gimple close_phi)
>  	&& gimple_code (stmt) == GIMPLE_ASSIGN
>  	&& (res = gimple_assign_lhs (stmt))
>  	&& (TREE_CODE (res) == ARRAY_REF
> -	    || TREE_CODE (res) == MEM_REF))
> +	    || TREE_CODE (res) == MEM_REF
> +	    || TREE_CODE (res) == VAR_DECL))

I suppose you also want to allow PARM_DECL and RESULT_DECL.

Richard.

>        return res;
>  
>    return NULL_TREE;
> diff --git a/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90 b/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90
> index 04f4a13..06da2b3 100644
> --- a/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90
> +++ b/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90
> @@ -24,5 +24,5 @@ Program FOO
>  
>  end Program FOO
>  
> -! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } }
> +! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } }
>  ! { dg-final { cleanup-tree-dump "graphite" } }
>

Patch

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 0167f22..b222d37 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@ 
 2011-01-17  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite-sese-to-poly.c (close_phi_written_to_memory): Also allow
+	VAR_DECLs.
+
+	* gfortran.dg/graphite/interchange-3.f90: Un-XFAILed.
+
+2011-01-17  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-dependences.c (reduction_dr_1): Allow several reductions
 	in a reduction PBB.
 	* graphite-sese-to-poly.c (split_reduction_stmt): Do not split PBBs
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index c578025..dd8f9f3 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2968,7 +2968,8 @@  close_phi_written_to_memory (gimple close_phi)
 	&& gimple_code (stmt) == GIMPLE_ASSIGN
 	&& (res = gimple_assign_lhs (stmt))
 	&& (TREE_CODE (res) == ARRAY_REF
-	    || TREE_CODE (res) == MEM_REF))
+	    || TREE_CODE (res) == MEM_REF
+	    || TREE_CODE (res) == VAR_DECL))
       return res;
 
   return NULL_TREE;
diff --git a/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90 b/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90
index 04f4a13..06da2b3 100644
--- a/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90
+++ b/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90
@@ -24,5 +24,5 @@  Program FOO
 
 end Program FOO
 
-! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } }
+! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } }
 ! { dg-final { cleanup-tree-dump "graphite" } }