GCC Middle and Back End API Reference
|
Data Structures | |
struct | sd_region_p |
struct | scopdet_info |
Typedefs | |
typedef enum gbb_type | gbb_type |
typedef struct sd_region_p | sd_region |
Enumerations | |
enum | gbb_type { GBB_UNKNOWN, GBB_LOOP_SING_EXIT_HEADER, GBB_LOOP_MULT_EXIT_HEADER, GBB_LOOP_EXIT, GBB_COND_HEADER, GBB_SIMPLE, GBB_LAST } |
typedef struct sd_region_p sd_region |
A SCoP detection region, defined using bbs as borders. All control flow touching this region, comes in passing basic_block ENTRY and leaves passing basic_block EXIT. By using bbs instead of edges for the borders we are able to represent also regions that do not have a single entry or exit edge. But as they have a single entry basic_block and a single exit basic_block, we are able to generate for every sd_region a single entry and exit edge. 1 2 \ / 3 <- entry | 4 / \ This region contains: {3, 4, 5, 6, 7, 8} 5 6 | | 7 8 \ / 9 <- exit
enum gbb_type |
|
static |
Checks if a bb is contained in REGION.
References bb_in_region(), sd_region_p::entry, and sd_region_p::exit.
Referenced by build_graphite_scops(), find_single_entry_edge(), find_single_exit_edge(), and mark_exit_edges().
Create graphite SCoPs from an array of scop detection REGIONS.
References bb_in_sd_region(), sd_region_p::entry, scopdet_info::exit, find_single_entry_edge(), find_single_exit_edge(), new_scop(), and new_sese().
Referenced by build_scops(), and limit_scops().
void build_scops | ( | ) |
Find Static Control Parts (SCoP) in the current function and pushes them to SCOPS.
References build_graphite_scops(), build_scops_1(), canonicalize_loop_closed_ssa_form(), create_sese_edges(), dump_file, dump_flags, limit_scops(), basic_block_def::loop_father, print_graphite_statistics(), and single_succ().
Referenced by graphite_transform_loops().
|
staticread |
Starting from CURRENT we walk the dominance tree and add new sd_regions to SCOPS. The analyse if a sd_region can be handled is based on the value of OUTERMOST_LOOP. Only loops inside OUTERMOST loops may change. LOOP is the loop in which CURRENT is handled. TODO: These functions got a little bit big. They definitely should be cleaned up.
References scopdet_info::difficult, sd_region_p::entry, sd_region_p::exit, scopdet_info::exit, scopdet_info::exits, get_bb_type(), scopdet_info::next, and scopdet_basic_block_info().
Referenced by build_scops(), and scopdet_basic_block_info().
|
static |
Transforms LOOP to the canonical loop closed SSA form.
References add_phi_arg(), CDI_POST_DOMINATORS, create_new_def_for(), create_phi_node(), edge_def::dest, edge_def::flags, free_dominance_info(), gimple_phi_arg_def(), gimple_phi_arg_edge(), gimple_phi_arg_imm_use_ptr(), gimple_phi_num_args(), gimple_phi_result_ptr(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), make_close_phi_nodes_unique(), replace_exp(), single_exit(), single_pred_p(), single_succ_edge(), split_block_after_labels(), split_edge(), edge_def::src, and update_stmt().
Referenced by canonicalize_loop_closed_ssa_form().
|
static |
Converts the current loop closed SSA form to a canonical form expected by the Graphite code generation. The loop closed SSA form has the following invariant: a variable defined in a loop that is used outside the loop appears only in the phi nodes in the destination of the loop exit. These phi nodes are called close phi nodes. The canonical loop closed SSA form contains the extra invariants: - when the loop contains only one exit, the close phi nodes contain only one argument. That implies that the basic block that contains the close phi nodes has only one predecessor, that is a basic block in the loop. - the basic block containing the close phi nodes does not contain other statements. - there exist only one phi node per definition in the loop.
References canonicalize_loop_closed_ssa(), rewrite_into_loop_closed_ssa(), update_ssa(), and verify_loop_closed_ssa().
Referenced by build_scops().
|
static |
Returns true when BB contains only close phi nodes.
References gsi_end_p(), gsi_next(), gsi_start_bb(), and gsi_stmt().
Referenced by limit_scops().
|
static |
Create for all scop regions a single entry and a single exit edge.
References calculate_dominance_info(), CDI_DOMINATORS, create_single_entry_edge(), create_single_exit_edge(), sd_region_p::exit, find_single_exit_edge(), fix_loop_structure(), mark_exit_edges(), unmark_exit_edges(), verify_loop_structure(), and verify_ssa().
Referenced by build_scops(), and limit_scops().
|
static |
Create a single entry edge for REGION.
References CDI_DOMINATORS, edge_def::dest, dominated_by_p(), sd_region_p::entry, sd_region_p::exit, find_single_entry_edge(), loop::header, basic_block_def::loop_father, loop_latch_edge(), split_block_after_labels(), and edge_def::src.
Referenced by create_sese_edges().
|
static |
Create a single exit edge for REGION.
References edge_def::aux, edge_def::dest, sd_region_p::exit, scopdet_info::exit, find_single_exit_edge(), make_forwarder_block(), basic_block_def::preds, sd_region_without_exit(), single_succ_edge(), and edge_def::src.
Referenced by create_sese_edges().
DEBUG_FUNCTION void dot_all_scops | ( | ) |
Display all SCoPs using dotty.
References dot_all_scops_1().
|
static |
Pretty print to FILE all the SCoPs in DOT format and mark them with different colors. If there are not enough colors, paint the remaining SCoPs in gray. Special nodes: - "*" after the node number denotes the entry of a SCoP, - "#" after the node number denotes the exit of a SCoP, - "()" around the node number denotes the entry or the exit nodes of the SCOP. These are not part of SCoP.
References bb_in_sese_p(), color(), edge_def::dest, dump_flags, basic_block_def::index, and basic_block_def::succs.
Referenced by dot_all_scops(), and dot_scop().
DEBUG_FUNCTION void dot_scop | ( | ) |
Display all SCoPs using dotty.
References dot_all_scops_1(), and vNULL.
|
static |
Returns the single entry edge of REGION, if it does not exits NULL.
References bb_in_sd_region(), sd_region_p::entry, basic_block_def::preds, and edge_def::src.
Referenced by build_graphite_scops(), and create_single_entry_edge().
|
static |
Returns the single exit edge of REGION, if it does not exits NULL.
References bb_in_sd_region(), sd_region_p::exit, scopdet_info::exit, basic_block_def::preds, and edge_def::src.
Referenced by build_graphite_scops(), create_sese_edges(), and create_single_exit_edge().
|
static |
Detect the type of BB. Loop headers are only marked, if they are new. This means their loop_father is different to LAST_LOOP. Otherwise they are treated like any other bb and their type can be any other type.
References CDI_DOMINATORS, dom, GBB_COND_HEADER, GBB_LAST, GBB_LOOP_MULT_EXIT_HEADER, GBB_LOOP_SING_EXIT_HEADER, GBB_SIMPLE, get_dominated_by(), basic_block_def::loop_father, loop::num, single_exit(), and single_succ_p().
Referenced by build_scops_1().
|
static |
Return true when EXPR can be represented in the polyhedral model. This means an expression can be represented, if it is linear with respect to the loops and the strides are non parametric. LOOP is the place where the expr will be evaluated. SCOP_ENTRY defines the entry of the region we analyse.
References analyze_scalar_evolution(), graphite_can_represent_scev(), and instantiate_scev().
Referenced by graphite_can_represent_loop(), and stmt_simple_for_scop_p().
|
static |
Something like "n * m" is not allowed.
References chrec_contains_symbols(), and host_integerp().
Referenced by graphite_can_represent_scev().
|
static |
Return true if LOOP can be represented in the polyhedral representation. This is evaluated taking SCOP_ENTRY and OUTERMOST_LOOP in mind.
References chrec_contains_undetermined(), tree_niter_desc::control, graphite_can_represent_expr(), affine_iv::no_overflow, number_of_iterations_exit(), number_of_latch_executions(), and single_exit().
Referenced by scopdet_basic_block_info().
|
static |
Return true when SCEV can be represented in the polyhedral model. An expression can be represented, if it can be expressed as an affine expression. For loops (i, j) and parameters (m, n) all affine expressions are of the form: x1 * i + x2 * j + x3 * m + x4 * n + x5 * 1 where x1..x5 element of Z 1 i + 20 j + (-2) m + 25 Something like "i * n" or "n * m" is not allowed.
References chrec_contains_symbols(), chrec_contains_undetermined(), evolution_function_right_is_integer_cst(), graphite_can_represent_init(), and scev_is_linear_expression().
Referenced by graphite_can_represent_expr(), and stmt_has_simple_data_refs_p().
|
static |
Returns the statement of BB that contains a harmful operation: that can be a function call with side effects, the induction variables are not linear with respect to SCOP_ENTRY, etc. The current open scop should end before this statement. The evaluation is limited using OUTERMOST_LOOP as outermost loop that may change.
References gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), and stmt_simple_for_scop_p().
Referenced by scopdet_basic_block_info().
|
static |
We limit all SCoPs to SCoPs, that are completely surrounded by a loop. Example: for (i | { | for (j | SCoP 1 for (k | } | * SCoP frontier, as this line is not surrounded by any loop. * for (l | SCoP 2 This is necessary as scalar evolution and parameter detection need a outermost loop to initialize parameters correctly. TODO: FIX scalar evolution and parameter detection to allow more flexible SCoP frontiers.
References build_graphite_scops(), build_sese_loop_nests(), contains_only_close_phi_nodes(), create_sese_edges(), edge_def::dest, sd_region_p::entry, sd_region_p::exit, free_scops(), loop::header, loop_in_sese_p(), loop_outer(), single_exit(), single_succ_edge(), and single_succ_p().
Referenced by build_scops().
|
static |
@verbatim Detection of Static Control Parts (SCoP) for Graphite.
Copyright (C) 2009-2013 Free Software Foundation, Inc. Contributed by Sebastian Pop sebas and Tobias Grosser tian .pop@ amd. comgross. er@f im.un i-pa ssau. de
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/.
Forward declarations.
Referenced by canonicalize_loop_closed_ssa(), and remove_duplicate_close_phi().
|
static |
Removes all the close phi duplicates from BB.
References gimple_phi_num_args(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), remove_duplicate_close_phi(), and same_close_phi_node().
|
static |
Mark the exit edges of all REGIONS. See comment in "create_single_exit_edge".
References edge_def::aux, bb_in_sd_region(), sd_region_p::exit, basic_block_def::preds, and edge_def::src.
Referenced by create_sese_edges().
|
static |
Moves the scops from SOURCE to TARGET and clean up SOURCE.
Referenced by scopdet_basic_block_info().
|
static |
Print statistics for SCOP to FILE.
References bb_in_sese_p(), basic_block_def::count, gsi_end_p(), gsi_next(), gsi_start_bb(), loop::header, basic_block_def::loop_father, loop_in_sese_p(), and basic_block_def::succs.
Referenced by print_graphite_statistics().
|
static |
Print statistics for SCOPS to FILE.
References print_graphite_scop_statistics().
Referenced by build_scops().
|
static |
Remove the close phi node at GSI and replace its rhs with the rhs of PHI.
References gimple_phi_num_args(), gimple_phi_result(), gsi_stmt(), make_close_phi_nodes_unique(), remove_phi_node(), same_close_phi_node(), and update_stmt().
Referenced by make_close_phi_nodes_unique().
|
inlinestatic |
Returns true when P1 and P2 are close phis with the same argument.
References gimple_phi_arg_def(), and operand_equal_p().
Referenced by make_close_phi_nodes_unique(), and remove_duplicate_close_phi().
|
staticread |
Calculates BB infos. If bb is difficult we add valid SCoPs dominated by BB to SCOPS. TYPE is the gbb_type of BB.
References build_scops_1(), CDI_DOMINATORS, edge_def::dest, scopdet_info::difficult, dominated_by_p(), sd_region_p::entry, sd_region_p::exit, scopdet_info::exit, scopdet_info::exits, find_common_loop(), GBB_COND_HEADER, GBB_LAST, GBB_LOOP_MULT_EXIT_HEADER, GBB_LOOP_SING_EXIT_HEADER, GBB_SIMPLE, get_dominated_by(), get_loop_exit_edges(), graphite_can_represent_loop(), harmful_stmt_in_bb(), loop::header, loop_depth(), loop_exits_to_bb_p(), basic_block_def::loop_father, loop_outer(), move_sd_regions(), scopdet_info::next, single_exit(), single_pred(), single_pred_p(), single_succ(), single_succ_p(), and edge_def::src.
Referenced by build_scops_1().
|
static |
Check if the sd_region, mentioned in EDGE, has no exit bb.
References edge_def::aux, and sd_region_p::exit.
Referenced by create_single_exit_edge().
Return true if the data references of STMT can be represented by Graphite.
References DR_ACCESS_FN, DR_NUM_DIMENSIONS, free_data_refs(), graphite_can_represent_scev(), graphite_find_data_references_in_stmt(), loop_containing_stmt(), loop_outer(), and vNULL.
Referenced by stmt_simple_for_scop_p().
|
static |
Return true only when STMT is simple enough for being handled by Graphite. This depends on SCOP_ENTRY, as the parameters are initialized relatively to this basic block, the linear functions are initialized to OUTERMOST_LOOP and BB is the place where we try to evaluate the STMT.
References gimple_call_flags(), gimple_cond_code(), gimple_has_volatile_ops(), graphite_can_represent_expr(), is_gimple_debug(), basic_block_def::loop_father, and stmt_has_simple_data_refs_p().
Referenced by harmful_stmt_in_bb().
|
static |
Unmark the exit edges of all REGIONS. See comment in "create_single_exit_edge".
References edge_def::aux, sd_region_p::exit, and basic_block_def::preds.
Referenced by create_sese_edges().