GCC Middle and Back End API Reference
|
Public Member Functions | |
control_flow_regions (gimple_seq seq) | |
bool | is_unconditional_oacc_for_loop (size_t idx) |
Private Member Functions | |
size_t | find_rep (size_t stmt_idx) |
void | union_reps (size_t a, size_t b) |
void | compute_regions (gimple_seq seq) |
Private Attributes | |
vec< size_t > | representatives |
vec< bool > | omp_for_loops |
Auxiliary analysis of the body of a kernels region, to determine for each OpenACC loop whether it is control-dependent (i.e., not necessarily executed every time the kernels region is entered) or not. We say that a loop is control-dependent if there is some cond, switch, or goto statement that jumps over it, forwards or backwards. For example, if the loop is controlled by an if statement, then a jump to the true block, the false block, or from one of those blocks to the control flow join point will necessarily jump over the loop. This analysis implements an ad-hoc union-find data structure classifying statements into "control-flow regions" as follows: Most statements are in the same region as their predecessor, except that each OpenACC loop is in a region of its own, and each OpenACC loop's successor starts a new region. We then unite the regions of any statements linked by jumps, placing any cond, switch, or goto statement in the same region as its target label(s). In the end, control dependence of OpenACC loops can be determined by comparing their immediate predecessor and successor statements' regions. A jump crosses the loop if and only if the predecessor and successor are in the same region. (If there is no predecessor or successor, the loop is executed unconditionally.) The methods in this class identify statements by their index in the kernels region's body.
control_flow_regions::control_flow_regions | ( | gimple_seq | seq | ) |
References compute_regions(), omp_for_loops, and representatives.
|
private |
References as_a(), hash_map< KeyId, Value, Traits >::begin(), CASE_LABEL, hash_map< KeyId, Value, Traits >::end(), gcc_assert, gcc_unreachable, hash_map< KeyId, Value, Traits >::get(), gimple_cond_false_label(), gimple_cond_true_label(), gimple_goto_dest(), gimple_label_label(), gimple_switch_label(), gimple_switch_num_labels(), gsi_end_p(), gsi_next(), gsi_start(), gsi_stmt(), i, NULL, omp_for_loops, hash_map< KeyId, Value, Traits >::put(), representatives, top_level_omp_for_in_stmt(), and union_reps().
Referenced by control_flow_regions().
|
private |
References representatives.
Referenced by is_unconditional_oacc_for_loop(), and union_reps().
bool control_flow_regions::is_unconditional_oacc_for_loop | ( | size_t | idx | ) |
References find_rep(), omp_for_loops, and representatives.
Referenced by decompose_kernels_region_body().
|
private |
References a, b, find_rep(), and representatives.
Referenced by compute_regions().
Referenced by compute_regions(), control_flow_regions(), and is_unconditional_oacc_for_loop().
|
private |
Referenced by compute_regions(), control_flow_regions(), find_rep(), is_unconditional_oacc_for_loop(), and union_reps().