GCC Middle and Back End API Reference
graphite-sese-to-poly.c File Reference

Data Structures

struct  bsc

Functions

static void tree_int_to_gmp ()
static size_t phi_arg_in_outermost_loop ()
static void remove_simple_copy_phi ()
static void remove_invariant_phi ()
static bool simple_copy_phi_p ()
static bool reduction_phi_p ()
static gimple_bb_p new_gimple_bb ()
static void free_data_refs_aux ()
static void free_gimple_bb ()
static void remove_gbbs_in_scop ()
void free_scops ()
static loop_p outermost_loop_in_sese_1 ()
static gimple_bb_p try_generate_gimple_bb ()
static bool all_non_dominated_preds_marked_p ()
static int compare_bb_depths ()
static void graphite_sort_dominated_info ()
static void build_scop_bbs_1 ()
static void build_scop_bbs ()
static isl_id * isl_id_for_pbb ()
static void build_pbb_scattering_polyhedrons (isl_aff *static_sched, poly_bb_p pbb, int scattering_dimensions)
static void build_scop_scattering ()
static isl_pw_aff * extract_affine (scop_p, tree, __isl_take isl_space *space)
static isl_pw_aff * extract_affine_chrec ()
static isl_pw_aff * extract_affine_mul ()
static isl_id * isl_id_for_ssa_name ()
static isl_id * isl_id_for_dr ()
static isl_pw_aff * extract_affine_name ()
static isl_pw_aff * extract_affine_gmp ()
static isl_pw_aff * extract_affine_int ()
static isl_pw_aff * wrap ()
static int parameter_index_in_region_1 ()
static int parameter_index_in_region ()
static isl_pw_aff * extract_affine ()
static void scan_tree_for_params ()
static void find_params_in_bb ()
static void find_scop_parameters ()
static void build_loop_iteration_domains (scop_p scop, struct loop *loop, int nb, isl_set *outer, isl_set **doms)
static isl_pw_aff * create_pw_aff_from_tree ()
static void add_condition_to_pbb ()
static void add_conditions_to_domain ()
static void add_conditions_to_constraints ()
static gimple single_pred_cond_non_loop_exit ()
static void build_sese_conditions_before (struct dom_walk_data *dw_data, basic_block bb)
static void build_sese_conditions_after (struct dom_walk_data *dw_data, basic_block bb)
static void build_sese_conditions ()
static void add_param_constraints ()
static void build_scop_context ()
static void build_scop_iteration_domain ()
static isl_map * pdr_add_alias_set ()
static isl_map * set_index ()
static isl_map * pdr_add_memory_accesses ()
static isl_set * pdr_add_data_dimensions ()
static void build_poly_dr ()
static bool write_alias_graph_to_ascii_dimacs (FILE *file, char *comment, vec< data_reference_p > drs)
static bool write_alias_graph_to_ascii_dot (FILE *file, char *comment, vec< data_reference_p > drs)
static bool write_alias_graph_to_ascii_ecc (FILE *file, char *comment, vec< data_reference_p > drs)
static bool dr_same_base_object_p (const struct data_reference *dr1, const struct data_reference *dr2)
static int build_alias_set_optimal_p ()
static void build_base_obj_set_for_drs ()
static void build_pbb_drs ()
static void dump_alias_graphs ()
static void build_scop_drs ()
static gimple_stmt_iterator gsi_for_phi_node ()
static void analyze_drs_in_stmts ()
static void insert_stmts (scop_p scop, gimple stmt, gimple_seq stmts, gimple_stmt_iterator insert_gsi)
static void insert_out_of_ssa_copy ()
static void new_pbb_from_pbb ()
static void insert_out_of_ssa_copy_on_edge ()
static tree create_zero_dim_array ()
static bool scalar_close_phi_node_p ()
static void propagate_expr_outside_region ()
static void rewrite_close_phi_out_of_ssa ()
static void rewrite_phi_out_of_ssa ()
static void rewrite_degenerate_phi ()
static void rewrite_reductions_out_of_ssa ()
static void rewrite_cross_bb_scalar_dependence (scop_p scop, tree zero_dim_array, tree def, gimple use_stmt)
static void handle_scalar_deps_crossing_scop_limits ()
static bool rewrite_cross_bb_scalar_deps ()
static void rewrite_cross_bb_scalar_deps_out_of_ssa ()
static int nb_pbbs_in_loops ()
static int nb_data_writes_in_bb ()
static edge split_pbb ()
static basic_block split_reduction_stmt ()
static bool is_reduction_operation_p ()
static bool phi_contains_arg ()
static gimple follow_ssa_with_commutative_ops ()
static gimple detect_commutative_reduction_arg (tree lhs, gimple stmt, tree arg, vec< gimple > *in, vec< gimple > *out)
static gimple detect_commutative_reduction_assign (gimple stmt, vec< gimple > *in, vec< gimple > *out)
static gimple follow_inital_value_to_phi ()
static edge edge_initial_value_for_loop_phi ()
static tree initial_value_for_loop_phi ()
static bool used_outside_reduction ()
static gimple detect_commutative_reduction (scop_p scop, gimple stmt, vec< gimple > *in, vec< gimple > *out)
static void translate_scalar_reduction_to_array_for_stmt (scop_p scop, tree red, gimple stmt, gimple loop_phi)
static void remove_phi ()
static bool dr_indices_valid_in_loop ()
static tree close_phi_written_to_memory ()
static void translate_scalar_reduction_to_array (scop_p scop, vec< gimple > in, vec< gimple > out)
static bool rewrite_commutative_reductions_out_of_ssa_close_phi (scop_p scop, gimple close_phi)
static bool rewrite_commutative_reductions_out_of_ssa_loop (scop_p scop, loop_p loop)
static void rewrite_commutative_reductions_out_of_ssa ()
static bool scop_ivs_can_be_represented ()
void build_poly_scop ()

Function Documentation

static void add_condition_to_pbb ( )
static
Add conditional statement STMT to pbb.  CODE is used as the comparison
   operator.  This allows us to invert the condition or to handle
   inequalities.   

References create_pw_aff_from_tree(), poly_bb::domain, gimple_cond_lhs(), and gimple_cond_rhs().

Referenced by add_conditions_to_domain().

static void add_conditions_to_constraints ( )
static
Traverses all the GBBs of the SCOP and add their constraints to the
   iteration domains.   

References add_conditions_to_domain().

Referenced by build_poly_scop().

static void add_conditions_to_domain ( )
static
Add conditions to the domain of PBB.   

References add_condition_to_pbb(), gimple_cond_code(), invert_tree_comparison(), and is_empty().

Referenced by add_conditions_to_constraints().

static void add_param_constraints ( )
static
Add constraints on the possible values of parameter P from the type
   of P.   

References scop::context, g, lower_bound_in_type(), tree_int_to_gmp(), and upper_bound_in_type().

Referenced by build_scop_context().

static bool all_non_dominated_preds_marked_p ( )
static
Returns true if all predecessors of BB, that are not dominated by BB, are
   marked in MAP.  The predecessors dominated by BB are loop latches and will
   be handled after BB.   

References bitmap_bit_p(), CDI_DOMINATORS, dominated_by_p(), basic_block_def::index, basic_block_def::preds, and edge_def::src.

Referenced by build_scop_bbs_1().

static void analyze_drs_in_stmts ( )
static
static int build_alias_set_optimal_p ( )
static
Uses DFS component number as representative of alias-sets. Also tests for
   optimality by verifying if every connected component is a clique. Returns
   true (1) if the above test is true, and false (0) otherwise.   

References add_edge(), base_alias_pair::alias_set, data_reference::aux, vertex::component, dr_may_alias_p(), free(), free_graph(), g, graphds_dfs(), graph::n_vertices, new_graph(), vertex::pred, graph_edge::pred_next, graph_edge::src, and graph::vertices.

Referenced by build_scop_drs().

static void build_base_obj_set_for_drs ( )
static
static void build_loop_iteration_domains ( scop_p  scop,
struct loop loop,
int  nb,
isl_set *  outer,
isl_set **  doms 
)
static
static void build_pbb_drs ( )
static
Build the data references for PBB.   

References build_poly_dr().

Referenced by build_scop_drs().

static void build_pbb_scattering_polyhedrons ( isl_aff *  static_sched,
poly_bb_p  pbb,
int  scattering_dimensions 
)
static
Converts the STATIC_SCHEDULE of PBB into a scattering polyhedron.
   We generate SCATTERING_DIMENSIONS scattering dimensions.

   CLooG 0.15.0 and previous versions require, that all
   scattering functions of one CloogProgram have the same number of
   scattering dimensions, therefore we allow to specify it.  This
   should be removed in future versions of CLooG.

   The scattering polyhedron consists of these dimensions: scattering,
   loop_iterators, parameters.

   Example:

   | scattering_dimensions = 5
   | used_scattering_dimensions = 3
   | nb_iterators = 1
   | scop_nb_params = 2
   |
   | Schedule:
   |   i
   | 4 5
   |
   | Scattering polyhedron:
   |
   | scattering: {s1, s2, s3, s4, s5}
   | loop_iterators: {i}
   | parameters: {p1, p2}
   |
   | s1  s2  s3  s4  s5  i   p1  p2  1
   | 1   0   0   0   0   0   0   0  -4  = 0
   | 0   1   0   0   0  -1   0   0   0  = 0
   | 0   0   1   0   0   0   0   0  -5  = 0   

References poly_bb::domain, pbb_dim_iter_domain(), poly_bb::schedule, and poly_bb::transformed.

Referenced by build_scop_scattering().

static void build_scop_bbs ( )
static
Gather the basic blocks belonging to the SCOP.   

References bitmap_clear(), build_scop_bbs_1(), sbitmap_alloc(), sbitmap_free(), and visited.

Referenced by build_poly_scop().

static void build_scop_context ( )
static
Build the context of the SCOP.  The context usually contains extra
   constraints that are added to the iteration domains that constrain
   some parameters.   

References add_param_constraints(), and scop_nb_params().

Referenced by build_poly_scop().

static void build_scop_drs ( )
static
static void build_scop_iteration_domain ( )
static
Build the iteration domains: the loops belonging to the current
   SCOP, and that vary for the execution of the current basic block.
   Returns false if there is no loop in SCOP.   

References build_loop_iteration_domains(), cfun, scop::context, poly_bb::domain, free(), isl_id_for_pbb(), loop_in_sese_p(), loop_outer(), loop::num, number_of_loops(), and pbb_loop().

Referenced by build_poly_scop().

static void build_scop_scattering ( )
static
Build for BB the static schedule.

   The static schedule is a Dewey numbering of the abstract syntax
   tree: http://en.wikipedia.org/wiki/Dewey_Decimal_Classification

   The following example informally defines the static schedule:

   A
   for (i: ...)
     {
       for (j: ...)
         {
           B
           C
         }

       for (k: ...)
         {
           D
           E
         }
     }
   F

   Static schedules for A to F:

     DEPTH
     0 1 2
   A 0
   B 1 0 0
   C 1 0 1
   D 1 1 0
   E 1 1 1
   F 2

References build_pbb_scattering_polyhedrons(), cfun, scop::context, nb_common_loops(), number_of_loops(), and pbb_dim_iter_domain().

Referenced by build_poly_scop().

static void build_sese_conditions_after ( struct dom_walk_data dw_data,
basic_block  bb 
)
static
Call-back for dom_walk executed after visiting the dominated
   blocks.   

References bb_in_sese_p(), bsc::cases, bsc::conditions, dom_walk_data::global_data, bsc::region, and single_pred_cond_non_loop_exit().

Referenced by build_sese_conditions().

static void build_sese_conditions_before ( struct dom_walk_data dw_data,
basic_block  bb 
)
static
Call-back for dom_walk executed before visiting the dominated
   blocks.   

References bb_in_sese_p(), bsc::cases, bsc::conditions, edge_def::flags, gbb_from_bb(), dom_walk_data::global_data, bsc::region, single_pred_cond_non_loop_exit(), and single_pred_edge().

Referenced by build_sese_conditions().

static tree close_phi_written_to_memory ( )
static
When the result of a CLOSE_PHI is written to a memory location,
   return a pointer to that memory reference, otherwise return
   NULL_TREE.   

References dr_indices_valid_in_loop(), for_each_index(), gimple_assign_lhs(), gimple_phi_arg_def(), gimple_phi_result(), and loop_containing_stmt().

Referenced by translate_scalar_reduction_to_array().

static int compare_bb_depths ( )
static
Compare the depth of two basic_block's P1 and P2.   

References d1, d2, loop_depth(), and basic_block_def::loop_father.

Referenced by graphite_sort_dominated_info().

static isl_pw_aff* create_pw_aff_from_tree ( )
static
Returns a linear expression for tree T evaluated in PBB.   

References automatically_generated_chrec_p(), poly_bb::domain, extract_affine(), pbb_loop(), and scalar_evolution_in_region().

Referenced by add_condition_to_pbb().

static tree create_zero_dim_array ( )
static
static gimple detect_commutative_reduction ( scop_p  scop,
gimple  stmt,
vec< gimple > *  in,
vec< gimple > *  out 
)
static
Detect commutative and associative scalar reductions belonging to
   the SCOP starting at the loop closed phi node STMT.  Return the phi
   node of the reduction cycle, or NULL.   

References detect_commutative_reduction_assign(), follow_inital_value_to_phi(), gimple_phi_arg_def(), gimple_phi_num_args(), gimple_phi_result(), has_single_use(), initial_value_for_loop_phi(), scalar_close_phi_node_p(), stmt_in_sese_p(), and used_outside_reduction().

Referenced by rewrite_commutative_reductions_out_of_ssa_close_phi().

static gimple detect_commutative_reduction_arg ( tree  lhs,
gimple  stmt,
tree  arg,
vec< gimple > *  in,
vec< gimple > *  out 
)
static
Detect commutative and associative scalar reductions starting at
   the STMT.  Return the phi node of the reduction cycle, or NULL.   

References follow_ssa_with_commutative_ops().

Referenced by detect_commutative_reduction_assign().

static gimple detect_commutative_reduction_assign ( gimple  stmt,
vec< gimple > *  in,
vec< gimple > *  out 
)
static
Detect commutative and associative scalar reductions starting at
   STMT.  Return the phi node of the reduction cycle, or NULL.   

References detect_commutative_reduction_arg(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_num_ops(), and is_reduction_operation_p().

Referenced by detect_commutative_reduction().

static bool dr_indices_valid_in_loop ( )
static
Helper function for for_each_index.  For each INDEX of the data
   reference REF, returns true when its indices are valid in the loop
   nest LOOP passed in as DATA.   

References CDI_DOMINATORS, dominated_by_p(), gimple_bb(), and loop::header.

Referenced by close_phi_written_to_memory().

static bool dr_same_base_object_p ( const struct data_reference dr1,
const struct data_reference dr2 
)
static
Check if DR1 and DR2 are in the same object set.   

References DR_BASE_OBJECT, and operand_equal_p().

Referenced by build_base_obj_set_for_drs().

static void dump_alias_graphs ( )
static
Dump to file the alias graphs for the data references in DRS.   

References current_function_name(), snprintf(), write_alias_graph_to_ascii_dimacs(), write_alias_graph_to_ascii_dot(), and write_alias_graph_to_ascii_ecc().

Referenced by build_scop_drs().

static edge edge_initial_value_for_loop_phi ( )
static
Return the argument of the loop PHI that is the initial value coming
   from outside the loop.   

References edge_def::dest, gimple_phi_arg_edge(), gimple_phi_num_args(), loop_depth(), basic_block_def::loop_father, and edge_def::src.

Referenced by translate_scalar_reduction_to_array().

static isl_pw_aff* extract_affine ( scop_p  ,
tree  ,
__isl_take isl_space *  space 
)
static
static isl_pw_aff* extract_affine ( )
static
static isl_pw_aff* extract_affine_chrec ( )
static
Extract an affine expression from the chain of recurrence E.   

References extract_affine(), get_chrec_loop(), scop::region, and sese_loop_depth().

Referenced by extract_affine().

static isl_pw_aff* extract_affine_gmp ( )
static
Extract an affine expression from the gmp constant G.   

References dom.

Referenced by build_loop_iteration_domains(), and extract_affine_int().

static isl_pw_aff* extract_affine_int ( )
static
Extract an affine expression from the integer_cst E.   

References extract_affine_gmp(), g, and tree_int_to_gmp().

Referenced by extract_affine(), and pdr_add_data_dimensions().

static isl_pw_aff* extract_affine_mul ( )
static
Extract an affine expression from the mult_expr E.   

References extract_affine().

Referenced by extract_affine().

static isl_pw_aff* extract_affine_name ( )
static
Extract an affine expression from the ssa_name E.   

References dom, and isl_id_for_ssa_name().

Referenced by extract_affine().

static void find_params_in_bb ( )
static
Find parameters with respect to REGION in BB. We are looking in memory
   access functions, conditions and loop bounds.   

References DR_ACCESS_FN, DR_NUM_DIMENSIONS, gimple_cond_lhs(), gimple_cond_rhs(), scalar_evolution_in_region(), scan_tree_for_params(), and data_reference::stmt.

Referenced by find_scop_parameters().

static void find_scop_parameters ( )
static
Record the parameters used in the SCOP.  A variable is a parameter
   in a scop if it does not vary during the execution of that scop.   

References chrec_contains_symbols(), scop::context, scop::ctx, find_params_in_bb(), isl_id_for_ssa_name(), number_of_latch_executions(), scalar_evolution_in_region(), scan_tree_for_params(), scop_set_nb_params(), and sese_nb_params().

Referenced by build_poly_scop().

static gimple follow_inital_value_to_phi ( )
static
Return a loop phi node that corresponds to a reduction containing LHS.   

References phi_contains_arg().

Referenced by detect_commutative_reduction().

static gimple follow_ssa_with_commutative_ops ( )
static
Return a loop phi node that corresponds to a reduction containing LHS.   

References gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_num_ops(), is_gimple_assign(), is_reduction_operation_p(), and phi_contains_arg().

Referenced by detect_commutative_reduction_arg().

static void free_data_refs_aux ( )
static
static void free_gimple_bb ( )
static
Frees GBB.   

References free_data_refs(), and free_data_refs_aux().

Referenced by build_scop_drs(), and remove_gbbs_in_scop().

void free_scops ( )
Deletes all scops in SCOPS.   

References free_scop(), free_sese(), and remove_gbbs_in_scop().

static void graphite_sort_dominated_info ( )
static
Sort the basic blocks from DOM such that the first are the ones at
   a deepest loop level.   

References compare_bb_depths().

Referenced by build_scop_bbs_1().

static gimple_stmt_iterator gsi_for_phi_node ( )
static
Return a gsi at the position of the phi node STMT.   

References gimple_bb(), gsi_end_p(), gsi_next(), gsi_start_phis(), and gsi_stmt().

Referenced by remove_phi().

static void handle_scalar_deps_crossing_scop_limits ( )
static
For every definition DEF in the SCOP that is used outside the scop,
   insert a closing-scop definition in the basic block just after this
   SCOP.   

References bb_in_sese_p(), create_tmp_reg(), gsi_after_labels(), gsi_insert_before(), GSI_SAME_STMT, make_ssa_name(), and update_stmt().

Referenced by rewrite_cross_bb_scalar_deps().

static tree initial_value_for_loop_phi ( )
static
Return the argument of the loop PHI that is the initial value coming
   from outside the loop.   

References edge_def::dest, gimple_phi_arg_def(), gimple_phi_arg_edge(), gimple_phi_num_args(), loop_depth(), basic_block_def::loop_father, and edge_def::src.

Referenced by detect_commutative_reduction(), and translate_scalar_reduction_to_array().

static void insert_stmts ( scop_p  scop,
gimple  stmt,
gimple_seq  stmts,
gimple_stmt_iterator  insert_gsi 
)
static
Insert STMT at the end of the STMTS sequence and then insert the
   statements from STMTS at INSERT_GSI and call analyze_drs_in_stmts
   on STMTS.   

References analyze_drs_in_stmts(), gimple_seq_add_stmt(), gsi_bb(), gsi_end_p(), gsi_insert_seq_before(), gsi_next(), GSI_SAME_STMT, and gsi_stmt().

Referenced by rewrite_close_phi_out_of_ssa(), rewrite_cross_bb_scalar_dependence(), rewrite_phi_out_of_ssa(), and translate_scalar_reduction_to_array_for_stmt().

static bool is_reduction_operation_p ( )
inlinestatic
static isl_id* isl_id_for_dr ( )
static
Return an ISL identifier for the data reference DR.   

References scop::ctx.

Referenced by build_poly_dr().

static isl_id* isl_id_for_pbb ( )
static
Return an ISL identifier for the polyhedral basic block PBB.   

References scop::ctx, pbb_index(), and snprintf().

Referenced by build_scop_iteration_domain().

static isl_id* isl_id_for_ssa_name ( )
static
Return an ISL identifier from the name of the ssa_name E.   

References scop::ctx, get_name(), and snprintf().

Referenced by extract_affine_name(), and find_scop_parameters().

static int nb_data_writes_in_bb ( )
static
Return the number of data references in BB that write in
   memory.   

References gimple_vdef(), gsi_end_p(), gsi_next(), gsi_start_bb(), and gsi_stmt().

Referenced by split_reduction_stmt().

static int nb_pbbs_in_loops ( )
static
Returns the number of pbbs that are in loops contained in SCOP.   

References gbb_loop(), and loop_in_sese_p().

Referenced by build_poly_scop().

static gimple_bb_p new_gimple_bb ( )
static
Store the GRAPHITE representation of BB.   

References basic_block_def::aux, and gimple_bb::bb.

Referenced by new_pbb_from_pbb(), and try_generate_gimple_bb().

static void new_pbb_from_pbb ( )
static
Creates a poly_bb_p for basic_block BB from the existing PBB.   

References poly_bb::domain, new_gimple_bb(), and new_poly_bb().

Referenced by insert_out_of_ssa_copy_on_edge(), and split_pbb().

static loop_p outermost_loop_in_sese_1 ( )
static
Same as outermost_loop_in_sese, returns the outermost loop
   containing BB in REGION, but makes sure that the returned loop
   belongs to the REGION, and so this returns the first loop in the
   REGION when the loop containing BB does not belong to REGION.   

References loop::inner, loop_in_sese_p(), loop::next, and outermost_loop_in_sese().

Referenced by analyze_drs_in_stmts(), and try_generate_gimple_bb().

static int parameter_index_in_region ( )
static
When the parameter NAME is in REGION, returns its index in
   SESE_PARAMS.  Otherwise this function inserts NAME in SESE_PARAMS
   and returns the index of NAME.   

References parameter_index_in_region_1().

Referenced by scan_tree_for_params().

static int parameter_index_in_region_1 ( )
inlinestatic
When parameter NAME is in REGION, returns its index in SESE_PARAMS.
   Otherwise returns -1.   

Referenced by extract_affine(), and parameter_index_in_region().

static isl_map* pdr_add_alias_set ( )
static
Add a constrain to the ACCESSES polyhedron for the alias set of
   data reference DR.  ACCESSP_NB_DIMS is the dimension of the
   ACCESSES polyhedron, DOM_NB_DIMS is the dimension of the iteration
   domain.   

References base_alias_pair::alias_set, and data_reference::aux.

Referenced by build_poly_dr().

static isl_set* pdr_add_data_dimensions ( )
static
Add constrains representing the size of the accessed data to the
   ACCESSES polyhedron.  ACCESSP_NB_DIMS is the dimension of the
   ACCESSES polyhedron, DOM_NB_DIMS is the dimension of the iteration
   domain.   

References array_at_struct_end_p(), array_ref_low_bound(), array_ref_up_bound(), scop::context, DR_NUM_DIMENSIONS, DR_REF, extract_affine_int(), host_integerp(), and operand_equal_p().

Referenced by build_poly_dr().

static isl_map* pdr_add_memory_accesses ( )
static
Add to ACCESSES polyhedron equalities defining the access functions
   to the memory.  ACCESSP_NB_DIMS is the dimension of the ACCESSES
   polyhedron, DOM_NB_DIMS is the dimension of the iteration domain.
   PBB is the poly_bb_p that contains the data reference DR.   

References DR_ACCESS_FN, DR_NUM_DIMENSIONS, extract_affine(), and set_index().

Referenced by build_poly_dr().

static size_t phi_arg_in_outermost_loop ( )
static
Returns the index of the PHI argument defined in the outermost
   loop.   

References flow_bb_inside_loop_p(), gimple_bb(), gimple_phi_arg_edge(), gimple_phi_num_args(), basic_block_def::loop_father, and edge_def::src.

Referenced by remove_invariant_phi(), and remove_simple_copy_phi().

static bool phi_contains_arg ( )
static
Returns true when PHI contains an argument ARG.   

References gimple_phi_arg_def(), gimple_phi_num_args(), and operand_equal_p().

Referenced by follow_inital_value_to_phi(), and follow_ssa_with_commutative_ops().

static void propagate_expr_outside_region ( )
static
For a definition DEF in REGION, propagates the expression EXPR in
   all the uses of DEF outside REGION.   

References bb_in_sese_p(), force_gimple_operand(), gsi_commit_edge_inserts(), gsi_insert_seq_on_edge(), is_gimple_debug(), operand_equal_p(), replace_exp(), unshare_expr(), and update_stmt().

Referenced by rewrite_close_phi_out_of_ssa(), and rewrite_cross_bb_scalar_deps().

static bool reduction_phi_p ( )
static
Returns true when the phi node at position PSI is a reduction phi
   node in REGION.  Otherwise moves the pointer PSI to the next phi to
   be considered.   

References evolution_function_is_invariant_p(), gimple_phi_result(), gsi_next(), gsi_stmt(), loop_containing_stmt(), loop::num, remove_invariant_phi(), remove_simple_copy_phi(), scalar_evolution_in_region(), scev_analyzable_p(), and simple_copy_phi_p().

Referenced by rewrite_reductions_out_of_ssa().

static void remove_gbbs_in_scop ( )
static
Deletes all gimple bbs in SCOP.   

References free_gimple_bb().

Referenced by free_scops().

static void remove_invariant_phi ( )
static
static void remove_phi ( )
static
Removes the PHI node and resets all the debug stmts that are using
   the PHI_RESULT.   

References gimple_debug_bind_reset_value(), gsi_for_phi_node(), is_gimple_debug(), remove_phi_node(), and update_stmt().

Referenced by translate_scalar_reduction_to_array().

static void remove_simple_copy_phi ( )
static
Removes a simple copy phi node "RES = phi (INIT, RES)" at position
   PSI by inserting on the loop ENTRY edge assignment "RES = INIT".   

References gimple_phi_arg_def(), gimple_phi_arg_edge(), gimple_phi_result(), gsi_insert_on_edge_immediate(), gsi_stmt(), phi_arg_in_outermost_loop(), and remove_phi_node().

Referenced by reduction_phi_p().

static void rewrite_commutative_reductions_out_of_ssa ( )
static
static bool rewrite_commutative_reductions_out_of_ssa_close_phi ( scop_p  scop,
gimple  close_phi 
)
static
Rewrites out of SSA a commutative reduction at CLOSE_PHI.  Returns
   true when something has been changed.   

References detect_commutative_reduction(), and translate_scalar_reduction_to_array().

Referenced by rewrite_commutative_reductions_out_of_ssa_loop().

static bool rewrite_commutative_reductions_out_of_ssa_loop ( scop_p  scop,
loop_p  loop 
)
static
Rewrites all the commutative reductions from LOOP out of SSA.
   Returns true when something has been changed.   

References changed, edge_def::dest, gimple_phi_result(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), rewrite_commutative_reductions_out_of_ssa_close_phi(), scev_analyzable_p(), single_exit(), and virtual_operand_p().

Referenced by rewrite_commutative_reductions_out_of_ssa().

static void rewrite_cross_bb_scalar_dependence ( scop_p  scop,
tree  zero_dim_array,
tree  def,
gimple  use_stmt 
)
static
Rewrite the scalar dependence of DEF used in USE_STMT with a memory
   read from ZERO_DIM_ARRAY.   

References copy_ssa_name(), gimple_assign_set_lhs(), gsi_for_stmt(), insert_stmts(), operand_equal_p(), replace_exp(), and update_stmt().

Referenced by rewrite_cross_bb_scalar_deps().

static void rewrite_cross_bb_scalar_deps_out_of_ssa ( )
static
static void rewrite_degenerate_phi ( )
static
Rewrite the degenerate phi node at position PSI from the degenerate
   form "x = phi (y, y, ..., y)" to "x = y".   

References degenerate_phi_result(), gimple_bb(), gimple_phi_result(), gsi_after_labels(), gsi_insert_before(), GSI_NEW_STMT, gsi_stmt(), and remove_phi_node().

Referenced by rewrite_reductions_out_of_ssa().

static bool scalar_close_phi_node_p ( )
static
static void scan_tree_for_params ( )
static
In the context of sese S, scan the expression E and translate it to
   a linear expression C.  When parsing a symbolic multiplication, K
   represents the constant multiplier of an expression containing
   parameters.   

References chrec_contains_symbols(), chrec_dont_know, and parameter_index_in_region().

Referenced by find_params_in_bb(), and find_scop_parameters().

static bool scop_ivs_can_be_represented ( )
static
Can all ivs be represented by a signed integer?
   As CLooG might generate negative values in its expressions, signed loop ivs
   are required in the backend.  

References gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), loop::header, and loop_in_sese_p().

Referenced by build_poly_scop().

static isl_map* set_index ( )
static
Assign the affine expression INDEX to the output dimension POS of
   MAP and return the result.   

References len.

Referenced by pdr_add_memory_accesses().

static bool simple_copy_phi_p ( )
inlinestatic
Returns true when the phi node at PSI is of the form "a = phi (a, x)".   

References gimple_phi_arg_def(), gimple_phi_num_args(), and gimple_phi_result().

Referenced by reduction_phi_p().

static gimple single_pred_cond_non_loop_exit ( )
static
Returns a COND_EXPR statement when BB has a single predecessor, the
   edge between BB and its predecessor is not a loop exit edge, and
   the last statement of the single predecessor is a COND_EXPR.   

References last_stmt(), loop_depth(), basic_block_def::loop_father, single_pred_edge(), single_pred_p(), and edge_def::src.

Referenced by build_sese_conditions_after(), and build_sese_conditions_before().

static edge split_pbb ( )
static
Splits at STMT the basic block BB represented as PBB in the
   polyhedral form.   

References edge_def::dest, new_pbb_from_pbb(), and split_block().

Referenced by split_reduction_stmt().

static basic_block split_reduction_stmt ( )
static
Splits STMT out of its current BB.  This is done for reduction
   statements for which we want to ignore data dependences.   

References edge_def::dest, DR_STMT, gbb_from_bb(), gimple_bb(), gsi_last_bb(), gsi_one_before_end_p(), gsi_prev(), gsi_start_nondebug_bb(), gsi_stmt(), nb_data_writes_in_bb(), pbb_from_bb(), and split_pbb().

Referenced by translate_scalar_reduction_to_array().

static void translate_scalar_reduction_to_array ( scop_p  scop,
vec< gimple in,
vec< gimple out 
)
static
Rewrite out of SSA the reduction described by the loop phi nodes
   IN, and the close phi nodes OUT.  IN and OUT are structured by loop
   levels like this:

   IN: stmt, loop_n, ..., loop_0
   OUT: stmt, close_n, ..., close_0

   the first element is the reduction statement, and the next elements
   are the loop and close phi nodes of each of the outer loops.   

References close_phi_written_to_memory(), create_zero_dim_array(), edge_initial_value_for_loop_phi(), gimple_assign_lhs(), gimple_phi_result(), initial_value_for_loop_phi(), insert_out_of_ssa_copy(), insert_out_of_ssa_copy_on_edge(), pbb_from_bb(), remove_phi(), split_reduction_stmt(), translate_scalar_reduction_to_array_for_stmt(), and unshare_expr().

Referenced by rewrite_commutative_reductions_out_of_ssa_close_phi().

static void translate_scalar_reduction_to_array_for_stmt ( scop_p  scop,
tree  red,
gimple  stmt,
gimple  loop_phi 
)
static
Translate the scalar reduction statement STMT to an array RED
   knowing that its recursive phi node is LOOP_PHI.   

References gimple_assign_lhs(), gimple_phi_result(), gsi_after_labels(), gsi_for_stmt(), gsi_next(), insert_stmts(), and unshare_expr().

Referenced by translate_scalar_reduction_to_array().

static void tree_int_to_gmp ( )
inlinestatic
@verbatim Conversion of SESE regions to Polyhedra.

Copyright (C) 2009-2013 Free Software Foundation, Inc. Contributed by Sebastian Pop sebas.nosp@m.tian.nosp@m..pop@.nosp@m.amd..nosp@m.com.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.

Assigns to RES the value of the INTEGER_CST T.   

References mpz_set_double_int(), and tree_to_double_int().

Referenced by add_param_constraints(), build_loop_iteration_domains(), and extract_affine_int().

static gimple_bb_p try_generate_gimple_bb ( )
static
static bool used_outside_reduction ( )
static
Returns true when DEF is used outside the reduction cycle of
   LOOP_PHI.   

References flow_bb_inside_loop_p(), is_gimple_debug(), and loop_containing_stmt().

Referenced by detect_commutative_reduction().

static isl_pw_aff* wrap ( )
static
Compute pwaff mod 2^width.   

Referenced by extract_affine(), and gimplify_modify_expr_rhs().

static bool write_alias_graph_to_ascii_dimacs ( FILE *  file,
char *  comment,
vec< data_reference_p drs 
)
inlinestatic
Write to FILE the alias graph of data references in DIMACS format.   

References dr_may_alias_p().

Referenced by dump_alias_graphs().

static bool write_alias_graph_to_ascii_dot ( FILE *  file,
char *  comment,
vec< data_reference_p drs 
)
inlinestatic
Write to FILE the alias graph of data references in DOT format.   

References dr_may_alias_p().

Referenced by dump_alias_graphs().

static bool write_alias_graph_to_ascii_ecc ( FILE *  file,
char *  comment,
vec< data_reference_p drs 
)
inlinestatic
Write to FILE the alias graph of data references in ECC format.   

References dr_may_alias_p().

Referenced by dump_alias_graphs().