GCC Middle and Back End API Reference
tree-data-ref.c File Reference

Data Structures

struct  datadep_stats
struct  data_ref_loc_d

Typedefs

typedef struct data_ref_loc_d data_ref_loc

Functions

static bool subscript_dependence_tester_1 (struct data_dependence_relation *, struct data_reference *, struct data_reference *, struct loop *)
static bool tree_fold_divides_p ()
static bool int_divides_p ()
static void dump_data_references ()
DEBUG_FUNCTION void debug ()
DEBUG_FUNCTION void debug_data_references ()
DEBUG_FUNCTION void debug_data_reference ()
void dump_data_reference (FILE *outf, struct data_reference *dr)
static void dump_affine_function ()
static void dump_conflict_function ()
static void dump_subscript ()
static void print_direction_vector (FILE *outf, lambda_vector dirv, int length)
static void print_dir_vectors (FILE *outf, vec< lambda_vector > dir_vects, int length)
static void print_lambda_vector ()
static void print_dist_vectors (FILE *outf, vec< lambda_vector > dist_vects, int length)
static void dump_data_dependence_relation (FILE *outf, struct data_dependence_relation *ddr)
DEBUG_FUNCTION void debug_data_dependence_relation ()
void dump_data_dependence_relations (FILE *file, vec< ddr_p > ddrs)
DEBUG_FUNCTION void debug_data_dependence_relations ()
static void dump_dist_dir_vectors ()
static void dump_ddrs ()
DEBUG_FUNCTION void debug_ddrs ()
static bool split_constant_offset_1 (tree type, tree op0, enum tree_code code, tree op1, tree *var, tree *off)
void split_constant_offset ()
static tree canonicalize_base_object_address ()
bool dr_analyze_innermost ()
static void dr_analyze_indices ()
static void dr_analyze_alias ()
void free_data_ref ()
struct data_referencecreate_data_ref (loop_p nest, loop_p loop, tree memref, gimple stmt, bool is_read)
static bool dr_equal_offsets_p1 ()
bool dr_equal_offsets_p (struct data_reference *dra, struct data_reference *drb)
static bool affine_function_equal_p ()
static affine_fn common_affine_function ()
static tree affine_function_base ()
static bool affine_function_constant_p ()
static bool affine_function_zero_p ()
static tree signed_type_for_types ()
static affine_fn affine_fn_op ()
static affine_fn affine_fn_plus ()
static affine_fn affine_fn_minus ()
static void affine_fn_free ()
static void compute_subscript_distance ()
static conflict_functionconflict_fn_not_known ()
static conflict_functionconflict_fn_no_dependence ()
static bool object_address_invariant_in_loop_p ()
bool dr_may_alias_p (const struct data_reference *a, const struct data_reference *b, bool loop_nest)
struct data_dependence_relationinitialize_data_dependence_relation (struct data_reference *a, struct data_reference *b, vec< loop_p > loop_nest)
static void free_conflict_function ()
static void free_subscripts ()
static void finalize_ddr_dependent (struct data_dependence_relation *ddr, tree chrec)
static void non_affine_dependence_relation ()
static bool ziv_subscript_p ()
static bool siv_subscript_p ()
static conflict_functionconflict_fn ()
static affine_fn affine_fn_cst ()
static affine_fn affine_fn_univar ()
static void analyze_ziv_subscript (tree chrec_a, tree chrec_b, conflict_function **overlaps_a, conflict_function **overlaps_b, tree *last_conflicts)
static tree max_stmt_executions_tree ()
static bool chrec_is_positive ()
static void analyze_siv_subscript_cst_affine (tree chrec_a, tree chrec_b, conflict_function **overlaps_a, conflict_function **overlaps_b, tree *last_conflicts)
static tree initialize_matrix_A ()
static void compute_overlap_steps_for_affine_univar (int niter, int step_a, int step_b, affine_fn *overlaps_a, affine_fn *overlaps_b, tree *last_conflicts, int dim)
static void compute_overlap_steps_for_affine_1_2 (tree chrec_a, tree chrec_b, conflict_function **overlaps_a, conflict_function **overlaps_b, tree *last_conflicts)
static void lambda_vector_copy (lambda_vector vec1, lambda_vector vec2, int size)
static void lambda_matrix_copy (lambda_matrix mat1, lambda_matrix mat2, int m, int n)
static void lambda_matrix_id ()
static int lambda_vector_first_nz ()
static void lambda_matrix_row_add ()
static void lambda_matrix_row_exchange ()
static void lambda_vector_mult_const (lambda_vector vec1, lambda_vector vec2, int size, int const1)
static void lambda_vector_negate (lambda_vector vec1, lambda_vector vec2, int size)
static void lambda_matrix_row_negate ()
static bool lambda_vector_equal ()
static void lambda_matrix_right_hermite (lambda_matrix A, int m, int n, lambda_matrix S, lambda_matrix U)
static void analyze_subscript_affine_affine (tree chrec_a, tree chrec_b, conflict_function **overlaps_a, conflict_function **overlaps_b, tree *last_conflicts)
static bool can_use_analyze_subscript_affine_affine ()
static void analyze_siv_subscript (tree chrec_a, tree chrec_b, conflict_function **overlaps_a, conflict_function **overlaps_b, tree *last_conflicts, int loop_nest_num)
static bool gcd_of_steps_may_divide_p ()
static void analyze_miv_subscript (tree chrec_a, tree chrec_b, conflict_function **overlaps_a, conflict_function **overlaps_b, tree *last_conflicts, struct loop *loop_nest)
static void analyze_overlapping_iterations (tree chrec_a, tree chrec_b, conflict_function **overlap_iterations_a, conflict_function **overlap_iterations_b, tree *last_conflicts, struct loop *loop_nest)
static void save_dist_v ()
static void save_dir_v ()
static void add_outer_distances (struct data_dependence_relation *ddr, lambda_vector dist_v, int index)
static bool build_classic_dist_vector_1 (struct data_dependence_relation *ddr, struct data_reference *ddr_a, struct data_reference *ddr_b, lambda_vector dist_v, bool *init_b, int *index_carry)
static bool constant_access_functions ()
static void add_multivariate_self_dist ()
static void add_other_self_distances ()
static void insert_innermost_unit_dist_vector ()
static void add_distance_for_zero_overlaps ()
static bool build_classic_dist_vector (struct data_dependence_relation *ddr, struct loop *loop_nest)
static enum
data_dependence_direction 
dir_from_dist ()
static void build_classic_dir_vector ()
static void subscript_dependence_tester (struct data_dependence_relation *ddr, struct loop *loop_nest)
static bool access_functions_are_affine_or_constant_p (const struct data_reference *a, const struct loop *loop_nest)
static bool init_omega_eq_with_af (omega_pb pb, unsigned eq, unsigned int offset, tree access_fun, struct data_dependence_relation *ddr)
static void omega_extract_distance_vectors (omega_pb pb, struct data_dependence_relation *ddr)
static bool omega_setup_subscript (tree access_fun_a, tree access_fun_b, struct data_dependence_relation *ddr, omega_pb pb, bool *maybe_dependent)
static bool init_omega_for_ddr_1 (struct data_reference *dra, struct data_reference *drb, struct data_dependence_relation *ddr, omega_pb pb, bool *maybe_dependent)
static bool init_omega_for_ddr (struct data_dependence_relation *ddr, bool *maybe_dependent)
static bool ddr_consistent_p (FILE *file, struct data_dependence_relation *ddr, vec< lambda_vector > dist_vects, vec< lambda_vector > dir_vects)
void compute_affine_dependence (struct data_dependence_relation *ddr, struct loop *loop_nest)
bool compute_all_dependences (vec< data_reference_p > datarefs, vec< ddr_p > *dependence_relations, vec< loop_p > loop_nest, bool compute_self_and_rr)
static bool get_references_in_stmt ()
bool find_data_references_in_stmt (struct loop *nest, gimple stmt, vec< data_reference_p > *datarefs)
bool graphite_find_data_references_in_stmt (loop_p nest, loop_p loop, gimple stmt, vec< data_reference_p > *datarefs)
tree find_data_references_in_bb (struct loop *loop, basic_block bb, vec< data_reference_p > *datarefs)
tree find_data_references_in_loop (struct loop *loop, vec< data_reference_p > *datarefs)
static bool find_loop_nest_1 ()
bool find_loop_nest ()
bool compute_data_dependences_for_loop (struct loop *loop, bool compute_self_and_read_read_dependences, vec< loop_p > *loop_nest, vec< data_reference_p > *datarefs, vec< ddr_p > *dependence_relations)
bool compute_data_dependences_for_bb (basic_block bb, bool compute_self_and_read_read_dependences, vec< data_reference_p > *datarefs, vec< ddr_p > *dependence_relations)
static void analyze_all_data_dependences ()
void tree_check_data_deps ()
void free_dependence_relation ()
void free_dependence_relations ()
void free_data_refs ()
static void dump_rdg_vertex ()
DEBUG_FUNCTION void debug_rdg_vertex ()
static void dump_rdg_component ()
DEBUG_FUNCTION void debug_rdg_component ()
void dump_rdg ()
DEBUG_FUNCTION void debug_rdg ()
static void dot_rdg_1 ()
void dot_rdg (struct graph *)
DEBUG_FUNCTION void dot_rdg ()
int rdg_vertex_for_stmt ()
static void create_rdg_edge_for_ddr ()
static void create_rdg_edges_for_scalar ()
static void create_rdg_edges ()
static void create_rdg_vertices ()
static void stmts_from_loop ()
static bool known_dependences_p ()
struct graphbuild_empty_rdg ()
struct graphbuild_rdg (struct loop *loop, vec< loop_p > *loop_nest, vec< ddr_p > *dependence_relations, vec< data_reference_p > *datarefs)
void free_rdg ()
bool rdg_defs_used_in_other_loops_p ()

Variables

static struct datadep_stats dependence_stats

Typedef Documentation

typedef struct data_ref_loc_d data_ref_loc
Describes a location of a memory reference.   

Function Documentation

static bool access_functions_are_affine_or_constant_p ( const struct data_reference a,
const struct loop loop_nest 
)
static
Returns true when all the access functions of A are affine or
   constant with respect to LOOP_NEST.   

References DR_ACCESS_FNS, evolution_function_is_affine_multivariate_p(), evolution_function_is_invariant_p(), and loop::num.

Referenced by compute_affine_dependence().

static void add_distance_for_zero_overlaps ( )
static
Adds a unit distance vector to DDR when there is a 0 overlap.  This
   is the case for example when access functions are the same and
   equal to a constant, as in:

   | loop_1
   |   A[3] = ...
   |   ... = A[3]
   | endloop_1

   in which case the distance vectors are (0) and (1).   

References affine_function_zero_p(), DDR_NUM_SUBSCRIPTS, DDR_SUBSCRIPT, conflict_function::fns, insert_innermost_unit_dist_vector(), conflict_function::n, SUB_CONFLICTS_IN_A, and SUB_CONFLICTS_IN_B.

Referenced by build_classic_dist_vector().

static void add_multivariate_self_dist ( )
static
Helper function for the case where DDR_A and DDR_B are the same
   multivariate access function with a constant step.  For an example
   see pr34635-1.c.   

References add_outer_distances(), DDR_AFFINE_P, DDR_LOOP_NEST, DDR_NB_LOOPS, gcd(), index_in_loop_nest(), int_cst_value(), lambda_vector_new(), and save_dist_v().

Referenced by add_other_self_distances().

static void add_other_self_distances ( )
static
static void add_outer_distances ( struct data_dependence_relation ddr,
lambda_vector  dist_v,
int  index 
)
static
Add a distance of 1 on all the loops outer than INDEX.  If we
   haven't yet determined a distance for this outer loop, push a new
   distance vector composed of the previous distance, and a distance
   of 1 for this outer loop.  Example:

   | loop_1
   |   loop_2
   |     A[10]
   |   endloop_2
   | endloop_1

   Saved vectors are of the form (dist_in_1, dist_in_2).  First, we
   save (0, 1), then we have to save (1, 0).   

References DDR_NB_LOOPS, lambda_vector_copy(), lambda_vector_new(), and save_dist_v().

Referenced by add_multivariate_self_dist(), add_other_self_distances(), and build_classic_dist_vector().

static void affine_fn_free ( )
static
static affine_fn affine_fn_minus ( )
static
Returns the difference of affine functions FNA and FNB.   

References affine_fn_op().

Referenced by compute_subscript_distance().

static affine_fn affine_fn_op ( )
static
Applies operation OP on affine functions FNA and FNB, and returns the
   result.   

References signed_type_for(), and signed_type_for_types().

Referenced by affine_fn_minus(), and affine_fn_plus().

static affine_fn affine_fn_plus ( )
static
Returns the sum of affine functions FNA and FNB.   

References affine_fn_op().

Referenced by compute_overlap_steps_for_affine_1_2().

static affine_fn affine_fn_univar ( )
static
Returns affine function with single variable, CST + COEF * x_DIM.   

Referenced by analyze_subscript_affine_affine(), and compute_overlap_steps_for_affine_univar().

static tree affine_function_base ( )
static
Returns the base of the affine function FN.   

Referenced by affine_function_zero_p(), and compute_subscript_distance().

static bool affine_function_constant_p ( )
static
Returns true if FN is a constant.   

References integer_zerop().

Referenced by affine_function_zero_p(), and compute_subscript_distance().

static bool affine_function_equal_p ( )
static
Returns true if FNA == FNB.   

References operand_equal_p().

Referenced by common_affine_function().

static bool affine_function_zero_p ( )
static
Returns true if FN is the zero constant function.   

References affine_function_base(), affine_function_constant_p(), and integer_zerop().

Referenced by add_distance_for_zero_overlaps().

static void analyze_all_data_dependences ( )
static
Entry point (for testing only).  Analyze all the data references
   and the dependence relations in LOOP.

   The data references are computed first.

   A relation on these nodes is represented by a complete graph.  Some
   of the relations could be of no interest, thus the relations can be
   computed on demand.

   In the following function we compute all the relations.  This is
   just a first implementation that is here for:
   - for showing how to ask for the dependence relations,
   - for the debugging the whole dependence graph,
   - for the dejagnu testcases and maintenance.

   It is possible to ask only for a part of the graph, avoiding to
   compute the whole dependence graph.  The computed dependences are
   stored in a knowledge base (KB) such that later queries don't
   recompute the same information.  The implementation of this KB is
   transparent to the optimizer, and thus the KB can be changed with a
   more efficient implementation, or the KB could be disabled.   

References chrec_contains_undetermined(), chrec_known, compute_data_dependences_for_loop(), DDR_ARE_DEPENDENT, dump_data_dependence_relations(), dump_dist_dir_vectors(), dump_file, dump_flags, free_data_refs(), free_dependence_relations(), and gather_stats_on_scev_database().

Referenced by tree_check_data_deps().

static void analyze_miv_subscript ( tree  chrec_a,
tree  chrec_b,
conflict_function **  overlaps_a,
conflict_function **  overlaps_b,
tree last_conflicts,
struct loop loop_nest 
)
static
Analyze a MIV (Multiple Index Variable) subscript with respect to
   LOOP_NEST.  *OVERLAPS_A and *OVERLAPS_B are initialized to the
   functions that describe the relation between the elements accessed
   twice by CHREC_A and CHREC_B.  For k >= 0, the following property
   is verified:

   CHREC_A (*OVERLAPS_A (k)) = CHREC_B (*OVERLAPS_B (k)).   

References affine_fn_cst(), analyze_subscript_affine_affine(), CF_NO_DEPENDENCE_P, CF_NOT_KNOWN_P, chrec_contains_symbols(), chrec_convert(), chrec_dont_know, chrec_fold_minus(), conflict_fn(), conflict_fn_no_dependence(), conflict_fn_not_known(), dependence_stats, dump_file, dump_flags, eq_evolutions_p(), evolution_function_is_affine_multivariate_p(), evolution_function_is_constant_p(), gcd_of_steps_may_divide_p(), get_chrec_loop(), max_stmt_executions_tree(), loop::num, datadep_stats::num_miv, datadep_stats::num_miv_dependent, datadep_stats::num_miv_independent, datadep_stats::num_miv_unimplemented, signed_type_for_types(), and type().

Referenced by analyze_overlapping_iterations().

static void analyze_overlapping_iterations ( tree  chrec_a,
tree  chrec_b,
conflict_function **  overlap_iterations_a,
conflict_function **  overlap_iterations_b,
tree last_conflicts,
struct loop loop_nest 
)
static
Determines the iterations for which CHREC_A is equal to CHREC_B in
   with respect to LOOP_NEST.  OVERLAP_ITERATIONS_A and
   OVERLAP_ITERATIONS_B are initialized with two functions that
   describe the iterations that contain conflicting elements.

   Remark: For an integer k >= 0, the following equality is true:

   CHREC_A (OVERLAP_ITERATIONS_A (k)) == CHREC_B (OVERLAP_ITERATIONS_B (k)).

References affine_fn_cst(), analyze_miv_subscript(), analyze_siv_subscript(), analyze_ziv_subscript(), chrec_contains_symbols(), chrec_contains_undetermined(), chrec_dont_know, conflict_fn(), conflict_fn_not_known(), dependence_stats, dump_conflict_function(), dump_file, dump_flags, eq_evolutions_p(), evolution_function_is_affine_multivariate_p(), loop::num, datadep_stats::num_same_subscript_function, datadep_stats::num_subscript_tests, datadep_stats::num_subscript_undetermined, operand_equal_p(), print_generic_expr(), siv_subscript_p(), and ziv_subscript_p().

Referenced by subscript_dependence_tester_1().

static void analyze_siv_subscript ( tree  chrec_a,
tree  chrec_b,
conflict_function **  overlaps_a,
conflict_function **  overlaps_b,
tree last_conflicts,
int  loop_nest_num 
)
static
Analyze a SIV (Single Index Variable) subscript.  *OVERLAPS_A and
   *OVERLAPS_B are initialized to the functions that describe the
   relation between the elements accessed twice by CHREC_A and
   CHREC_B.  For k >= 0, the following property is verified:

   CHREC_A (*OVERLAPS_A (k)) = CHREC_B (*OVERLAPS_B (k)).   

References analyze_siv_subscript_cst_affine(), analyze_subscript_affine_affine(), can_use_analyze_subscript_affine_affine(), CF_NO_DEPENDENCE_P, CF_NOT_KNOWN_P, chrec_contains_symbols(), chrec_dont_know, conflict_fn_not_known(), dependence_stats, dump_file, dump_flags, evolution_function_is_affine_in_loop(), evolution_function_is_constant_p(), datadep_stats::num_siv, datadep_stats::num_siv_dependent, datadep_stats::num_siv_independent, and datadep_stats::num_siv_unimplemented.

Referenced by analyze_overlapping_iterations().

static void analyze_siv_subscript_cst_affine ( tree  chrec_a,
tree  chrec_b,
conflict_function **  overlaps_a,
conflict_function **  overlaps_b,
tree last_conflicts 
)
static
Analyze a SIV (Single Index Variable) subscript where CHREC_A is a
   constant, and CHREC_B is an affine function.  *OVERLAPS_A and
   *OVERLAPS_B are initialized to the functions that describe the
   relation between the elements accessed twice by CHREC_A and
   CHREC_B.  For k >= 0, the following property is verified:

   CHREC_A (*OVERLAPS_A (k)) = CHREC_B (*OVERLAPS_B (k)).   

References affine_fn_cst(), chrec_convert(), chrec_dont_know, chrec_fold_minus(), chrec_is_positive(), compare_tree_int(), conflict_fn(), conflict_fn_no_dependence(), conflict_fn_not_known(), dependence_stats, dump_file, dump_flags, free_conflict_function(), get_chrec_loop(), HOST_WIDE_INT, initial_condition(), integer_zerop(), max_stmt_executions_int(), datadep_stats::num_siv_dependent, datadep_stats::num_siv_independent, datadep_stats::num_siv_unimplemented, signed_type_for_types(), tree_fold_divides_p(), and type().

Referenced by analyze_siv_subscript().

static void analyze_subscript_affine_affine ( tree  chrec_a,
tree  chrec_b,
conflict_function **  overlaps_a,
conflict_function **  overlaps_b,
tree last_conflicts 
)
static
static void analyze_ziv_subscript ( tree  chrec_a,
tree  chrec_b,
conflict_function **  overlaps_a,
conflict_function **  overlaps_b,
tree last_conflicts 
)
static
Analyze a ZIV (Zero Index Variable) subscript.  *OVERLAPS_A and
   *OVERLAPS_B are initialized to the functions that describe the
   relation between the elements accessed twice by CHREC_A and
   CHREC_B.  For k >= 0, the following property is verified:

   CHREC_A (*OVERLAPS_A (k)) = CHREC_B (*OVERLAPS_B (k)).   

References affine_fn_cst(), chrec_convert(), chrec_dont_know, chrec_fold_minus(), conflict_fn(), conflict_fn_no_dependence(), conflict_fn_not_known(), dependence_stats, dump_file, dump_flags, integer_zerop(), datadep_stats::num_ziv, datadep_stats::num_ziv_dependent, datadep_stats::num_ziv_independent, datadep_stats::num_ziv_unimplemented, signed_type_for_types(), and type().

Referenced by analyze_overlapping_iterations().

static void build_classic_dir_vector ( )
static
Compute the classic per loop direction vector.  DDR is the data
   dependence relation to build a vector from.   

References DDR_DIST_VECTS, DDR_NB_LOOPS, dir_from_dist(), lambda_vector_new(), and save_dir_v().

Referenced by subscript_dependence_tester().

static bool build_classic_dist_vector ( struct data_dependence_relation ddr,
struct loop loop_nest 
)
static
static bool build_classic_dist_vector_1 ( struct data_dependence_relation ddr,
struct data_reference ddr_a,
struct data_reference ddr_b,
lambda_vector  dist_v,
bool *  init_b,
int *  index_carry 
)
static
Return false when fail to represent the data dependence as a
   distance vector.  INIT_B is set to true when a component has been
   added to the distance vector DIST_V.  INDEX_CARRY is then set to
   the index in DIST_V that carries the dependence.   

References chrec_contains_undetermined(), chrec_known, DDR_LOOP_NEST, DDR_NB_LOOPS, DDR_NUM_SUBSCRIPTS, DDR_SUBSCRIPT, DR_ACCESS_FN, finalize_ddr_dependent(), index_in_loop_nest(), int_cst_value(), lambda_vector_new(), non_affine_dependence_relation(), operand_equal_p(), and SUB_DISTANCE.

Referenced by build_classic_dist_vector().

struct graph* build_empty_rdg ( )
read
Build the Reduced Dependence Graph (RDG) with one vertex per
   statement of the loop nest, and one edge per data dependence or
   scalar dependence.   

References new_graph().

Referenced by build_rdg().

struct graph* build_rdg ( struct loop loop,
vec< loop_p > *  loop_nest,
vec< ddr_p > *  dependence_relations,
vec< data_reference_p > *  datarefs 
)
read
Build the Reduced Dependence Graph (RDG) with one vertex per
   statement of the loop nest, and one edge per data dependence or
   scalar dependence.   

References build_empty_rdg(), compute_data_dependences_for_loop(), create_rdg_edges(), create_rdg_vertices(), known_dependences_p(), and stmts_from_loop().

Referenced by distribute_loop().

static bool can_use_analyze_subscript_affine_affine ( )
static
Returns true when analyze_subscript_affine_affine can be used for
   determining the dependence relation between chrec_a and chrec_b,
   that contain symbols.  This function modifies chrec_a and chrec_b
   such that the analysis result is the same, and such that they don't
   contain symbols, and then can safely be passed to the analyzer.

   Example: The analysis of the following tuples of evolutions produce
   the same results: {x+1, +, 1}_1 vs. {x+3, +, 1}_1, and {-2, +, 1}_1
   vs. {0, +, 1}_1

   {x+1, +, 1}_1 ({2, +, 1}_1) = {x+3, +, 1}_1 ({0, +, 1}_1)
   {-2, +, 1}_1 ({2, +, 1}_1) = {0, +, 1}_1 ({0, +, 1}_1)

References build_int_cst(), build_polynomial_chrec(), chrec_contains_symbols(), chrec_convert(), chrec_fold_minus(), chrec_type(), dump_file, dump_flags, evolution_function_is_constant_p(), and type().

Referenced by analyze_siv_subscript().

static tree canonicalize_base_object_address ( )
static
Returns the address ADDR of an object in a canonical shape (without nop
   casts, and with type of pointer to the object).   

Referenced by dr_analyze_innermost().

static bool chrec_is_positive ( )
static
Determine whether the CHREC is always positive/negative.  If the expression
   cannot be statically analyzed, return false, otherwise set the answer into
   VALUE.   

References build_int_cst(), chrec_apply(), chrec_contains_undetermined(), chrec_fold_minus(), evolution_function_is_affine_p(), get_chrec_loop(), number_of_latch_executions(), and tree_int_cst_sgn().

Referenced by analyze_siv_subscript_cst_affine().

static affine_fn common_affine_function ( )
static
If all the functions in CF are the same, returns one of them,
   otherwise returns NULL.   

References affine_function_equal_p(), CF_NONTRIVIAL_P, conflict_function::fns, and conflict_function::n.

Referenced by compute_subscript_distance().

void compute_affine_dependence ( struct data_dependence_relation ddr,
struct loop loop_nest 
)
This computes the affine dependence relation between A and B with
   respect to LOOP_NEST.  CHREC_KNOWN is used for representing the
   independence between two accesses, while CHREC_DONT_KNOW is used
   for representing the unknown relation.

   Note that it is possible to stop the computation of the dependence
   relation the first time we detect a CHREC_KNOWN element for a given
   subscript.   

References access_functions_are_affine_or_constant_p(), chrec_dont_know, chrec_known, DDR_A, DDR_ARE_DEPENDENT, DDR_B, ddr_consistent_p(), DDR_DIR_VECTS, DDR_DIST_VECTS, dependence_stats, DR_STMT, dump_data_dependence_relation(), dump_data_reference(), dump_file, dump_flags, finalize_ddr_dependent(), init_omega_for_ddr(), datadep_stats::num_dependence_tests, datadep_stats::num_dependence_undetermined, print_gimple_stmt(), and subscript_dependence_tester().

Referenced by classify_partition(), and compute_all_dependences().

bool compute_all_dependences ( vec< data_reference_p datarefs,
vec< ddr_p > *  dependence_relations,
vec< loop_p loop_nest,
bool  compute_self_and_rr 
)
Compute in DEPENDENCE_RELATIONS the data dependence graph for all
   the data references in DATAREFS, in the LOOP_NEST.  When
   COMPUTE_SELF_AND_RR is FALSE, don't compute read-read and self
   relations.  Return true when successful, i.e. data references number
   is small enough to be handled.   

References compute_affine_dependence(), DR_IS_WRITE, and initialize_data_dependence_relation().

Referenced by compute_data_dependences_for_bb(), compute_data_dependences_for_loop(), cond_if_else_store_replacement(), determine_loop_nest_reuse(), vect_analyze_data_ref_dependences(), and vect_slp_analyze_data_ref_dependences().

bool compute_data_dependences_for_bb ( basic_block  bb,
bool  compute_self_and_read_read_dependences,
vec< data_reference_p > *  datarefs,
vec< ddr_p > *  dependence_relations 
)
Returns true when the data dependences for the basic block BB have been
   computed, false otherwise.
   DATAREFS is initialized to all the array elements contained in this basic
   block, DEPENDENCE_RELATIONS contains the relations between the data
   references. Compute read-read and self relations if
   COMPUTE_SELF_AND_READ_READ_DEPENDENCES is TRUE.   

References chrec_dont_know, compute_all_dependences(), find_data_references_in_bb(), and vNULL.

bool compute_data_dependences_for_loop ( struct loop loop,
bool  compute_self_and_read_read_dependences,
vec< loop_p > *  loop_nest,
vec< data_reference_p > *  datarefs,
vec< ddr_p > *  dependence_relations 
)
static void compute_overlap_steps_for_affine_1_2 ( tree  chrec_a,
tree  chrec_b,
conflict_function **  overlaps_a,
conflict_function **  overlaps_b,
tree last_conflicts 
)
static
Solves the special case of a Diophantine equation where CHREC_A is
   an affine bivariate function, and CHREC_B is an affine univariate
   function.  For example,

   | {{0, +, 1}_x, +, 1335}_y = {0, +, 1336}_z

   has the following overlapping functions:

   | x (t, u, v) = {{0, +, 1336}_t, +, 1}_v
   | y (t, u, v) = {{0, +, 1336}_u, +, 1}_v
   | z (t, u, v) = {{{0, +, 1}_t, +, 1335}_u, +, 1}_v

   FORNOW: This is a specialized implementation for a case occurring in
   a common benchmark.  Implement the general algorithm.   

References affine_fn_cst(), affine_fn_free(), affine_fn_plus(), chrec_dont_know, compute_overlap_steps_for_affine_univar(), conflict_fn(), conflict_fn_not_known(), dump_file, dump_flags, get_chrec_loop(), HOST_WIDE_INT, int_cst_value(), integer_zerop(), and max_stmt_executions_int().

Referenced by analyze_subscript_affine_affine().

static void compute_overlap_steps_for_affine_univar ( int  niter,
int  step_a,
int  step_b,
affine_fn overlaps_a,
affine_fn overlaps_b,
tree last_conflicts,
int  dim 
)
static
Solves the special case of the Diophantine equation:
   | {0, +, STEP_A}_x (OVERLAPS_A) = {0, +, STEP_B}_y (OVERLAPS_B)

   Computes the descriptions OVERLAPS_A and OVERLAPS_B.  NITER is the
   number of iterations that loops X and Y run.  The overlaps will be
   constructed as evolutions in dimension DIM.   

References affine_fn_cst(), affine_fn_univar(), build_int_cst(), chrec_dont_know, and gcd().

Referenced by analyze_subscript_affine_affine(), and compute_overlap_steps_for_affine_1_2().

static void compute_subscript_distance ( )
static
static conflict_function* conflict_fn ( )
static
static conflict_function* conflict_fn_no_dependence ( )
static
static bool constant_access_functions ( )
static
Return true when the DDR contains only constant access functions.   

References DDR_A, DDR_B, DDR_NUM_SUBSCRIPTS, DR_ACCESS_FN, and evolution_function_is_constant_p().

Referenced by build_classic_dist_vector().

struct data_reference* create_data_ref ( loop_p  nest,
loop_p  loop,
tree  memref,
gimple  stmt,
bool  is_read 
)
read
Analyzes memory reference MEMREF accessed in STMT.  The reference
   is read if IS_READ is true, write otherwise.  Returns the
   data_reference description of MEMREF.  NEST is the outermost loop
   in which the reference should be instantiated, LOOP is the loop in
   which the data reference should be analyzed.   

References DR_ACCESS_FN, DR_ALIGNED_TO, dr_analyze_alias(), dr_analyze_indices(), dr_analyze_innermost(), DR_BASE_ADDRESS, DR_BASE_OBJECT, DR_INIT, DR_IS_READ, DR_NUM_DIMENSIONS, DR_OFFSET, DR_REF, DR_STEP, DR_STMT, dump_file, dump_flags, data_reference::is_read, print_generic_expr(), print_generic_stmt(), and data_reference::stmt.

Referenced by create_rdg_vertices(), determine_loop_nest_reuse(), find_data_references_in_stmt(), graphite_find_data_references_in_stmt(), and vect_analyze_data_refs().

static void create_rdg_edge_for_ddr ( )
static
Creates an edge in RDG for each distance vector from DDR.  The
   order that we keep track of in the RDG is the order in which
   statements have to be executed.   

References add_edge(), anti_dd, graph_edge::data, DDR_A, DDR_B, ddr_dependence_level(), DDR_REVERSED_P, DR_IS_READ, DR_IS_WRITE, DR_STMT, flow_dd, input_dd, output_dd, rdg_vertex_for_stmt(), RDGE_LEVEL, RDGE_RELATION, and RDGE_TYPE.

Referenced by create_rdg_edges().

static void create_rdg_edges ( )
static
Creates the edges of the reduced dependence graph RDG.   

References create_rdg_edge_for_ddr(), create_rdg_edges_for_scalar(), DDR_ARE_DEPENDENT, graph::n_vertices, and RDG_STMT.

Referenced by build_rdg().

static void create_rdg_edges_for_scalar ( )
static
Creates dependence edges in RDG for all the uses of DEF.  IDEF is
   the index of DEF in RDG.   

References add_edge(), graph_edge::data, flow_dd, rdg_vertex_for_stmt(), RDGE_RELATION, and RDGE_TYPE.

Referenced by create_rdg_edges().

static void create_rdg_vertices ( )
static
static bool ddr_consistent_p ( FILE *  file,
struct data_dependence_relation ddr,
vec< lambda_vector dist_vects,
vec< lambda_vector dir_vects 
)
static
Return true when DDR contains the same information as that stored
   in DIR_VECTS and in DIST_VECTS, return false otherwise.    

References DDR_DIR_VECT, DDR_DIR_VECTS, DDR_DIST_VECT, DDR_DIST_VECTS, DDR_NB_LOOPS, DDR_NUM_DIR_VECTS, DDR_NUM_DIST_VECTS, dump_data_dependence_relation(), dump_file, dump_flags, lambda_vector_equal(), print_dir_vectors(), print_dist_vectors(), and print_lambda_vector().

Referenced by compute_affine_dependence().

DEBUG_FUNCTION void debug ( )
Unified dump into FILE all the data references from DATAREFS.   
Unified dump function for a DATA_REFERENCE structure.   

References dump_data_references().

DEBUG_FUNCTION void debug_data_dependence_relation ( )
Debug version.   

References dump_data_dependence_relation().

DEBUG_FUNCTION void debug_data_dependence_relations ( )
Dump to STDERR all the dependence relations from DDRS.   

References dump_data_dependence_relations().

DEBUG_FUNCTION void debug_data_reference ( )
Print to STDERR the data_reference DR.   

References dump_data_reference().

DEBUG_FUNCTION void debug_data_references ( )
Dump into STDERR all the data references from DATAREFS.   

References dump_data_references().

DEBUG_FUNCTION void debug_ddrs ( )

References dump_ddrs().

DEBUG_FUNCTION void debug_rdg ( )
Call dump_rdg on stderr.   

References dump_rdg().

DEBUG_FUNCTION void debug_rdg_component ( )
Call dump_rdg_vertex on stderr.   

References dump_rdg_component().

DEBUG_FUNCTION void debug_rdg_vertex ( )
Call dump_rdg_vertex on stderr.   

References dump_rdg_vertex().

static enum data_dependence_direction dir_from_dist ( )
inlinestatic
Return the direction for a given distance.
   FIXME: Computing dir this way is suboptimal, since dir can catch
   cases that dist is unable to represent.   

References dir_equal, dir_negative, and dir_positive.

Referenced by build_classic_dir_vector(), and omega_extract_distance_vectors().

void dot_rdg ( struct graph )
Display the Reduced Dependence Graph using dotty.   
DEBUG_FUNCTION void dot_rdg ( )

References dot_rdg_1().

static void dr_analyze_alias ( )
static
Extracts the alias analysis information from the memory reference DR.   

References DR_PTR_INFO, DR_REF, and get_base_address().

Referenced by create_data_ref().

static void dr_analyze_indices ( )
static
bool dr_analyze_innermost ( )
bool dr_equal_offsets_p ( struct data_reference dra,
struct data_reference drb 
)
Check if DRA and DRB have equal offsets.   

References dr_equal_offsets_p1(), and DR_OFFSET.

Referenced by dr_group_sort_cmp(), vect_analyze_data_ref_accesses(), and vect_slp_analyze_data_ref_dependence().

static bool dr_equal_offsets_p1 ( )
static
Check if OFFSET1 and OFFSET2 (DR_OFFSETs of some data-refs) are identical
   expressions.   

Referenced by dr_equal_offsets_p().

bool dr_may_alias_p ( const struct data_reference a,
const struct data_reference b,
bool  loop_nest 
)
static void dump_affine_function ( )
static
Dumps the affine function described by FN to the file OUTF.   

References print_generic_expr().

Referenced by dump_conflict_function().

static void dump_conflict_function ( )
static
void dump_data_dependence_relations ( FILE *  file,
vec< ddr_p ddrs 
)
void dump_data_reference ( FILE *  outf,
struct data_reference dr 
)
static void dump_data_references ( )
static
Dump into FILE all the data references from DATAREFS.   

References dump_data_reference().

Referenced by debug(), and debug_data_references().

static void dump_ddrs ( )
static
Dumps the data dependence relations DDRS in FILE.   

References dump_data_dependence_relation().

Referenced by debug_ddrs().

static void dump_dist_dir_vectors ( )
static
Dumps the distance and direction vectors in FILE.  DDRS contains
   the dependence relations, and VECT_SIZE is the size of the
   dependence vectors, or in other words the number of loops in the
   considered nest.   

References DDR_AFFINE_P, DDR_ARE_DEPENDENT, DDR_DIR_VECTS, DDR_DIST_VECTS, DDR_NB_LOOPS, print_direction_vector(), and print_lambda_vector().

Referenced by analyze_all_data_dependences().

void dump_rdg ( )
Dump the reduced dependence graph RDG to FILE.   

References bitmap_bit_p(), vertex::component, dump_rdg_component(), graph::n_vertices, and graph::vertices.

Referenced by debug_rdg(), and distribute_loop().

static void dump_rdg_component ( )
static
Dump component C of RDG to FILE.  If DUMPED is non-null, set the
   dumped vertices to that bitmap.   

References bitmap_set_bit(), vertex::component, dump_rdg_vertex(), graph::n_vertices, and graph::vertices.

Referenced by debug_rdg_component(), and dump_rdg().

static void dump_subscript ( )
static
static void finalize_ddr_dependent ( struct data_dependence_relation ddr,
tree  chrec 
)
inlinestatic
Set DDR_ARE_DEPENDENT to CHREC and finalize the subscript overlap
   description.   

References DDR_ARE_DEPENDENT, DDR_SUBSCRIPTS, and free_subscripts().

Referenced by build_classic_dist_vector_1(), compute_affine_dependence(), and subscript_dependence_tester_1().

tree find_data_references_in_bb ( struct loop loop,
basic_block  bb,
vec< data_reference_p > *  datarefs 
)
Search the data references in LOOP, and record the information into
   DATAREFS.  Returns chrec_dont_know when failing to analyze a
   difficult case, returns NULL_TREE otherwise.   

References chrec_dont_know, find_data_references_in_stmt(), gsi_end_p(), gsi_next(), gsi_start_bb(), and gsi_stmt().

Referenced by compute_data_dependences_for_bb(), cond_if_else_store_replacement(), and find_data_references_in_loop().

tree find_data_references_in_loop ( struct loop loop,
vec< data_reference_p > *  datarefs 
)
Search the data references in LOOP, and record the information into
   DATAREFS.  Returns chrec_dont_know when failing to analyze a
   difficult case, returns NULL_TREE otherwise.

   TODO: This function should be made smarter so that it can handle address
   arithmetic as if they were array accesses, etc.   

References chrec_dont_know, find_data_references_in_bb(), free(), get_loop_body_in_dom_order(), and loop::num_nodes.

Referenced by compute_data_dependences_for_loop(), and vect_analyze_data_refs().

bool find_data_references_in_stmt ( struct loop nest,
gimple  stmt,
vec< data_reference_p > *  datarefs 
)
Stores the data references in STMT to DATAREFS.  If there is an unanalyzable
   reference, returns false, otherwise returns true.  NEST is the outermost
   loop of the loop nest in which the references should be analyzed.   

References create_data_ref(), get_references_in_stmt(), data_ref_loc_d::is_read, loop_containing_stmt(), and data_ref_loc_d::pos.

Referenced by find_data_references_in_bb(), and vect_analyze_data_refs().

bool find_loop_nest ( )
Return false when the LOOP is not well nested.  Otherwise return
   true and insert in LOOP_NEST the loops of the nest.  LOOP_NEST will
   contain the loops from the outermost to the innermost, as they will
   appear in the classic distance vector.   

References find_loop_nest_1(), and loop::inner.

Referenced by compute_data_dependences_for_loop(), determine_loop_nest_reuse(), and vect_analyze_data_refs().

static bool find_loop_nest_1 ( )
static
Recursive helper function.   

References loop::inner, and loop::next.

Referenced by find_loop_nest().

static void free_conflict_function ( )
static
void free_data_ref ( )
Frees data reference DR.   

References DR_ACCESS_FNS, and free().

Referenced by free_data_refs(), and vect_analyze_data_refs().

void free_dependence_relation ( )
Free the memory used by a data dependence relation DDR.   

References DDR_DIR_VECTS, DDR_DIST_VECTS, DDR_SUBSCRIPTS, free(), and free_subscripts().

Referenced by classify_partition(), and free_dependence_relations().

void free_dependence_relations ( )
static void free_subscripts ( )
static
static bool gcd_of_steps_may_divide_p ( )
static
Returns false if we can prove that the greatest common divisor of the steps
   of CHREC does not divide CST, false otherwise.   

References gcd(), host_integerp(), HOST_WIDE_INT, and tree_low_cst().

Referenced by analyze_miv_subscript().

bool graphite_find_data_references_in_stmt ( loop_p  nest,
loop_p  loop,
gimple  stmt,
vec< data_reference_p > *  datarefs 
)
Stores the data references in STMT to DATAREFS.  If there is an
   unanalyzable reference, returns false, otherwise returns true.
   NEST is the outermost loop of the loop nest in which the references
   should be instantiated, LOOP is the loop in which the references
   should be analyzed.   

References create_data_ref(), get_references_in_stmt(), data_ref_loc_d::is_read, and data_ref_loc_d::pos.

Referenced by analyze_drs_in_stmts(), stmt_has_simple_data_refs_p(), and try_generate_gimple_bb().

static bool init_omega_eq_with_af ( omega_pb  pb,
unsigned  eq,
unsigned int  offset,
tree  access_fun,
struct data_dependence_relation ddr 
)
static
Initializes an equation for an OMEGA problem using the information
   contained in the ACCESS_FUN.  Returns true when the operation
   succeeded.

   PB is the omega constraint system.
   EQ is the number of the equation to be initialized.
   OFFSET is used for shifting the variables names in the constraints:
   a constrain is composed of 2 * the number of variables surrounding
   dependence accesses.  OFFSET is set either to 0 for the first n variables,
   then it is set to n.
   ACCESS_FUN is expected to be an affine chrec.   

References eqn_d::coef, DDR_INNER_LOOP, DDR_LOOP_NEST, DDR_NB_LOOPS, omega_pb_d::eqs, index_in_loop_nest(), and int_cst_value().

Referenced by omega_setup_subscript().

static bool init_omega_for_ddr ( struct data_dependence_relation ddr,
bool *  maybe_dependent 
)
static
Sets up the Omega dependence problem for the data dependence
   relation DDR.  Returns false when the constraint system cannot be
   built, ie. when the test answers "don't know".  Returns true
   otherwise, and when independence has been proved (using one of the
   trivial dependence test), set MAYBE_DEPENDENT to false, otherwise
   set MAYBE_DEPENDENT to true.

   Example: for setting up the dependence system corresponding to the
   conflicting accesses

   | loop_i
   |   loop_j
   |     A[i, i+1] = ...
   |     ... A[2*j, 2*(i + j)]
   |   endloop_j
   | endloop_i

   the following constraints come from the iteration domain:

   0 <= i <= Ni
   0 <= i + di <= Ni
   0 <= j <= Nj
   0 <= j + dj <= Nj

   where di, dj are the distance variables.  The constraints
   representing the conflicting elements are:

   i = 2 * (j + dj)
   i + 1 = 2 * (i + di + j + dj)

   For asking that the resulting distance vector (di, dj) be
   lexicographically positive, we insert the constraint "di >= 0".  If
   "di = 0" in the solution, we fix that component to zero, and we
   look at the inner loops: we set a new problem where all the outer
   loop distances are zero, and fix this inner component to be
   positive.  When one of the components is positive, we save that
   distance, and set a new problem where the distance on this loop is
   zero, searching for other distances in the inner loops.  Here is
   the classic example that illustrates that we have to set for each
   inner loop a new problem:

   | loop_1
   |   loop_2
   |     A[10]
   |   endloop_2
   | endloop_1

   we have to save two distances (1, 0) and (0, 1).

   Given two array references, refA and refB, we have to set the
   dependence problem twice, refA vs. refB and refB vs. refA, and we
   cannot do a single test, as refB might occur before refA in the
   inner loops, and the contrary when considering outer loops: ex.

   | loop_0
   |   loop_1
   |     loop_2
   |       T[{1,+,1}_2][{1,+,1}_1]  // refA
   |       T[{2,+,1}_2][{0,+,1}_1]  // refB
   |     endloop_2
   |   endloop_1
   | endloop_0

   refB touches the elements in T before refA, and thus for the same
   loop_0 refB precedes refA: ie. the distance vector (0, 1, -1)
   but for successive loop_0 iterations, we have (1, -1, 1)

   The Omega solver expects the distance variables ("di" in the
   previous example) to come first in the constraint system (as
   variables to be protected, or "safe" variables), the constraint
   system is built using the following layout:

   "cst | distance vars | index vars".

References DDR_A, DDR_B, DDR_NB_LOOPS, dir_equal, init_omega_for_ddr_1(), lambda_vector_new(), omega_alloc_problem(), omega_free_problem(), same_access_functions(), save_dir_v(), and save_dist_v().

Referenced by compute_affine_dependence().

static bool init_omega_for_ddr_1 ( struct data_reference dra,
struct data_reference drb,
struct data_dependence_relation ddr,
omega_pb  pb,
bool *  maybe_dependent 
)
static
struct data_dependence_relation* initialize_data_dependence_relation ( struct data_reference a,
struct data_reference b,
vec< loop_p loop_nest 
)
read
static tree initialize_matrix_A ( )
static
Helper recursive function for initializing the matrix A.  Returns
   the initial value of CHREC.   

References build_int_cst(), chrec_convert(), chrec_fold_op(), chrec_type(), and int_cst_value().

Referenced by analyze_subscript_affine_affine().

static void insert_innermost_unit_dist_vector ( )
static
static bool int_divides_p ( )
inlinestatic
Returns true iff A divides B.   

Referenced by analyze_subscript_affine_affine(), and omega_setup_subscript().

static bool known_dependences_p ( )
static
Returns true when all the dependences are computable.   

References chrec_dont_know, and DDR_ARE_DEPENDENT.

Referenced by build_rdg().

static void lambda_matrix_copy ( lambda_matrix  mat1,
lambda_matrix  mat2,
int  m,
int  n 
)
static
Copy the elements of M x N matrix MAT1 to MAT2.   

References lambda_vector_copy().

Referenced by lambda_matrix_right_hermite().

static void lambda_matrix_id ( )
static
Store the N x N identity matrix in MAT.   

Referenced by lambda_matrix_right_hermite().

static void lambda_matrix_right_hermite ( lambda_matrix  A,
int  m,
int  n,
lambda_matrix  S,
lambda_matrix  U 
)
static
Given an M x N integer matrix A, this function determines an M x
   M unimodular matrix U, and an M x N echelon matrix S such that
   "U.A = S".  This decomposition is also known as "right Hermite".

   Ref: Algorithm 2.1 page 33 in "Loop Transformations for
   Restructuring Compilers" Utpal Banerjee.   

References lambda_matrix_copy(), lambda_matrix_id(), lambda_matrix_row_add(), lambda_matrix_row_exchange(), and lambda_vector_first_nz().

Referenced by analyze_subscript_affine_affine().

static void lambda_matrix_row_add ( )
static
Add a multiple of row R1 of matrix MAT with N columns to row R2:
   R2 = R2 + CONST1 * R1.   

Referenced by lambda_matrix_right_hermite().

static void lambda_matrix_row_exchange ( )
static
Swap rows R1 and R2 in matrix MAT.   

Referenced by lambda_matrix_right_hermite().

static void lambda_matrix_row_negate ( )
static
Negate row R1 of matrix MAT which has N columns.   

References lambda_vector_negate().

Referenced by analyze_subscript_affine_affine().

static void lambda_vector_copy ( lambda_vector  vec1,
lambda_vector  vec2,
int  size 
)
static
Copy the elements of vector VEC1 with length SIZE to VEC2.   

References memcpy().

Referenced by add_outer_distances(), build_classic_dist_vector(), and lambda_matrix_copy().

static bool lambda_vector_equal ( )
static
Return true if two vectors are equal.   

Referenced by ddr_consistent_p(), save_dir_v(), and save_dist_v().

static int lambda_vector_first_nz ( )
static
Return the first nonzero element of vector VEC1 between START and N.
   We must have START <= N.   Returns N if VEC1 is the zero vector.   

Referenced by build_classic_dist_vector(), and lambda_matrix_right_hermite().

static void lambda_vector_mult_const ( lambda_vector  vec1,
lambda_vector  vec2,
int  size,
int  const1 
)
static
Multiply vector VEC1 of length SIZE by a constant CONST1,
   and store the result in VEC2.   

References lambda_vector_clear().

Referenced by lambda_vector_negate().

static void lambda_vector_negate ( lambda_vector  vec1,
lambda_vector  vec2,
int  size 
)
static
Negate vector VEC1 with length SIZE and store it in VEC2.   

References lambda_vector_mult_const().

Referenced by lambda_matrix_row_negate().

static tree max_stmt_executions_tree ( )
static
Similar to max_stmt_executions_int, but returns the bound as a tree,
   and only if it fits to the int type.  If this is not the case, or the
   bound  on the number of iterations of LOOP could not be derived, returns
   chrec_dont_know.   

References chrec_dont_know, double_int_fits_to_tree_p(), double_int_to_tree(), and max_stmt_executions().

Referenced by analyze_miv_subscript().

static void non_affine_dependence_relation ( )
inlinestatic
The dependence relation DDR cannot be represented by a distance
   vector.   

References DDR_AFFINE_P, dump_file, and dump_flags.

Referenced by build_classic_dist_vector_1().

static bool object_address_invariant_in_loop_p ( )
static
Returns true if the address of OBJ is invariant in LOOP.   

References chrec_contains_symbols_defined_in_loop(), handled_component_p(), and loop::num.

Referenced by initialize_data_dependence_relation().

static void omega_extract_distance_vectors ( omega_pb  pb,
struct data_dependence_relation ddr 
)
static
As explained in the comments preceding init_omega_for_ddr, we have
   to set up a system for each loop level, setting outer loops
   variation to zero, and current loop variation to positive or zero.
   Save each lexico positive distance vector.   

References eqn_d::coef, copy(), DDR_INNER_LOOP, DDR_LOOP_NEST, DDR_NB_LOOPS, dir_from_dist(), omega_pb_d::eqs, omega_pb_d::geqs, eqn_d::key, lambda_vector_new(), omega_pb_d::num_geqs, omega_pb_d::num_subs, omega_add_zero_eq(), omega_add_zero_geq(), omega_alloc_problem(), omega_black, omega_copy_problem(), omega_false, omega_free_problem(), omega_simplify_problem(), omega_unknown, save_dir_v(), save_dist_v(), and omega_pb_d::subs.

Referenced by init_omega_for_ddr_1().

static bool omega_setup_subscript ( tree  access_fun_a,
tree  access_fun_b,
struct data_dependence_relation ddr,
omega_pb  pb,
bool *  maybe_dependent 
)
static
static void print_dir_vectors ( FILE *  outf,
vec< lambda_vector dir_vects,
int  length 
)
static
Print a vector of direction vectors.   

References print_direction_vector().

Referenced by ddr_consistent_p().

static void print_direction_vector ( FILE *  outf,
lambda_vector  dirv,
int  length 
)
static
static void print_dist_vectors ( FILE *  outf,
vec< lambda_vector dist_vects,
int  length 
)
static
Print a vector of distance vectors.   

References print_lambda_vector().

Referenced by ddr_consistent_p().

static void print_lambda_vector ( )
inlinestatic
bool rdg_defs_used_in_other_loops_p ( )
Determines whether the statement from vertex V of the RDG has a
   definition used outside the loop that contains this statement.   

References loop_containing_stmt(), and RDG_STMT.

Referenced by rdg_build_partitions().

int rdg_vertex_for_stmt ( )
static void save_dir_v ( )
static
Helper function for uniquely inserting direction vectors.   

References DDR_DIR_VECTS, DDR_NB_LOOPS, and lambda_vector_equal().

Referenced by build_classic_dir_vector(), init_omega_for_ddr(), and omega_extract_distance_vectors().

static void save_dist_v ( )
static
static tree signed_type_for_types ( )
static
Returns a signed integer type with the largest precision from TA
   and TB.   

References signed_type_for().

Referenced by affine_fn_op(), analyze_miv_subscript(), analyze_siv_subscript_cst_affine(), analyze_ziv_subscript(), and omega_setup_subscript().

static bool siv_subscript_p ( )
static
Returns true iff CHREC_A and CHREC_B are dependent on an index
   variable, i.e., if the SIV (Single Index Variable) test is true.   

References evolution_function_is_constant_p(), and evolution_function_is_univariate_p().

Referenced by analyze_overlapping_iterations().

void split_constant_offset ( )
Expresses EXP as VAR + OFF, where off is a constant.  The type of OFF
   will be ssizetype.   

References exp(), extract_ops_from_tree(), get_gimple_rhs_class(), GIMPLE_TERNARY_RHS, split_constant_offset_1(), and tree_is_chrec().

Referenced by dr_analyze_indices(), dr_analyze_innermost(), split_constant_offset_1(), and vect_analyze_data_refs().

static bool split_constant_offset_1 ( tree  type,
tree  op0,
enum tree_code  code,
tree  op1,
tree var,
tree off 
)
static
Helper function for split_constant_offset.  Expresses OP0 CODE OP1
   (the type of the result is TYPE) as VAR + OFF, where OFF is a nonzero
   constant of type ssizetype, and returns true.  If we cannot do this
   with OFF nonzero, OFF and VAR are set to NULL_TREE instead and false
   is returned.   

References build_int_cst(), get_inner_reference(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), HOST_WIDE_INT, int_size_in_bytes(), and split_constant_offset().

Referenced by split_constant_offset().

static void stmts_from_loop ( )
static
Initialize STMTS with all the statements of LOOP.  When
   INCLUDE_PHIS is true, include also the PHI nodes.  The order in
   which we discover statements is important as
   generate_loops_for_partition is using the same traversal for
   identifying statements.  

References free(), get_loop_body_in_dom_order(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), is_gimple_debug(), and loop::num_nodes.

Referenced by build_rdg().

static void subscript_dependence_tester ( struct data_dependence_relation ddr,
struct loop loop_nest 
)
static
static bool subscript_dependence_tester_1 ( struct data_dependence_relation ddr,
struct data_reference dra,
struct data_reference drb,
struct loop loop_nest 
)
static
void tree_check_data_deps ( void  )
Computes all the data dependences and check that the results of
   several analyzers are the same.   

References analyze_all_data_dependences().

Referenced by check_data_deps().

static bool tree_fold_divides_p ( )
inlinestatic
Returns true iff A divides B.   

References int_const_binop(), and integer_zerop().

Referenced by analyze_siv_subscript_cst_affine().

static bool ziv_subscript_p ( )
inlinestatic
This section contains the classic Banerjee tests.   
Returns true iff CHREC_A and CHREC_B are not dependent on any index
   variables, i.e., if the ZIV (Zero Index Variable) test is true.   

References evolution_function_is_constant_p().

Referenced by analyze_overlapping_iterations(), and omega_setup_subscript().


Variable Documentation