gcc/gcc/graphite-optimize-isl.c

528 lines
17 KiB
C
Raw Normal View History

/* A scheduling optimizer for Graphite
Copyright (C) 2012-2017 Free Software Foundation, Inc.
Contributed by Tobias Grosser <tobias@grosser.es>.
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/>. */
#define USES_ISL
#include "config.h"
#ifdef HAVE_isl
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "cfghooks.h"
#include "tree.h"
#include "gimple.h"
#include "fold-const.h"
#include "gimple-iterator.h"
#include "tree-ssa-loop.h"
#include "cfgloop.h"
#include "tree-data-ref.h"
#include "params.h"
#include "dumpfile.h"
#include "graphite.h"
#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
/* isl 0.15 or later. */
/* get_schedule_for_node_st - Improve schedule for the schedule node.
Only Simple loop tiling is considered. */
static __isl_give isl_schedule_node *
get_schedule_for_node_st (__isl_take isl_schedule_node *node, void *user)
{
if (user)
return node;
if (isl_schedule_node_get_type (node) != isl_schedule_node_band
|| isl_schedule_node_n_children (node) != 1)
return node;
isl_space *space = isl_schedule_node_band_get_space (node);
unsigned dims = isl_space_dim (space, isl_dim_set);
isl_schedule_node *child = isl_schedule_node_get_child (node, 0);
isl_schedule_node_type type = isl_schedule_node_get_type (child);
isl_space_free (space);
isl_schedule_node_free (child);
if (type != isl_schedule_node_leaf)
return node;
if (dims <= 1 || !isl_schedule_node_band_get_permutable (node))
{
if (dump_file && dump_flags)
fprintf (dump_file, "not tiled\n");
return node;
}
/* Tile loops. */
space = isl_schedule_node_band_get_space (node);
isl_multi_val *sizes = isl_multi_val_zero (space);
long tile_size = PARAM_VALUE (PARAM_LOOP_BLOCK_TILE_SIZE);
isl_ctx *ctx = isl_schedule_node_get_ctx (node);
for (unsigned i = 0; i < dims; i++)
{
sizes = isl_multi_val_set_val (sizes, i,
isl_val_int_from_si (ctx, tile_size));
if (dump_file && dump_flags)
fprintf (dump_file, "tiled by %ld\n", tile_size);
}
node = isl_schedule_node_band_tile (node, sizes);
node = isl_schedule_node_child (node, 0);
return node;
}
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
static isl_union_set *
scop_get_domains (scop_p scop)
{
int i;
poly_bb_p pbb;
isl_space *space = isl_set_get_space (scop->param_context);
isl_union_set *res = isl_union_set_empty (space);
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
FOR_EACH_VEC_ELT (scop->pbbs, i, pbb)
res = isl_union_set_add_set (res, isl_set_copy (pbb->domain));
return res;
}
/* Compute the schedule for SCOP based on its parameters, domain and set of
constraints. Then apply the schedule to SCOP. */
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
static bool
optimize_isl (scop_p scop)
{
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
int old_max_operations = isl_ctx_get_max_operations (scop->isl_context);
int max_operations = PARAM_VALUE (PARAM_MAX_ISL_OPERATIONS);
if (max_operations)
isl_ctx_set_max_operations (scop->isl_context, max_operations);
isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_CONTINUE);
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
isl_union_set *domain = scop_get_domains (scop);
/* Simplify the dependences on the domain. */
scop_get_dependences (scop);
isl_union_map *dependences
= isl_union_map_gist_domain (isl_union_map_copy (scop->dependence),
isl_union_set_copy (domain));
isl_union_map *validity
= isl_union_map_gist_range (dependences, isl_union_set_copy (domain));
/* FIXME: proximity should not be validity. */
isl_union_map *proximity = isl_union_map_copy (validity);
isl_schedule_constraints *sc = isl_schedule_constraints_on_domain (domain);
sc = isl_schedule_constraints_set_proximity (sc, proximity);
sc = isl_schedule_constraints_set_validity (sc, isl_union_map_copy (validity));
sc = isl_schedule_constraints_set_coincidence (sc, validity);
isl_options_set_schedule_serialize_sccs (scop->isl_context, 0);
isl_options_set_schedule_maximize_band_depth (scop->isl_context, 1);
isl_options_set_schedule_max_constant_term (scop->isl_context, 20);
isl_options_set_schedule_max_coefficient (scop->isl_context, 20);
isl_options_set_tile_scale_tile_loops (scop->isl_context, 0);
/* Generate loop upper bounds that consist of the current loop iterator, an
operator (< or <=) and an expression not involving the iterator. If this
option is not set, then the current loop iterator may appear several times
in the upper bound. See the isl manual for more details. */
isl_options_set_ast_build_atomic_upper_bound (scop->isl_context, 1);
scop->transformed_schedule = isl_schedule_constraints_compute_schedule (sc);
scop->transformed_schedule =
isl_schedule_map_schedule_node_bottom_up (scop->transformed_schedule,
get_schedule_for_node_st, NULL);
isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_ABORT);
isl_ctx_reset_operations (scop->isl_context);
isl_ctx_set_max_operations (scop->isl_context, old_max_operations);
if (!scop->transformed_schedule
|| isl_ctx_last_error (scop->isl_context) == isl_error_quota)
{
if (dump_file && dump_flags)
fprintf (dump_file, "isl timed out --param max-isl-operations=%d\n",
max_operations);
return false;
}
gcc_assert (scop->original_schedule);
isl_union_map *original = isl_schedule_get_map (scop->original_schedule);
isl_union_map *transformed = isl_schedule_get_map (scop->transformed_schedule);
bool same_schedule = isl_union_map_is_equal (original, transformed);
isl_union_map_free (original);
isl_union_map_free (transformed);
if (same_schedule)
{
if (dump_file)
{
fprintf (dump_file, "[scheduler] isl optimized schedule is "
"identical to the original schedule.\n");
print_schedule_ast (dump_file, scop->original_schedule, scop);
}
isl_schedule_free (scop->transformed_schedule);
scop->transformed_schedule = isl_schedule_copy (scop->original_schedule);
return false;
}
return true;
}
/* Apply graphite transformations to all the basic blocks of SCOP. */
bool
apply_poly_transforms (scop_p scop)
{
if (flag_loop_nest_optimize)
return optimize_isl (scop);
if (!flag_graphite_identity && !flag_loop_parallelize_all)
return false;
/* Generate code even if we did not apply any real transformation.
This also allows to check the performance for the identity
transformation: GIMPLE -> GRAPHITE -> GIMPLE. */
gcc_assert (scop->original_schedule);
scop->transformed_schedule = isl_schedule_copy (scop->original_schedule);
return true;
}
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
#else
/* get_tile_map - Create a map that describes a n-dimensonal tiling.
get_tile_map creates a map from a n-dimensional scattering space into an
2*n-dimensional scattering space. The map describes a rectangular tiling.
Example:
SCHEDULE_DIMENSIONS = 2, PARAMETER_DIMENSIONS = 1, TILE_SIZE = 32
tile_map := [p0] -> {[s0, s1] -> [t0, t1, s0, s1]:
t0 % 32 = 0 and t0 <= s0 < t0 + 32 and
t1 % 32 = 0 and t1 <= s1 < t1 + 32}
Before tiling:
for (i = 0; i < N; i++)
for (j = 0; j < M; j++)
S(i,j)
After tiling:
for (t_i = 0; t_i < N; i+=32)
for (t_j = 0; t_j < M; j+=32)
for (i = t_i; i < min(t_i + 32, N); i++) | Unknown that N % 32 = 0
for (j = t_j; j < t_j + 32; j++) | Known that M % 32 = 0
S(i,j)
*/
static isl_basic_map *
get_tile_map (isl_ctx *ctx, int schedule_dimensions, int tile_size)
{
/* We construct
tile_map := [p0] -> {[s0, s1] -> [t0, t1, p0, p1, a0, a1]:
s0 = a0 * 32 and s0 = p0 and t0 <= p0 < t0 + 32 and
s1 = a1 * 32 and s1 = p1 and t1 <= p1 < t1 + 32}
and project out the auxilary dimensions a0 and a1. */
isl_space *space
= isl_space_alloc (ctx, 0, schedule_dimensions, schedule_dimensions * 3);
isl_basic_map *tile_map = isl_basic_map_universe (isl_space_copy (space));
isl_local_space *local_space = isl_local_space_from_space (space);
for (int x = 0; x < schedule_dimensions; x++)
{
int sX = x;
int tX = x;
int pX = schedule_dimensions + x;
int aX = 2 * schedule_dimensions + x;
isl_constraint *c;
/* sX = aX * tile_size; */
c = isl_equality_alloc (isl_local_space_copy (local_space));
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
isl_constraint_set_coefficient_si (c, isl_dim_out, sX, 1);
isl_constraint_set_coefficient_si (c, isl_dim_out, aX, -tile_size);
tile_map = isl_basic_map_add_constraint (tile_map, c);
/* pX = sX; */
c = isl_equality_alloc (isl_local_space_copy (local_space));
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
isl_constraint_set_coefficient_si (c, isl_dim_out, pX, 1);
isl_constraint_set_coefficient_si (c, isl_dim_in, sX, -1);
tile_map = isl_basic_map_add_constraint (tile_map, c);
/* tX <= pX */
c = isl_inequality_alloc (isl_local_space_copy (local_space));
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
isl_constraint_set_coefficient_si (c, isl_dim_out, pX, 1);
isl_constraint_set_coefficient_si (c, isl_dim_out, tX, -1);
tile_map = isl_basic_map_add_constraint (tile_map, c);
/* pX <= tX + (tile_size - 1) */
c = isl_inequality_alloc (isl_local_space_copy (local_space));
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
isl_constraint_set_coefficient_si (c, isl_dim_out, tX, 1);
isl_constraint_set_coefficient_si (c, isl_dim_out, pX, -1);
isl_constraint_set_constant_si (c, tile_size - 1);
tile_map = isl_basic_map_add_constraint (tile_map, c);
}
/* Project out auxiliary dimensions.
The auxiliary dimensions are transformed into existentially quantified
ones.
This reduces the number of visible scattering dimensions and allows isl
to produces better code. */
tile_map =
isl_basic_map_project_out (tile_map, isl_dim_out,
2 * schedule_dimensions, schedule_dimensions);
isl_local_space_free (local_space);
return tile_map;
}
/* get_schedule_for_band - Get the schedule for this BAND.
Polly applies transformations like tiling on top of the isl calculated
value.
This can influence the number of scheduling dimension. The number of
schedule dimensions is returned in DIMENSIONS. */
static isl_union_map *
get_schedule_for_band (isl_band *band, int *dimensions)
{
isl_union_map *partial_schedule;
isl_ctx *ctx;
isl_space *space;
isl_basic_map *tile_map;
isl_union_map *tile_umap;
partial_schedule = isl_band_get_partial_schedule (band);
*dimensions = isl_band_n_member (band);
/* It does not make any sense to tile a band with just one dimension. */
if (*dimensions == 1)
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
2015-08-27 21:07:04 +02:00
{
if (dump_file && dump_flags)
fprintf (dump_file, "not tiled\n");
return partial_schedule;
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
2015-08-27 21:07:04 +02:00
}
if (dump_file && dump_flags)
fprintf (dump_file, "tiled by %d\n",
PARAM_VALUE (PARAM_LOOP_BLOCK_TILE_SIZE));
ctx = isl_union_map_get_ctx (partial_schedule);
space = isl_union_map_get_space (partial_schedule);
tile_map = get_tile_map (ctx, *dimensions,
PARAM_VALUE (PARAM_LOOP_BLOCK_TILE_SIZE));
tile_umap = isl_union_map_from_map (isl_map_from_basic_map (tile_map));
tile_umap = isl_union_map_align_params (tile_umap, space);
tile_umap = isl_union_map_coalesce (tile_umap);
*dimensions = 2 * *dimensions;
return isl_union_map_apply_range (partial_schedule, tile_umap);
}
/* get_schedule_for_band_list - Get the scheduling map for a list of bands.
We walk recursively the forest of bands to combine the schedules of the
individual bands to the overall schedule. In case tiling is requested,
the individual bands are tiled. */
static isl_union_map *
get_schedule_for_band_list (isl_band_list *band_list)
{
int num_bands, i;
isl_union_map *schedule;
isl_ctx *ctx;
ctx = isl_band_list_get_ctx (band_list);
num_bands = isl_band_list_n_band (band_list);
schedule = isl_union_map_empty (isl_space_params_alloc (ctx, 0));
for (i = 0; i < num_bands; i++)
{
isl_band *band;
isl_union_map *partial_schedule;
int schedule_dimensions;
isl_space *space;
band = isl_band_list_get_band (band_list, i);
partial_schedule = get_schedule_for_band (band, &schedule_dimensions);
space = isl_union_map_get_space (partial_schedule);
if (isl_band_has_children (band))
{
isl_band_list *children = isl_band_get_children (band);
isl_union_map *suffixSchedule
= get_schedule_for_band_list (children);
partial_schedule
= isl_union_map_flat_range_product (partial_schedule,
suffixSchedule);
isl_band_list_free (children);
}
schedule = isl_union_map_union (schedule, partial_schedule);
isl_band_free (band);
isl_space_free (space);
}
return isl_union_map_coalesce (schedule);
}
static isl_union_map *
get_schedule_map (isl_schedule *schedule)
{
isl_band_list *band_list = isl_schedule_get_band_forest (schedule);
isl_union_map *schedule_map = get_schedule_for_band_list (band_list);
isl_band_list_free (band_list);
return schedule_map;
}
static isl_stat
get_single_map (__isl_take isl_map *map, void *user)
{
isl_map **single_map = (isl_map **)user;
*single_map = map;
return isl_stat_ok;
}
static void
apply_schedule_map_to_scop (scop_p scop, isl_union_map *schedule_map)
{
int i;
poly_bb_p pbb;
gather bbs and conditions in a single walk through dominators Clean up the function to build scop's basic blocks and the function that gathers the conditions under which a basic block is executed. We remove one traversal of the dominator tree. This refactoring was triggered by the need of a vec<bb> of all the basic blocks in a region. We will use that vector in a patch that removes the out-of-ssa translation of scalar dependences: we will iterate through the basic blocks of a region to record scalar dependences crossing bbs or going out of the region. The patch passes bootstrap and regtest on x86_64-linux. 2015-10-06 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> * graphite-dependences.c (scop_get_dependences): Do not use SCOP_BBS. * graphite-isl-ast-to-gimple.c (get_max_schedule_dimensions): Same. (generate_isl_schedule): Same. * graphite-optimize-isl.c (scop_get_domains): Same. (apply_schedule_map_to_scop): Same. * graphite-poly.c (print_iteration_domains): Same. (remove_gbbs_in_scop): Same. (new_scop): Same. (free_scop): Same. (print_scop): Same. * graphite-poly.h (struct scop): Rename bbs to pbbs. (SCOP_BBS): Remove. * graphite-scop-detection.c (compare_bb_depths): Remove. (graphite_sort_dominated_info): Remove. (try_generate_gimple_bb): Move out of scop_detection. (all_non_dominated_preds_marked_p): Remove. (build_scop_bbs_1): Remove. (build_scop_bbs): Remove. (nb_pbbs_in_loops): Do not use SCOP_BBS. (find_scop_parameters): Same. (sese_dom_walker): Rename gather_bbs. (before_dom_children): Call try_generate_gimple_bb and collect gbb and pbb. (build_scops): Call gather_bbs. * graphite-sese-to-poly.c (build_scop_scattering): Do not use SCOP_BBS. (add_conditions_to_constraints): Same. (build_scop_iteration_domain): Same. (build_scop_drs): Same. (new_pbb_from_pbb): Same. * sese.c (new_sese_info): Create bbs. * sese.h (struct sese_info_t): Add bbs. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r228581
2015-10-07 21:25:35 +02:00
FOR_EACH_VEC_ELT (scop->pbbs, i, pbb)
{
isl_set *domain = isl_set_copy (pbb->domain);
isl_map *stmt_schedule;
isl_union_map *stmt_band
= isl_union_map_intersect_domain (isl_union_map_copy (schedule_map),
isl_union_set_from_set (domain));
stmt_band = isl_union_map_coalesce (stmt_band);
isl_union_map_foreach_map (stmt_band, get_single_map, &stmt_schedule);
isl_map_free (pbb->transformed);
pbb->transformed = isl_map_coalesce (stmt_schedule);
isl_union_map_free (stmt_band);
}
}
static isl_union_set *
scop_get_domains (scop_p scop)
{
int i;
poly_bb_p pbb;
isl_space *space = isl_set_get_space (scop->param_context);
isl_union_set *res = isl_union_set_empty (space);
FOR_EACH_VEC_ELT (scop->pbbs, i, pbb)
res = isl_union_set_add_set (res, isl_set_copy (pbb->domain));
return res;
}
/* Compute the schedule for SCOP based on its parameters, domain and set of
constraints. Then apply the schedule to SCOP. */
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
static bool
optimize_isl (scop_p scop)
{
Move declarations, assign types, renaming. 1. Move declarations near the assignment/usage. 2. Assign type to members which were void*. 3. Rename scop->context to scop::param_context, and scop::ctx to scop::isl_context No functional changes intended. Passes regtest and bootstrap. gcc/ChangeLog: 2015-10-05 Aditya Kumar <aditya.k7@samsung.com> * graphite-dependences.c (scop_get_reads): Renamed scop->context to scop->param_context. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Same. (scop_get_transformed_schedule): Same. (subtract_commutative_associative_deps): Same. * graphite-isl-ast-to-gimple.c (add_parameters_to_ivs_params): Same. (generate_isl_context): Same. (generate_isl_schedule): Same. (scop_to_isl_ast): Same. (graphite_regenerate_ast_isl): Same. * graphite-optimize-isl.c (scop_get_domains): Same. (optimize_isl): Renamed scop->context to scop->param_context. * graphite-poly.c (new_poly_bb): Change the type of argument to gimple_poly_bb_p. (new_scop): Renamed scop->context to scop->param_context. (free_scop): Same. (print_scop_context): Same. * graphite-poly.h (new_poly_dr): Change the type of argument from void* to data_reference_p. (struct poly_bb): Change the type of black_box to gimple_poly_bb_p. (new_poly_bb): Change the type of argument from void* to gimple_poly_bb_p. (pbb_set_black_box): Same. (struct scop): Rename context to param_context, ctx to isl_context. * graphite-scop-detection.c (scop_detection::build_scop_bbs_1): Move declarations closer to assignment. (find_params_in_bb): Same. (find_scop_parameters): Same. * graphite-sese-to-poly.c (unsigned ssa_name_version_typesize): Global to be used for statement IDs. (isl_id_for_pbb): Use ssa_name_version_typesize. (simple_copy_phi_p): Move declarations closer to assignment. (build_pbb_scattering_polyhedrons): Same. (build_scop_scattering): Same. (isl_id_for_ssa_name): Same. (extract_affine_name): Same. (extract_affine_int): Same. (extract_affine): Same. (set_scop_parameter_dim): Use renamed member. (build_loop_iteration_domains): Same. (add_param_constraints): Same. (build_scop_iteration_domain): Same. (pdr_add_data_dimensions): Same. (build_poly_dr): Same. (build_scop_drs): Move declarations closer to assignment. (analyze_drs_in_stmts): Same. (insert_out_of_ssa_copy): Same. (insert_out_of_ssa_copy_on_edge): Same. (propagate_expr_outside_region): Same. (rewrite_phi_out_of_ssa): Same. (rewrite_degenerate_phi): Same. (rewrite_reductions_out_of_ssa): Same. (rewrite_cross_bb_scalar_dependence): Same. (handle_scalar_deps_crossing_scop_limits): Same. (rewrite_cross_bb_scalar_deps): Same. * graphite.c (graphite_transform_loops): Use renamed member. From-SVN: r228528
2015-10-06 17:56:03 +02:00
int old_max_operations = isl_ctx_get_max_operations (scop->isl_context);
int max_operations = PARAM_VALUE (PARAM_MAX_ISL_OPERATIONS);
if (max_operations)
Move declarations, assign types, renaming. 1. Move declarations near the assignment/usage. 2. Assign type to members which were void*. 3. Rename scop->context to scop::param_context, and scop::ctx to scop::isl_context No functional changes intended. Passes regtest and bootstrap. gcc/ChangeLog: 2015-10-05 Aditya Kumar <aditya.k7@samsung.com> * graphite-dependences.c (scop_get_reads): Renamed scop->context to scop->param_context. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Same. (scop_get_transformed_schedule): Same. (subtract_commutative_associative_deps): Same. * graphite-isl-ast-to-gimple.c (add_parameters_to_ivs_params): Same. (generate_isl_context): Same. (generate_isl_schedule): Same. (scop_to_isl_ast): Same. (graphite_regenerate_ast_isl): Same. * graphite-optimize-isl.c (scop_get_domains): Same. (optimize_isl): Renamed scop->context to scop->param_context. * graphite-poly.c (new_poly_bb): Change the type of argument to gimple_poly_bb_p. (new_scop): Renamed scop->context to scop->param_context. (free_scop): Same. (print_scop_context): Same. * graphite-poly.h (new_poly_dr): Change the type of argument from void* to data_reference_p. (struct poly_bb): Change the type of black_box to gimple_poly_bb_p. (new_poly_bb): Change the type of argument from void* to gimple_poly_bb_p. (pbb_set_black_box): Same. (struct scop): Rename context to param_context, ctx to isl_context. * graphite-scop-detection.c (scop_detection::build_scop_bbs_1): Move declarations closer to assignment. (find_params_in_bb): Same. (find_scop_parameters): Same. * graphite-sese-to-poly.c (unsigned ssa_name_version_typesize): Global to be used for statement IDs. (isl_id_for_pbb): Use ssa_name_version_typesize. (simple_copy_phi_p): Move declarations closer to assignment. (build_pbb_scattering_polyhedrons): Same. (build_scop_scattering): Same. (isl_id_for_ssa_name): Same. (extract_affine_name): Same. (extract_affine_int): Same. (extract_affine): Same. (set_scop_parameter_dim): Use renamed member. (build_loop_iteration_domains): Same. (add_param_constraints): Same. (build_scop_iteration_domain): Same. (pdr_add_data_dimensions): Same. (build_poly_dr): Same. (build_scop_drs): Move declarations closer to assignment. (analyze_drs_in_stmts): Same. (insert_out_of_ssa_copy): Same. (insert_out_of_ssa_copy_on_edge): Same. (propagate_expr_outside_region): Same. (rewrite_phi_out_of_ssa): Same. (rewrite_degenerate_phi): Same. (rewrite_reductions_out_of_ssa): Same. (rewrite_cross_bb_scalar_dependence): Same. (handle_scalar_deps_crossing_scop_limits): Same. (rewrite_cross_bb_scalar_deps): Same. * graphite.c (graphite_transform_loops): Use renamed member. From-SVN: r228528
2015-10-06 17:56:03 +02:00
isl_ctx_set_max_operations (scop->isl_context, max_operations);
isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_CONTINUE);
isl_union_set *domain = scop_get_domains (scop);
scop_get_dependences (scop);
scop->dependence
= isl_union_map_gist_domain (scop->dependence, isl_union_set_copy (domain));
scop->dependence
= isl_union_map_gist_range (scop->dependence, isl_union_set_copy (domain));
isl_union_map *validity = isl_union_map_copy (scop->dependence);
isl_union_map *proximity = isl_union_map_copy (validity);
isl_options_set_schedule_fuse (scop->isl_context, ISL_SCHEDULE_FUSE_MIN);
isl_schedule *schedule
= isl_union_set_compute_schedule (domain, validity, proximity);
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
Move declarations, assign types, renaming. 1. Move declarations near the assignment/usage. 2. Assign type to members which were void*. 3. Rename scop->context to scop::param_context, and scop::ctx to scop::isl_context No functional changes intended. Passes regtest and bootstrap. gcc/ChangeLog: 2015-10-05 Aditya Kumar <aditya.k7@samsung.com> * graphite-dependences.c (scop_get_reads): Renamed scop->context to scop->param_context. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Same. (scop_get_transformed_schedule): Same. (subtract_commutative_associative_deps): Same. * graphite-isl-ast-to-gimple.c (add_parameters_to_ivs_params): Same. (generate_isl_context): Same. (generate_isl_schedule): Same. (scop_to_isl_ast): Same. (graphite_regenerate_ast_isl): Same. * graphite-optimize-isl.c (scop_get_domains): Same. (optimize_isl): Renamed scop->context to scop->param_context. * graphite-poly.c (new_poly_bb): Change the type of argument to gimple_poly_bb_p. (new_scop): Renamed scop->context to scop->param_context. (free_scop): Same. (print_scop_context): Same. * graphite-poly.h (new_poly_dr): Change the type of argument from void* to data_reference_p. (struct poly_bb): Change the type of black_box to gimple_poly_bb_p. (new_poly_bb): Change the type of argument from void* to gimple_poly_bb_p. (pbb_set_black_box): Same. (struct scop): Rename context to param_context, ctx to isl_context. * graphite-scop-detection.c (scop_detection::build_scop_bbs_1): Move declarations closer to assignment. (find_params_in_bb): Same. (find_scop_parameters): Same. * graphite-sese-to-poly.c (unsigned ssa_name_version_typesize): Global to be used for statement IDs. (isl_id_for_pbb): Use ssa_name_version_typesize. (simple_copy_phi_p): Move declarations closer to assignment. (build_pbb_scattering_polyhedrons): Same. (build_scop_scattering): Same. (isl_id_for_ssa_name): Same. (extract_affine_name): Same. (extract_affine_int): Same. (extract_affine): Same. (set_scop_parameter_dim): Use renamed member. (build_loop_iteration_domains): Same. (add_param_constraints): Same. (build_scop_iteration_domain): Same. (pdr_add_data_dimensions): Same. (build_poly_dr): Same. (build_scop_drs): Move declarations closer to assignment. (analyze_drs_in_stmts): Same. (insert_out_of_ssa_copy): Same. (insert_out_of_ssa_copy_on_edge): Same. (propagate_expr_outside_region): Same. (rewrite_phi_out_of_ssa): Same. (rewrite_degenerate_phi): Same. (rewrite_reductions_out_of_ssa): Same. (rewrite_cross_bb_scalar_dependence): Same. (handle_scalar_deps_crossing_scop_limits): Same. (rewrite_cross_bb_scalar_deps): Same. * graphite.c (graphite_transform_loops): Use renamed member. From-SVN: r228528
2015-10-06 17:56:03 +02:00
isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_ABORT);
Move declarations, assign types, renaming. 1. Move declarations near the assignment/usage. 2. Assign type to members which were void*. 3. Rename scop->context to scop::param_context, and scop::ctx to scop::isl_context No functional changes intended. Passes regtest and bootstrap. gcc/ChangeLog: 2015-10-05 Aditya Kumar <aditya.k7@samsung.com> * graphite-dependences.c (scop_get_reads): Renamed scop->context to scop->param_context. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Same. (scop_get_transformed_schedule): Same. (subtract_commutative_associative_deps): Same. * graphite-isl-ast-to-gimple.c (add_parameters_to_ivs_params): Same. (generate_isl_context): Same. (generate_isl_schedule): Same. (scop_to_isl_ast): Same. (graphite_regenerate_ast_isl): Same. * graphite-optimize-isl.c (scop_get_domains): Same. (optimize_isl): Renamed scop->context to scop->param_context. * graphite-poly.c (new_poly_bb): Change the type of argument to gimple_poly_bb_p. (new_scop): Renamed scop->context to scop->param_context. (free_scop): Same. (print_scop_context): Same. * graphite-poly.h (new_poly_dr): Change the type of argument from void* to data_reference_p. (struct poly_bb): Change the type of black_box to gimple_poly_bb_p. (new_poly_bb): Change the type of argument from void* to gimple_poly_bb_p. (pbb_set_black_box): Same. (struct scop): Rename context to param_context, ctx to isl_context. * graphite-scop-detection.c (scop_detection::build_scop_bbs_1): Move declarations closer to assignment. (find_params_in_bb): Same. (find_scop_parameters): Same. * graphite-sese-to-poly.c (unsigned ssa_name_version_typesize): Global to be used for statement IDs. (isl_id_for_pbb): Use ssa_name_version_typesize. (simple_copy_phi_p): Move declarations closer to assignment. (build_pbb_scattering_polyhedrons): Same. (build_scop_scattering): Same. (isl_id_for_ssa_name): Same. (extract_affine_name): Same. (extract_affine_int): Same. (extract_affine): Same. (set_scop_parameter_dim): Use renamed member. (build_loop_iteration_domains): Same. (add_param_constraints): Same. (build_scop_iteration_domain): Same. (pdr_add_data_dimensions): Same. (build_poly_dr): Same. (build_scop_drs): Move declarations closer to assignment. (analyze_drs_in_stmts): Same. (insert_out_of_ssa_copy): Same. (insert_out_of_ssa_copy_on_edge): Same. (propagate_expr_outside_region): Same. (rewrite_phi_out_of_ssa): Same. (rewrite_degenerate_phi): Same. (rewrite_reductions_out_of_ssa): Same. (rewrite_cross_bb_scalar_dependence): Same. (handle_scalar_deps_crossing_scop_limits): Same. (rewrite_cross_bb_scalar_deps): Same. * graphite.c (graphite_transform_loops): Use renamed member. From-SVN: r228528
2015-10-06 17:56:03 +02:00
isl_ctx_reset_operations (scop->isl_context);
isl_ctx_set_max_operations (scop->isl_context, old_max_operations);
if (!schedule || isl_ctx_last_error (scop->isl_context) == isl_error_quota)
{
if (dump_file && dump_flags)
{
if (!schedule)
fprintf (dump_file, "isl did not return any schedule.\n");
else
fprintf (dump_file, "isl timed out --param max-isl-operations=%d\n",
max_operations);
}
if (schedule)
isl_schedule_free (schedule);
return false;
}
scop->schedule = schedule;
isl_union_map *schedule_map = get_schedule_map (schedule);
apply_schedule_map_to_scop (scop, schedule_map);
isl_union_map_free (schedule_map);
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
if (dump_file)
{
fprintf (dump_file, "isl end schedule:\n");
print_isl_schedule (dump_file, scop->schedule);
}
return true;
}
new scop schedule for isl-0.15 Keep unchanged the implementation for isl-0.14. * graphite-poly.c (apply_poly_transforms): Simplify. (print_isl_set): Use more readable format: ISL_YAML_STYLE_BLOCK. (print_isl_map): Same. (print_isl_union_map): Same. (print_isl_schedule): New. (debug_isl_schedule): New. * graphite-dependences.c (scop_get_reads): Do not call isl_union_map_add_map that is undocumented isl functionality. (scop_get_must_writes): Same. (scop_get_may_writes): Same. (scop_get_original_schedule): Remove. (scop_get_dependences): Do not call isl_union_map_compute_flow that is deprecated in isl 0.15. Instead, use isl_union_access_* interface. (compute_deps): Remove. * graphite-isl-ast-to-gimple.c (print_schedule_ast): New. (debug_schedule_ast): New. (translate_isl_ast_to_gimple::scop_to_isl_ast): Call set_separate_option. (graphite_regenerate_ast_isl): Add dump. (translate_isl_ast_to_gimple::scop_to_isl_ast): Generate code from scop->transformed_schedule. (graphite_regenerate_ast_isl): Add more dump. * graphite-optimize-isl.c (optimize_isl): Set scop->transformed_schedule. Check whether schedules are equal. (apply_poly_transforms): Move here. * graphite-poly.c (apply_poly_transforms): ... from here. (free_poly_bb): Static. (free_scop): Static. (pbb_number_of_iterations_at_time): Remove. (print_isl_ast): New. (debug_isl_ast): New. (debug_scop_pbb): New. * graphite-scop-detection.c (print_edge): Move. (print_sese): Move. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove. (build_scop_scattering): Remove. (create_pw_aff_from_tree): Assert instead of bailing out. (add_condition_to_pbb): Remove unused code, do not fail. (add_conditions_to_domain): Same. (add_conditions_to_constraints): Remove. (build_scop_context): New. (add_iter_domain_dimension): New. (build_iteration_domains): Initialize pbb->iterators. Call add_conditions_to_domain. (nested_in): New. (loop_at): New. (index_outermost_in_loop): New. (index_pbb_in_loop): New. (outermost_pbb_in): New. (add_in_sequence): New. (add_outer_projection): New. (outer_projection_mupa): New. (add_loop_schedule): New. (build_schedule_pbb): New. (build_schedule_loop): New. (embed_in_surrounding_loops): New. (build_schedule_loop_nest): New. (build_original_schedule): New. (build_poly_scop): Call build_original_schedule. * graphite.h: Declare print_isl_schedule and debug_isl_schedule. (free_poly_dr): Remove. (struct poly_bb): Add iterators. Remove schedule, transformed, saved. (free_poly_bb): Remove. (debug_loop_vec): Remove. (print_isl_ast): Declare. (debug_isl_ast): Declare. (scop_do_interchange): Remove. (scop_do_strip_mine): Remove. (scop_do_block): Remove. (flatten_all_loops): Remove. (optimize_isl): Remove. (pbb_number_of_iterations_at_time): Remove. (debug_scop_pbb): Declare. (print_schedule_ast): Declare. (debug_schedule_ast): Declare. (struct scop): Remove schedule. Add original_schedule, transformed_schedule. (free_gimple_poly_bb): Remove. (print_generated_program): Remove. (debug_generated_program): Remove. (unify_scattering_dimensions): Remove. * sese.c (print_edge): ... here. (print_sese): ... here. (debug_edge): ... here. (debug_sese): ... here. * sese.h (print_edge): Declare. (print_sese): Declare. (dump_edge): Declare. (dump_sese): Declare. Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r232812
2016-01-26 01:19:20 +01:00
/* Apply graphite transformations to all the basic blocks of SCOP. */
bool
apply_poly_transforms (scop_p scop)
{
if (flag_loop_nest_optimize)
return optimize_isl (scop);
if (!flag_graphite_identity && !flag_loop_parallelize_all)
return false;
/* Generate code even if we did not apply any real transformation.
This also allows to check the performance for the identity
transformation: GIMPLE -> GRAPHITE -> GIMPLE. */
return true;
}
#endif /* HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS */
#endif /* HAVE_isl */