GCC Middle and Back End API Reference
loop_distribution Class Reference
Collaboration diagram for loop_distribution:

Public Member Functions

int get_bb_top_order_index_size (void)
 
int get_bb_top_order_index (int i)
 
unsigned int execute (function *fun)
 

Private Member Functions

bool create_rdg_vertices (struct graph *rdg, const vec< gimple * > &stmts, loop_p loop)
 
void stmts_from_loop (class loop *loop, vec< gimple * > *stmts)
 
struct graphbuild_rdg (class loop *loop, control_dependences *cd)
 
void partition_merge_into (struct graph *rdg, partition *dest, partition *partition, enum fuse_type ft)
 
data_dependence_relationget_data_dependence (struct graph *rdg, data_reference_p a, data_reference_p b)
 
bool data_dep_in_cycle_p (struct graph *rdg, data_reference_p dr1, data_reference_p dr2)
 
void update_type_for_merge (struct graph *rdg, partition *partition1, partition *partition2)
 
partitionbuild_rdg_partition_for_vertex (struct graph *rdg, int v)
 
void classify_builtin_ldst (loop_p loop, struct graph *rdg, partition *partition, data_reference_p dst_dr, data_reference_p src_dr)
 
bool classify_partition (loop_p loop, struct graph *rdg, partition *partition, bitmap stmt_in_all_partitions)
 
bool share_memory_accesses (struct graph *rdg, partition *partition1, partition *partition2)
 
void rdg_build_partitions (struct graph *rdg, vec< gimple * > starting_stmts, vec< partition * > *partitions)
 
int pg_add_dependence_edges (struct graph *rdg, int dir, bitmap drs1, bitmap drs2, vec< ddr_p > *alias_ddrs)
 
struct graphbuild_partition_graph (struct graph *rdg, vec< struct partition * > *partitions, bool ignore_alias_p)
 
void merge_dep_scc_partitions (struct graph *rdg, vec< struct partition * > *partitions, bool ignore_alias_p)
 
void break_alias_scc_partitions (struct graph *rdg, vec< struct partition * > *partitions, vec< ddr_p > *alias_ddrs)
 
void finalize_partitions (class loop *loop, vec< struct partition * > *partitions, vec< ddr_p > *alias_ddrs)
 
int distribute_loop (class loop *loop, const vec< gimple * > &stmts, control_dependences *cd, int *nb_calls, bool *destroy_p, bool only_patterns_p)
 
bool transform_reduction_loop (loop_p loop)
 
void bb_top_order_init (void)
 
void bb_top_order_destroy (void)
 

Private Attributes

vec< loop_ploop_nest
 
vec< data_reference_pdatarefs_vec
 
bool has_nonaddressable_dataref_p
 
hash_table< ddr_hasher > * ddrs_table
 
int * bb_top_order_index
 
int bb_top_order_index_size
 

Member Function Documentation

◆ bb_top_order_destroy()

void loop_distribution::bb_top_order_destroy ( void )
private

References bb_top_order_index, bb_top_order_index_size, free(), and NULL.

Referenced by execute().

◆ bb_top_order_init()

◆ break_alias_scc_partitions()

◆ build_partition_graph()

struct graph * loop_distribution::build_partition_graph ( struct graph * rdg,
vec< struct partition * > * partitions,
bool ignore_alias_p )
private
Build and return partition dependence graph for PARTITIONS.  RDG is
reduced dependence graph for the loop to be distributed.  If IGNORE_ALIAS_P
is true, data dependence caused by possible alias between references
is ignored, as if it doesn't exist at all; otherwise all depdendences
are considered.   

References add_partition_graph_edge(), partition::datarefs, i, init_partition_graph_vertices(), new_graph(), NULL, partition_reduction_p(), and pg_add_dependence_edges().

Referenced by break_alias_scc_partitions(), and merge_dep_scc_partitions().

◆ build_rdg()

struct graph * loop_distribution::build_rdg ( class loop * loop,
control_dependences * cd )
private

◆ build_rdg_partition_for_vertex()

◆ classify_builtin_ldst()

void loop_distribution::classify_builtin_ldst ( loop_p loop,
struct graph * rdg,
partition * partition,
data_reference_p dst_dr,
data_reference_p src_dr )
private

◆ classify_partition()

◆ create_rdg_vertices()

◆ data_dep_in_cycle_p()

◆ distribute_loop()

int loop_distribution::distribute_loop ( class loop * loop,
const vec< gimple * > & stmts,
control_dependences * cd,
int * nb_calls,
bool * destroy_p,
bool only_patterns_p )
private

◆ execute()

◆ finalize_partitions()

void loop_distribution::finalize_partitions ( class loop * loop,
vec< struct partition * > * partitions,
vec< ddr_p > * alias_ddrs )
private

◆ get_bb_top_order_index()

int loop_distribution::get_bb_top_order_index ( int i)
inline

References bb_top_order_index, and i.

Referenced by bb_top_order_cmp_r().

◆ get_bb_top_order_index_size()

int loop_distribution::get_bb_top_order_index_size ( void )
inline

References bb_top_order_index_size.

Referenced by bb_top_order_cmp_r().

◆ get_data_dependence()

◆ merge_dep_scc_partitions()

◆ partition_merge_into()

void loop_distribution::partition_merge_into ( struct graph * rdg,
partition * dest,
partition * partition,
enum fuse_type ft )
private

◆ pg_add_dependence_edges()

◆ rdg_build_partitions()

void loop_distribution::rdg_build_partitions ( struct graph * rdg,
vec< gimple * > starting_stmts,
vec< partition * > * partitions )
private
For each seed statement in STARTING_STMTS, this function builds
partition for it by adding depended statements according to RDG.
All partitions are recorded in PARTITIONS.   

References bitmap_bit_p, bitmap_ior_into(), bitmap_print(), build_rdg_partition_for_vertex(), dump_file, dump_flags, FOR_EACH_VEC_ELT, i, processed, PTYPE_PARALLEL, rdg_vertex_for_stmt(), partition::stmts, TDF_DETAILS, and partition::type.

Referenced by distribute_loop().

◆ share_memory_accesses()

bool loop_distribution::share_memory_accesses ( struct graph * rdg,
partition * partition1,
partition * partition2 )
private

◆ stmts_from_loop()

◆ transform_reduction_loop()

bool loop_distribution::transform_reduction_loop ( loop_p loop)
private
Transform loops which mimic the effects of builtins rawmemchr or strlen and
replace them accordingly.  For example, a loop of the form

  for (; *p != 42; ++p);

is replaced by

  p = rawmemchr<MODE> (p, 42);

under the assumption that rawmemchr is available for a particular MODE.
Another example is

  int i;
  for (i = 42; s[i]; ++i);

which is replaced by

  i = (int)strlen (&s[42]) + 42;

for some character array S.  In case array S is not of type character array
we end up with

  i = (int)(rawmemchr<MODE> (&s[42], 0) - &s[42]) + 42;

assuming that rawmemchr is available for a particular MODE.   

References affine_iv::base, bitmap_set_range(), build_fold_addr_expr, build_rdg(), builtin_decl_implicit(), char_type_node, determine_reduction_stmt(), direct_optab_handler(), DR_REF, DR_STMT, dump_file, dump_flags, find_single_drs(), free_rdg(), generate_rawmemchr_builtin(), generate_strlen_builtin(), generate_strlen_builtin_using_rawmemchr(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_single_p(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_get_lhs(), gimple_location(), gsi_last_bb(), integer_onep(), integer_zerop(), INTEGRAL_TYPE_P, graph::n_vertices, NULL, loop::num, operand_equal_p(), ptr_type_node, ptrdiff_type_node, reduction_var_overflows_first(), safe_dyn_cast(), simple_iv(), single_exit(), sizetype, SSA_NAME_DEF_STMT, affine_iv::step, TDF_DETAILS, TREE_CODE, TREE_OPERAND, TREE_TYPE, type_has_mode_precision_p(), TYPE_MODE, TYPE_OVERFLOW_UNDEFINED, TYPE_PRECISION, and TYPE_SIZE_UNIT.

Referenced by execute().

◆ update_type_for_merge()

void loop_distribution::update_type_for_merge ( struct graph * rdg,
partition * partition1,
partition * partition2 )
private

Field Documentation

◆ bb_top_order_index

int* loop_distribution::bb_top_order_index
private

◆ bb_top_order_index_size

int loop_distribution::bb_top_order_index_size
private

◆ datarefs_vec

◆ ddrs_table

hash_table<ddr_hasher>* loop_distribution::ddrs_table
private

◆ has_nonaddressable_dataref_p

bool loop_distribution::has_nonaddressable_dataref_p
private

◆ loop_nest

vec<loop_p> loop_distribution::loop_nest
private

The documentation for this class was generated from the following file: