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 | 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 () |
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.
Verify if the DFS numbering results in optimal solution.
Get all vertices whose DFS component number is the same as i.
Now test if the vertices in 'vertices' form a clique, by testing
for edges among each pair.
Check if the two vertices are connected by iterating
through all the edges which have one of these are source.
Referenced by build_base_obj_set_for_drs().
static void build_loop_iteration_domains |
( |
scop_p |
scop, |
|
|
struct loop * |
loop, |
|
|
int |
nb, |
|
|
isl_set * |
outer, |
|
|
isl_set ** |
doms |
|
) |
| |
|
static |
Builds the constraint polyhedra for LOOP in SCOP. OUTER_PH gives
the constraints for the surrounding loops.
0 <= loop_i
loop_i <= cst_nb_iters
loop_i <= expr_nb_iters
Insert in the context the constraints from the
estimation of the number of iterations NIT and the
symbolic number of iterations (involving parameter
names) NB_ITERS. First, build the affine expression
"NIT - NB_ITERS" and then say that it is positive,
i.e., NIT approximates NB_ITERS: "NIT >= NB_ITERS".
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
Textual order inside this loop.
Iterations of this loop.
Builds the polyhedral representation for a SESE region.
FIXME: This restriction is needed to avoid a problem in CLooG.
Once CLooG is fixed, remove this guard. Anyways, it makes no
sense to optimize a scop containing only PBBs that do not belong
to any loops.
Record all conditions in REGION.
Rewrite out of SSA only after having translated the
representation to the polyhedral representation to avoid scev
analysis failures. That means that these functions will insert
new data references that they create in the right place.
This SCoP has been translated to the polyhedral
representation.
static void build_scop_drs |
( |
| ) |
|
|
static |
Build data references in SCOP.
Remove all the PBBs that do not have data references: these basic
blocks are not handled in the polyhedral representation.
TODO: Add support when building alias set is not optimal.
When debugging, enable the following code. This cannot be used
in production compilers.
static void build_scop_scattering |
( |
| ) |
|
|
static |
@verbatim
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
We have to start schedules at 0 on the first component and
because we cannot compare_prefix_loops against a previous loop,
prefix will be equal to zero, and that index will be
incremented before copying.
static tree close_phi_written_to_memory |
( |
| ) |
|
|
static |
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.
When the basic block BB does not belong to a loop in the region,
return the first loop in the region.
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.
XXX The PPL code dealt separately with
subscript - low >= 0 and high - subscript >= 0 in case one of
the two bounds isn't known. Do the same here?
1-element arrays at end of structures may extend over
their declared size.
high >= 0
low <= sub_i <= high
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.
PRE introduces phi nodes like these, for an example,
see id-5.f in the fortran graphite testsuite:
# prephitmp.85_265 = PHI <prephitmp.85_258(33), prephitmp.85_265(18)>
All the other cases are considered reductions.
References remove_simple_copy_phi().
static void rewrite_close_phi_out_of_ssa |
( |
| ) |
|
|
static |
Rewrite out of SSA the reduction phi node at PSI by creating a zero
dimension array for it.
Note that loop close phi nodes should have a single argument
because we translated the representation into a canonical form
before Graphite: see canonicalize_loop_closed_ssa_form.
The phi node can be a non close phi node, when its argument is
invariant, or a default definition.
If res is scev analyzable and is not a scalar value, it is safe
to ignore the close phi node: it will be code generated in the
out of Graphite pass.
Splits STMT out of its current BB. This is done for reduction
statements for which we want to ignore data dependences.
Do not split basic blocks with no writes to memory: the reduction
will be the only write to memory.
Or if we have already marked BB as a reduction.
Split once more only when the reduction stmt is not the only one
left in the original BB.
A part of the data references will end in a different basic block
after the split: move the DRs from the original GBB to the newly
created GBB1.
References follow_ssa_with_commutative_ops().
Referenced by translate_scalar_reduction_to_array_for_stmt().
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.
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.
Referenced by extract_affine_name(), and find_scop_parameters().