diff options
author | Sebastian Pop <s.pop@samsung.com> | 2015-08-27 19:07:04 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2015-08-27 19:07:04 +0000 |
commit | d6bb5ccfebfc29ea2a583fa3fb0d0ffd48e0e226 (patch) | |
tree | 880a7c9f5b8523640dba320e719c4decf87758ed /gcc/graphite-blocking.c | |
parent | 31da952a49ef2861ee35786a3e41865ac259599c (diff) | |
download | gcc-d6bb5ccfebfc29ea2a583fa3fb0d0ffd48e0e226.zip gcc-d6bb5ccfebfc29ea2a583fa3fb0d0ffd48e0e226.tar.gz gcc-d6bb5ccfebfc29ea2a583fa3fb0d0ffd48e0e226.tar.bz2 |
remove -floop-* flags
2015-08-27 Sebastian Pop <s.pop@samsung.com>
* Makefile.in (OBJS): Remove graphite-blocking.o and
graphite-interchange.o.
* common.opt (floop-strip-mine, floop-interchange, floop-block):
Alias of floop-nest-optimize.
* doc/invoke.texi (floop-strip-mine, floop-interchange, floop-block):
Document as alias of -floop-nest-optimize.
* graphite-blocking.c: Remove.
* graphite-interchange.c: Remove.
* graphite-optimize-isl.c: Include dumpfile.h.
(getScheduleForBand): Add dump for tiled loops. Use
PARAM_LOOP_BLOCK_TILE_SIZE instead of hard coded constant.
* graphite-poly.c (scop_max_loop_depth): Remove.
(print_scattering_function_1): Remove.
(print_scattering_function): Remove.
(print_scattering_functions): Remove.
(debug_scattering_function): Remove.
(debug_scattering_functions): Remove.
(apply_poly_transforms): Remove use of flag_loop_block,
flag_loop_strip_mine, and flag_loop_interchange.
(new_poly_bb): Remove use of PBB_TRANSFORMED, PBB_SAVED, and
PBB_ORIGINAL.
(print_pdr_access_layout): Remove.
(print_pdr): Print ISL representation.
(new_scop): Remove use of SCOP_ORIGINAL_SCHEDULE,
SCOP_TRANSFORMED_SCHEDULE, and SCOP_SAVED_SCHEDULE.
(free_scop): Same.
(openscop_print_pbb_domain): Remove.
(print_pbb): Remove call to print_scattering_function.
(openscop_print_scop_context): Remove.
(print_scop_context): Do not print matrices anymore.
(print_scop): Do not print SCOP_ORIGINAL_SCHEDULE and
SCOP_TRANSFORMED_SCHEDULE.
(print_isl_set): Add printing of a new line.
(print_isl_map): Same.
(print_isl_aff): Same.
(print_isl_constraint): Same.
(loop_to_lst): Remove.
(scop_to_lst): Remove.
(lst_indent_to): Remove.
(print_lst): Remove.
(debug_lst): Remove.
(dot_lst_1): Remove.
(dot_lst): Remove.
(reverse_loop_at_level): Remove.
(reverse_loop_for_pbbs): Remove.
* graphite-poly.h (pdr_dim_iter_domain): Remove.
(pdr_nb_params): Remove.
(pdr_alias_set_dim): Remove.
(pdr_subscript_dim): Remove.
(pdr_iterator_dim): Remove.
(pdr_parameter_dim): Remove.
(same_pdr_p): Remove.
(struct poly_scattering): Remove.
(struct poly_bb): Remove _original, _transformed, _saved.
(PBB_DOMAIN, PBB_ORIGINAL, PBB_ORIGINAL_SCATTERING): Remove.
(PBB_TRANSFORMED, PBB_TRANSFORMED_SCATTERING, PBB_SAVED): Remove.
(PBB_NB_LOCAL_VARIABLES): Remove.
(PBB_NB_SCATTERING_TRANSFORM): Remove.
(schedule_to_scattering): Remove.
(number_of_write_pdrs): Remove.
(pbb_dim_iter_domain): Remove.
(pbb_nb_params): Remove.
(pbb_nb_scattering_orig): Remove.
(pbb_nb_scattering_transform): Remove.
(pbb_nb_dynamic_scattering_transform): Remove.
(pbb_nb_local_vars): Remove.
(pbb_iterator_dim): Remove.
(pbb_parameter_dim): Remove.
(psco_scattering_dim): Remove.
(psct_scattering_dim): Remove.
(psct_local_var_dim): Remove.
(psco_iterator_dim): Remove.
(psct_iterator_dim): Remove.
(psco_parameter_dim): Remove.
(psct_parameter_dim): Remove.
(psct_dynamic_dim): Remove.
(psct_static_dim): Remove.
(psct_add_local_variable): Remove.
(new_lst_loop): Remove.
(new_lst_stmt): Remove.
(free_lst): Remove.
(copy_lst): Remove.
(lst_add_loop_under_loop): Remove.
(lst_depth): Remove.
(lst_dewey_number): Remove.
(lst_dewey_number_at_depth): Remove.
(lst_pred): Remove.
(lst_succ): Remove.
(lst_find_pbb): Remove.
(find_lst_loop): Remove.
(lst_find_first_pbb): Remove.
(lst_empty_p): Remove.
(lst_find_last_pbb): Remove.
(lst_contains_p): Remove.
(lst_contains_pbb): Remove.
(lst_create_nest): Remove.
(lst_remove_from_sequence): Remove.
(lst_remove_loop_and_inline_stmts_in_loop_father): Remove.
(lst_niter_for_loop): Remove.
(pbb_update_scattering): Remove.
(lst_update_scattering_under): Remove.
(lst_update_scattering): Remove.
(lst_insert_in_sequence): Remove.
(lst_replace): Remove.
(lst_substitute_3): Remove.
(lst_distribute_lst): Remove.
(lst_remove_all_before_including_pbb): Remove.
(lst_remove_all_before_excluding_pbb): Remove.
(struct scop): Remove original_schedule, transformed_schedule, and
saved_schedule.
(SCOP_ORIGINAL_SCHEDULE, SCOP_TRANSFORMED_SCHEDULE): Remove.
(SCOP_SAVED_SCHEDULE): Remove.
(poly_scattering_new): Remove.
(poly_scattering_free): Remove.
(poly_scattering_copy): Remove.
(store_scattering_pbb): Remove.
(store_lst_schedule): Remove.
(restore_lst_schedule): Remove.
(store_scattering): Remove.
(restore_scattering_pbb): Remove.
(restore_scattering): Remove.
* graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons):
Remove scattering_dimensions. Do not use pbb_dim_iter_domain:
compute the scattering polyhedron dimension from the dimension of
pbb->domain.
(build_scop_scattering): Update call to
build_pbb_scattering_polyhedrons.
(build_poly_scop): Remove call to scop_to_lst.
* graphite.c (graphite_transform_loops): Add call to print_scop.
(gate_graphite_transforms): Remove use of flag_loop_block,
flag_loop_interchange, and flag_loop_strip_mine.
testsuite/
* gcc.dg/graphite/graphite.exp (interchange_files, block_files):
Replaced by opt_files, compile with -floop-nest-optimize.
* g++.dg/graphite/graphite.exp: Same.
* gfortran.dg/graphite/graphite.exp: Same.
* gcc.dg/graphite/block-0.c: Adjust pattern.
* gcc.dg/graphite/block-1.c: Same.
* gcc.dg/graphite/block-3.c: Same.
* gcc.dg/graphite/block-4.c: Same.
* gcc.dg/graphite/block-5.c: Same.
* gcc.dg/graphite/block-6.c: Same.
* gcc.dg/graphite/block-7.c: Same.
* gcc.dg/graphite/block-8.c: Same.
* gcc.dg/graphite/block-pr47654.c: Same.
* gcc.dg/graphite/interchange-0.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-12.c: Same.
* gcc.dg/graphite/interchange-13.c: Same.
* gcc.dg/graphite/interchange-14.c: Same.
* gcc.dg/graphite/interchange-15.c: Same.
* gcc.dg/graphite/interchange-3.c: Same.
* gcc.dg/graphite/interchange-4.c: Same.
* gcc.dg/graphite/interchange-5.c: Same.
* gcc.dg/graphite/interchange-6.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/interchange-mvt.c: Same.
* gcc.dg/graphite/pr37485.c: Same.
* gcc.dg/graphite/uns-block-1.c: Same.
* gcc.dg/graphite/uns-interchange-12.c: Same.
* gcc.dg/graphite/uns-interchange-14.c: Same.
* gcc.dg/graphite/uns-interchange-15.c: Same.
* gcc.dg/graphite/uns-interchange-9.c: Same.
* gcc.dg/graphite/uns-interchange-mvt.c: Same.
* gfortran.dg/graphite/interchange-3.f90: Same.
From-SVN: r227277
Diffstat (limited to 'gcc/graphite-blocking.c')
-rw-r--r-- | gcc/graphite-blocking.c | 270 |
1 files changed, 0 insertions, 270 deletions
diff --git a/gcc/graphite-blocking.c b/gcc/graphite-blocking.c deleted file mode 100644 index 3434294..0000000 --- a/gcc/graphite-blocking.c +++ /dev/null @@ -1,270 +0,0 @@ -/* Heuristics and transform for loop blocking and strip mining on - polyhedral representation. - - Copyright (C) 2009-2015 Free Software Foundation, Inc. - Contributed by Sebastian Pop <sebastian.pop@amd.com> and - Pranav Garg <pranav.garg2107@gmail.com>. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING3. If not see -<http://www.gnu.org/licenses/>. */ - -#include "config.h" - -#ifdef HAVE_isl -/* Workaround for GMP 5.1.3 bug, see PR56019. */ -#include <stddef.h> - -#include <isl/constraint.h> -#include <isl/set.h> -#include <isl/map.h> -#include <isl/union_map.h> -#include <isl/constraint.h> - -#include "system.h" -#include "coretypes.h" -#include "backend.h" -#include "cfghooks.h" -#include "tree.h" -#include "gimple.h" -#include "params.h" -#include "fold-const.h" -#include "gimple-iterator.h" -#include "tree-ssa-loop.h" -#include "dumpfile.h" -#include "cfgloop.h" -#include "tree-data-ref.h" -#include "graphite-poly.h" - -/* Strip mines with a factor STRIDE the scattering (time) dimension - around PBB at depth TIME_DEPTH. - - The following example comes from the wiki page: - http://gcc.gnu.org/wiki/Graphite/Strip_mine - - The strip mine of a loop with a tile of 64 can be obtained with a - scattering function as follows: - - $ cat ./albert_strip_mine.cloog - # language: C - c - - # parameter {n | n >= 0} - 1 3 - # n 1 - 1 1 0 - 1 - n - - 1 # Number of statements: - - 1 - # {i | 0 <= i <= n} - 2 4 - # i n 1 - 1 1 0 0 - 1 -1 1 0 - - 0 0 0 - 1 - i - - 1 # Scattering functions - - 3 6 - # NEW OLD i n 1 - 1 -64 0 1 0 0 - 1 64 0 -1 0 63 - 0 0 1 -1 0 0 - - 1 - NEW OLD - - #the output of CLooG is like this: - #$ cloog ./albert_strip_mine.cloog - # for (NEW=0;NEW<=floord(n,64);NEW++) { - # for (OLD=max(64*NEW,0);OLD<=min(64*NEW+63,n);OLD++) { - # S1(i = OLD) ; - # } - # } -*/ - -static void -pbb_strip_mine_time_depth (poly_bb_p pbb, int time_depth, int stride) -{ - isl_space *d; - isl_constraint *c; - int iter, strip; - /* STRIP is the dimension that iterates with stride STRIDE. */ - /* ITER is the dimension that enumerates single iterations inside - one strip that has at most STRIDE iterations. */ - strip = time_depth; - iter = strip + 2; - - pbb->transformed = isl_map_insert_dims (pbb->transformed, isl_dim_out, - strip, 2); - - /* Lower bound of the striped loop. */ - d = isl_map_get_space (pbb->transformed); - c = isl_inequality_alloc (isl_local_space_from_space (d)); - c = isl_constraint_set_coefficient_si (c, isl_dim_out, strip, -stride); - c = isl_constraint_set_coefficient_si (c, isl_dim_out, iter, 1); - pbb->transformed = isl_map_add_constraint (pbb->transformed, c); - - /* Upper bound of the striped loop. */ - d = isl_map_get_space (pbb->transformed); - c = isl_inequality_alloc (isl_local_space_from_space (d)); - c = isl_constraint_set_coefficient_si (c, isl_dim_out, strip, stride); - c = isl_constraint_set_coefficient_si (c, isl_dim_out, iter, -1); - c = isl_constraint_set_constant_si (c, stride - 1); - pbb->transformed = isl_map_add_constraint (pbb->transformed, c); - - /* Static scheduling for ITER level. - This is mandatory to keep the 2d + 1 canonical scheduling format. */ - d = isl_map_get_space (pbb->transformed); - c = isl_equality_alloc (isl_local_space_from_space (d)); - c = isl_constraint_set_coefficient_si (c, isl_dim_out, strip + 1, 1); - pbb->transformed = isl_map_add_constraint (pbb->transformed, c); -} - -/* Returns true when strip mining with STRIDE of the loop LST is - profitable. */ - -static bool -lst_strip_mine_profitable_p (lst_p lst, int stride) -{ - mpz_t niter, strip_stride; - bool res; - - gcc_assert (LST_LOOP_P (lst)); - mpz_init (strip_stride); - mpz_init (niter); - - mpz_set_si (strip_stride, stride); - lst_niter_for_loop (lst, niter); - res = (mpz_cmp (niter, strip_stride) > 0); - - mpz_clear (strip_stride); - mpz_clear (niter); - return res; -} - -/* Strip-mines all the loops of LST with STRIDE. Return the number of - loops strip-mined. */ - -static int -lst_do_strip_mine_loop (lst_p lst, int depth, int stride) -{ - int i; - lst_p l; - poly_bb_p pbb; - - if (!lst) - return 0; - - if (LST_LOOP_P (lst)) - { - int res = 0; - - FOR_EACH_VEC_ELT (LST_SEQ (lst), i, l) - res += lst_do_strip_mine_loop (l, depth, stride); - - return res; - } - - pbb = LST_PBB (lst); - pbb_strip_mine_time_depth (pbb, psct_dynamic_dim (pbb, depth), stride); - return 1; -} - -/* Strip-mines all the loops of LST with STRIDE. When STRIDE is zero, - read the stride from the PARAM_LOOP_BLOCK_TILE_SIZE. Return the - number of strip-mined loops. - - Strip mining transforms a loop - - | for (i = 0; i < N; i++) - | S (i); - - into the following loop nest: - - | for (k = 0; k < N; k += STRIDE) - | for (j = 0; j < STRIDE; j++) - | S (i = k + j); -*/ - -static int -lst_do_strip_mine (lst_p lst, int stride) -{ - int i; - lst_p l; - int res = 0; - int depth; - - if (!stride) - stride = PARAM_VALUE (PARAM_LOOP_BLOCK_TILE_SIZE); - - if (!lst - || !LST_LOOP_P (lst)) - return false; - - FOR_EACH_VEC_ELT (LST_SEQ (lst), i, l) - res += lst_do_strip_mine (l, stride); - - depth = lst_depth (lst); - if (depth >= 0 - && lst_strip_mine_profitable_p (lst, stride)) - { - res += lst_do_strip_mine_loop (lst, lst_depth (lst), stride); - lst_add_loop_under_loop (lst); - } - - return res; -} - -/* Strip mines all the loops in SCOP. Returns the number of - strip-mined loops. */ - -int -scop_do_strip_mine (scop_p scop, int stride) -{ - return lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop), stride); -} - -/* Loop blocks all the loops in SCOP. Returns true when we manage to - block some loops. */ - -bool -scop_do_block (scop_p scop) -{ - store_scattering (scop); - - /* If we don't strip mine at least two loops, or not interchange - loops, the strip mine alone will not be profitable, and the - transform is not a loop blocking: so revert the transform. */ - if (lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop), 0) < 2 - || scop_do_interchange (scop) == 0) - { - restore_scattering (scop); - return false; - } - - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, "SCoP will be loop blocked.\n"); - - return true; -} - -#endif |