public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-modules] tree-optimization/93439 move clique bookkeeping to OMP expansion
@ 2020-01-31 17:46 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2020-01-31 17:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6c42e27c165b3ed1f2a388ed74091cd5a18bba85

commit 6c42e27c165b3ed1f2a388ed74091cd5a18bba85
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jan 28 14:09:12 2020 +0100

    tree-optimization/93439 move clique bookkeeping to OMP expansion
    
    Autopar was doing clique bookkeeping too early when creating destination
    functions but then later introducing new cliques via versioning loops.
    The following moves the bookkeeping to the actual outlining process.
    
    2020-01-28  Richard Biener  <rguenther@suse.de>
    
    	PR tree-optimization/93439
    	* tree-parloops.c (create_loop_fn): Move clique bookkeeping...
    	* tree-cfg.c (move_sese_region_to_fn): ... here.
    	(verify_types_in_gimple_reference): Verify used cliques are
    	tracked.
    
    	* gfortran.dg/graphite/pr93439.f90: New testcase.

Diff:
---
 gcc/ChangeLog                                  |  8 ++++++++
 gcc/testsuite/ChangeLog                        |  5 +++++
 gcc/testsuite/gfortran.dg/graphite/pr93439.f90 | 21 +++++++++++++++++++++
 gcc/tree-cfg.c                                 | 17 +++++++++++++++++
 gcc/tree-parloops.c                            |  1 -
 5 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2a000e5..ed3db3e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2020-01-28  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/93439
+	* tree-parloops.c (create_loop_fn): Move clique bookkeeping...
+	* tree-cfg.c (move_sese_region_to_fn): ... here.
+	(verify_types_in_gimple_reference): Verify used cliques are
+	tracked.
+
 2020-01-28  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR target/91399
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c08bc22..dfb7a0f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-28  Richard Biener  <rguenther@suse.de>
+
+	PR tree-optimization/93439
+	* gfortran.dg/graphite/pr93439.f90: New testcase.
+
 2020-01-28  Sahahb Vahedi  <shahab@synopsys.com>
 
 	* gcc.target/arc/code-density-flag.c: New test
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr93439.f90 b/gcc/testsuite/gfortran.dg/graphite/pr93439.f90
new file mode 100644
index 0000000..e815ab9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/pr93439.f90
@@ -0,0 +1,21 @@
+! { dg-additional-options "-O2 -floop-parallelize-all -floop-unroll-and-jam -ftree-parallelize-loops=2" }
+
+module ai
+  integer, parameter :: dp = 8
+contains
+  subroutine qu(ja, nq, en, p5)
+    real(kind = dp) :: nq(ja), en(ja), p5(ja)
+    call tl(ja, nq, en, p5)
+  end subroutine qu
+
+  subroutine tl(ja, nq, en, p5)
+    real(kind = dp) :: nq(9), en(9 * ja), p5(3 * ja)
+    do mc = 1, ja
+       do mb = 1, 9
+          do ma = 1, 3
+             p5((mc - 1) * 3 + ma) = p5((mc - 1) * 3 + ma) - 1
+          end do
+       end do
+    end do
+  end subroutine tl
+end module ai
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index fd69b36..f7b817d 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3226,6 +3226,13 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue)
 	  debug_generic_stmt (expr);
 	  return true;
 	}
+      if (MR_DEPENDENCE_CLIQUE (expr) != 0
+	  && MR_DEPENDENCE_CLIQUE (expr) > cfun->last_clique)
+	{
+	  error ("invalid clique in %qs", code_name);
+	  debug_generic_stmt (expr);
+	  return true;
+	}
     }
   else if (TREE_CODE (expr) == TARGET_MEM_REF)
     {
@@ -3245,6 +3252,13 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue)
 	  debug_generic_stmt (expr);
 	  return true;
 	}
+      if (MR_DEPENDENCE_CLIQUE (expr) != 0
+	  && MR_DEPENDENCE_CLIQUE (expr) > cfun->last_clique)
+	{
+	  error ("invalid clique in %qs", code_name);
+	  debug_generic_stmt (expr);
+	  return true;
+	}
     }
   else if (TREE_CODE (expr) == INDIRECT_REF)
     {
@@ -7744,6 +7758,9 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
       after = bb;
     }
 
+  /* Adjust the maximum clique used.  */
+  dest_cfun->last_clique = saved_cfun->last_clique;
+
   loop->aux = NULL;
   loop0->aux = NULL;
   /* Loop sizes are no longer correct, fix them up.  */
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index d315b79..d9250d3 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -2202,7 +2202,6 @@ create_loop_fn (location_t loc)
   DECL_ARGUMENTS (decl) = t;
 
   allocate_struct_function (decl, false);
-  DECL_STRUCT_FUNCTION (decl)->last_clique = act_cfun->last_clique;
 
   /* The call to allocate_struct_function clobbers CFUN, so we need to restore
      it.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-31 17:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-31 17:46 [gcc/devel/c++-modules] tree-optimization/93439 move clique bookkeeping to OMP expansion Nathan Sidwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).