gcc/libgomp
Aditya Kumar 74032f471d Remove limit_scops
This patch removes graphite-scop-detection.c:limit_scops function and fix
related issues arising because of that. The functionality limit_scop was added
as an intermediate step to discard the loops which graphite could not
handle. Removing limit_scop required handling of different cases of loops and
surrounding code.  The scop is now larger so most test cases required 'number of
scops detected' to be fixed. By increasing the size of scop we can now optimize
loops which are 'siblings' of each other. This could enable loop fusion on a
number of loops. Since in the graphite framework we mostly want to opimize
loop-nests/adjacent-loops, we now discard scops with less than 2 loops. We
also discard scops without any data references.

Essentially:
 - Remove limite_scops.
 - Only select scops when there are at least two loops (loop nest or, side by side).
 - Discard loops without data-refs.
 - Fix test cases.

Passes bootstrap and reg-test.

gcc/ChangeLog:

2015-09-02  Aditya Kumar  <hiraditya@msn.com>
            Sebastian Pop  <s.pop@samsung.com>

        * graphite-isl-ast-to-gimple.c (gcc_expression_from_isl_ast_expr_id):
        Return the parameter if it was saved in corresponding
        parameter_rename_map of the region.
        (copy_def): Copy def from sese region to the newly created region.
        (copy_internal_parameters): Copy all the internal parameters defined
        within a region to the newly created region.
        (graphite_regenerate_ast_isl): Copy parameters to the new region before
        translating isl to gimple.
        * graphite-scop-detection.c (graphite_can_represent_loop): Bail out if
          the loop-nest does not have any data-references.
        (build_graphite_scops): Create a scop only when there is at least one
        loop inside it.
        (contains_only_close_phi_nodes): Deleted.
        (print_graphite_scop_statistics): Deleted
        (print_graphite_statistics): Deleted
        (limit_scops): Deleted.
        (build_scops): Removed call to limit_scops.
        * sese.c (new_sese): Construct.
        (free_sese): Destruct.
        (sese_add_exit_phis_edge): update_stmt after exit phi edge has been
        added.
        (set_rename): Pass sese region so that parameters inside the region can
        be added to its parameter_rename_map.
        (rename_uses): Pass sese region.
        (graphite_copy_stmts_from_block): Do not copy parameters that have been
        generated in the header of the scop. For each SSA_NAME in the
        parameter_rename_map rename its usage.
        (invariant_in_sese_p_rec): Return false if tree t is defined outside
        sese region.
        (scalar_evolution_in_region): If the tree t is invariant just return t.
        * sese.h: Added a parameter renamne map (parameter_rename_map_t) to
          struct sese to keep track of all the parameters which need renaming.
        * tree-data-ref.c (loop_nest_has_data_refs): Check if a loop nest has
          any data-refs.
        * tree-data-ref.h: Declaration of loop_nest_has_data_refs.

gcc/testsuite/ChangeLog:

2015-09-02  Aditya Kumar  <hiraditya@msn.com>
            Sebastian Pop  <s.pop@samsung.com>

        * gcc.dg/graphite/block-0.c: Modifed test case to match current output.
        * gcc.dg/graphite/block-1.c: Same.
        * gcc.dg/graphite/block-5.c: Same.
        * gcc.dg/graphite/block-6.c: Same.
        * gcc.dg/graphite/interchange-1.c: Same.
        * gcc.dg/graphite/interchange-10.c: Same.
        * gcc.dg/graphite/interchange-11.c: Same.
        * gcc.dg/graphite/interchange-13.c: Same.
        * gcc.dg/graphite/interchange-14.c: Same.
        * gcc.dg/graphite/interchange-3.c: Same.
        * gcc.dg/graphite/interchange-4.c: Same.
        * gcc.dg/graphite/interchange-7.c: Same.
        * gcc.dg/graphite/interchange-8.c: Same.
        * gcc.dg/graphite/interchange-9.c: Same.
        * gcc.dg/graphite/isl-codegen-loop-dumping.c: Same.
        * gcc.dg/graphite/pr35356-1.c (foo): Same.
        * gcc.dg/graphite/pr37485.c: Same.
        * gcc.dg/graphite/scop-0.c (int toto): Same.
        * gcc.dg/graphite/scop-1.c: Same.
        * gcc.dg/graphite/scop-10.c: Same.
        * gcc.dg/graphite/scop-11.c: Same.
        * gcc.dg/graphite/scop-12.c: Same.
        * gcc.dg/graphite/scop-13.c: Same.
        * gcc.dg/graphite/scop-16.c: Same.
        * gcc.dg/graphite/scop-17.c: Same.
        * gcc.dg/graphite/scop-18.c: Same.
        * gcc.dg/graphite/scop-2.c: Same.
        * gcc.dg/graphite/scop-21.c (int test): Same.
        * gcc.dg/graphite/scop-22.c (void foo): Same.
        * gcc.dg/graphite/scop-4.c: Same.
        * gcc.dg/graphite/scop-5.c: Same.
        * gcc.dg/graphite/scop-6.c: Same.
        * gcc.dg/graphite/scop-7.c: Same.
        * gcc.dg/graphite/scop-8.c: Same.
        * gcc.dg/graphite/scop-9.c: Same.
        * gcc.dg/graphite/scop-mvt.c (void mvt): Introduced dependency so that
          data-refs remain inside the inner loop.
        * gcc.dg/graphite/uns-block-1.c: Modifed test case to match o/p.
        * gcc.dg/graphite/uns-interchange-14.c: Same.
        * gcc.dg/graphite/uns-interchange-9.c: Same.
        * gfortran.dg/graphite/interchange-3.f90

libgomp/ChangeLog:

2015-09-04  Aditya Kumar  <hiraditya@msn.com>
            Sebastian Pop  <s.pop@samsung.com>

        * testsuite/libgomp.graphite/bounds.c (int foo): Modifed test case to
          match o/p.
        * testsuite/libgomp.graphite/force-parallel-1.c (void parloop): Same.
        * testsuite/libgomp.graphite/force-parallel-4.c: Same.
        * testsuite/libgomp.graphite/force-parallel-5.c: Same.
        * testsuite/libgomp.graphite/force-parallel-7.c: Same.
        * testsuite/libgomp.graphite/force-parallel-8.c: Same.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r227567
2015-09-08 22:18:11 +00:00
..
config [gomp] Add thread attribute customization 2015-09-03 11:34:28 +00:00
plugin libgomp.map: Add 4.0.2 version. 2015-08-24 17:10:06 +00:00
testsuite Remove limit_scops 2015-09-08 22:18:11 +00:00
ChangeLog Remove limit_scops 2015-09-08 22:18:11 +00:00
ChangeLog.graphite Add forgotten ChangeLog entries. 2010-03-08 17:49:42 +00:00
Makefile.am Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
Makefile.in [PR libgomp/65742, PR middle-end/66332] libgomp: Remove plugin for non-shared memory host execution 2015-08-10 18:48:26 +02:00
acinclude.m4 Fix Solaris symbol versioning (PR libstdc++/52188) 2012-02-27 13:51:50 +00:00
aclocal.m4 libgomp: Bump to automake 1.11.6 2015-05-13 11:24:38 +00:00
alloc.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
barrier.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
config.h.in configure.ac: Fix check for header <sys/sysctl.h>. 2015-06-23 19:59:59 +02:00
configure [gomp] Add RTEMS configuration 2015-09-03 11:26:36 +00:00
configure.ac [gomp] Add RTEMS configuration 2015-09-03 11:26:36 +00:00
configure.tgt configure.tgt: Add missing ;; in between nvptx and rtems snippets. 2015-09-03 18:20:35 +02:00
critical.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
env.c Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
error.c Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
fortran.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
hashtab.h Update copyright years. 2015-01-05 13:33:28 +01:00
iter.c re PR libgomp/66761 (libgomp: ThreadSanitizer: data race in libgomp) 2015-08-24 11:01:25 +00:00
iter_ull.c re PR libgomp/66761 (libgomp: ThreadSanitizer: data race in libgomp) 2015-08-24 11:01:25 +00:00
libgomp-plugin.c libgomp: Make GOMP_PLUGIN_debug actually work... 2015-02-17 19:24:07 +01:00
libgomp-plugin.h [PR libgomp/65742, PR middle-end/66332] libgomp: Remove plugin for non-shared memory host execution 2015-08-10 18:48:26 +02:00
libgomp.h [gomp] Thread pool management 2015-09-03 11:29:59 +00:00
libgomp.map libgomp.map: Add 4.0.2 version. 2015-08-24 17:10:06 +00:00
libgomp.spec.in Generally link to libgomp for -ftree-parallelize-loops=*. 2013-11-07 16:07:34 +01:00
libgomp.texi [gomp] Add thread attribute customization 2015-09-03 11:34:28 +00:00
libgomp_f.h.in libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
libgomp_g.h [PR libgomp/64625] Remove __OFFLOAD_TABLE__ variable/formal parameter. 2015-01-19 13:03:35 +01:00
loop.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
loop_ull.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
oacc-async.c mkoffload.c (process): Support variable mapping. 2015-04-08 15:58:33 +00:00
oacc-cuda.c mkoffload.c (process): Support variable mapping. 2015-04-08 15:58:33 +00:00
oacc-host.c libgomp.map: Add 4.0.2 version. 2015-08-24 17:10:06 +00:00
oacc-init.c [PR libgomp/65742, PR middle-end/66332] libgomp: Remove plugin for non-shared memory host execution 2015-08-10 18:48:26 +02:00
oacc-int.h mkoffload.c (process): Support variable mapping. 2015-04-08 15:58:33 +00:00
oacc-mem.c oacc-init.c (acc_shutdown_1): Call gomp_mutex_unlock for goacc_thread_lock on error paths. 2015-05-06 16:45:49 +00:00
oacc-parallel.c Missed a difference between gomp4 and trunk 2015-07-20 17:38:49 +00:00
oacc-plugin.c Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
oacc-plugin.h Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
oacc-ptx.h libgomp: Make nvptx helper routines self-contained. 2015-02-17 19:05:24 +01:00
omp.h.in libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
omp_lib.f90.in libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
omp_lib.h.in libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
openacc.f90 [PR libgomp/65742, PR middle-end/66332] libgomp: Remove plugin for non-shared memory host execution 2015-08-10 18:48:26 +02:00
openacc.h [PR libgomp/65742, PR middle-end/66332] libgomp: Remove plugin for non-shared memory host execution 2015-08-10 18:48:26 +02:00
openacc_lib.h [PR libgomp/65742, PR middle-end/66332] libgomp: Remove plugin for non-shared memory host execution 2015-08-10 18:48:26 +02:00
ordered.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
parallel.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
sections.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
single.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
splay-tree.c Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
splay-tree.h Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
target.c libgomp.map: Add 4.0.2 version. 2015-08-24 17:10:06 +00:00
task.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
team.c [gomp] Add thread attribute customization 2015-09-03 11:34:28 +00:00
work.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00