GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | lpt_decision |
struct | nb_iter_bound |
struct | loop_exit |
struct | loop |
struct | loops |
struct | rtx_iv |
struct | niter_desc |
struct | loop_iterator |
struct | target_cfgloop |
Typedefs | |
typedef struct loop * | loop_p |
Enumerations | |
enum | lpt_dec { LPT_NONE, LPT_PEEL_COMPLETELY, LPT_PEEL_SIMPLE, LPT_UNROLL_CONSTANT, LPT_UNROLL_RUNTIME, LPT_UNROLL_STUPID } |
enum | iv_extend_code { IV_SIGN_EXTEND, IV_ZERO_EXTEND, IV_UNKNOWN_EXTEND } |
enum | loop_estimation { EST_NOT_COMPUTED, EST_AVAILABLE, EST_LAST } |
enum | { LOOPS_HAVE_PREHEADERS = 1, LOOPS_HAVE_SIMPLE_LATCHES = 2, LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS = 4, LOOPS_HAVE_RECORDED_EXITS = 8, LOOPS_MAY_HAVE_MULTIPLE_LATCHES = 16, LOOP_CLOSED_SSA = 32, LOOPS_NEED_FIXUP = 64, LOOPS_HAVE_FALLTHRU_PREHEADERS = 128 } |
enum | { CP_SIMPLE_PREHEADERS = 1, CP_FALLTHRU_PREHEADERS = 2 } |
enum | li_flags { LI_INCLUDE_ROOT = 1, LI_FROM_INNERMOST = 2, LI_ONLY_INNERMOST = 4 } |
enum | { UAP_PEEL = 1, UAP_UNROLL = 2, UAP_UNROLL_ALL = 4 } |
Variables | |
struct target_cfgloop | default_target_cfgloop |
struct target_cfgloop * | this_target_cfgloop |
anonymous enum |
enum iv_extend_code |
enum li_flags |
enum loop_estimation |
enum lpt_dec |
void add_bb_to_loop | ( | basic_block | , |
struct loop * | |||
) |
|
read |
Allocates and returns new loop structure.
References loop::can_be_parallel, loop::exits, loop_exit::next, and loop_exit::prev.
Referenced by copy_loops(), create_empty_loop_on_edge(), duplicate_loop(), expand_omp_atomic_pipeline(), expand_omp_for_generic(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_omp_simd(), flow_loops_find(), form_subloop(), init_loops_structure(), input_cfg(), and loopify().
int average_num_loop_insns | ( | const struct loop * | ) |
Referenced by decide_unrolling_and_peeling().
|
inlinestatic |
Returns the loop depth of the loop BB belongs to.
Referenced by compute_alignments(), dump_bb_info(), estimate_function_body_sizes(), forward_propagate_addr_expr(), init_copy_prop(), insert_into_preds_of_block(), loop_depth_of_name(), migrate_btr_defs(), select_best_block(), and update_equiv_regs().
bool bb_loop_header_p | ( | basic_block | ) |
Loop recognition.
Referenced by analyze_iv_to_split_insn().
bool can_duplicate_loop_p | ( | const struct loop * | loop | ) |
Loop manipulation.
Referenced by can_unroll_loop_p(), decide_peel_completely(), decide_unrolling_and_peeling(), parallelize_loops(), and unswitch_single_loop().
void cancel_loop_tree | ( | struct loop * | ) |
Referenced by copy_loops(), duplicate_loop(), loop_version(), and unswitch_loop().
Referenced by create_if_region_on_edge(), graphite_create_new_guard(), and graphite_create_new_loop_guard().
|
read |
create_empty_loop_on_edge | | - pred_bb - ------ pred_bb ------ | | | | iv0 = initial_value | | -----|----- ---------|----------- | | ______ | entry_edge | | entry_edge / | | | | ====> | -V---V- loop_header ------------- | V | | iv_before = phi (iv0, iv_after) | | - succ_bb - | ---|----------------------------- | | | | | | ----------- | ---V--- loop_body --------------- | | | iv_after = iv_before + stride | | | | if (iv_before < upper_bound) | | | ---|--------------\-------------- | | | \ exit_e | | V \ | | - loop_latch - V- succ_bb - | | | | | | | | /------------- ----------- | \ ___ / Creates an empty loop as shown above, the IV_BEFORE is the SSA_NAME that is used before the increment of IV. IV_BEFORE should be used for adding code to the body that uses the IV. OUTER is the outer loop in which the new loop should be inserted. Both INITIAL_VALUE and UPPER_BOUND expressions are gimplified and inserted on the loop entry edge. This implies that this function should be used only when the UPPER_BOUND expression is a loop invariant.
References add_loop(), alloc_loop(), CDI_DOMINATORS, create_iv(), edge_def::flags, force_gimple_operand(), force_gimple_operand_gsi(), gimple_build_cond(), gimple_cond_lhs(), gimple_cond_set_lhs(), gsi_commit_edge_inserts(), gsi_insert_after(), gsi_insert_seq_on_edge(), gsi_last_bb(), GSI_NEW_STMT, loop::header, loop::latch, loop_preheader_edge(), make_edge(), prob, redirect_edge_succ_nodup(), scale_loop_frequencies(), set_immediate_dominator(), single_exit(), single_pred_edge(), single_succ(), single_succ_edge(), split_block_after_labels(), split_edge(), edge_def::src, and update_dominators_in_loop().
Referenced by graphite_create_new_loop().
basic_block create_preheader | ( | struct loop * | , |
int | |||
) |
Referenced by create_preheaders(), generate_loops_for_partition(), and thread_through_loop_header().
void create_preheaders | ( | int | ) |
Referenced by apply_loop_flags(), and tree_estimate_probability().
void delete_loop | ( | struct loop * | ) |
void disambiguate_loops_with_multiple_latches | ( | void | ) |
Split loops with multiple latch edges.
References disambiguate_multiple_latches(), and loop::latch.
Referenced by apply_loop_flags().
Referenced by doloop_optimize(), and doloop_register_get().
void doloop_optimize_loops | ( | void | ) |
This is the main entry point. Process all loops using doloop_optimize.
References doloop_optimize(), iv_analysis_done(), and verify_loop_structure().
Referenced by rtl_doloop().
void estimate_numbers_of_iterations_loop | ( | struct loop * | ) |
unsigned estimate_reg_pressure_cost | ( | unsigned | n_new, |
unsigned | n_old, | ||
bool | speed, | ||
bool | call_p | ||
) |
Register pressure estimation for induction variable optimizations & loop invariant motion.
Estimates cost of increased register pressure caused by making N_NEW new registers live around the loop. N_OLD is the number of registers live around the loop. If CALL_P is true, also take into account that call-used registers may be clobbered in the loop body, reducing the number of available registers before we spill.
References cfun, IRA_REGION_ALL, IRA_REGION_MIXED, and number_of_loops().
Referenced by gain_for_invariant(), and ivopts_global_cost_for_size().
bool estimated_loop_iterations | ( | struct loop * | , |
double_int * | |||
) |
HOST_WIDE_INT estimated_loop_iterations_int | ( | struct loop * | ) |
Referenced by estimated_stmt_executions_int(), find_simple_exit(), tree_ssa_unswitch_loops(), and unswitch_single_loop().
bool estimated_stmt_executions | ( | struct loop * | , |
double_int * | |||
) |
HOST_WIDE_INT estimated_stmt_executions_int | ( | struct loop * | ) |
unsigned expected_loop_iterations | ( | const struct loop * | ) |
Referenced by determine_loop_nest_reuse(), doloop_optimize(), report_unroll_peel(), and tree_transform_and_unroll_loop().
|
inlinestatic |
|
inlinestatic |
void find_simple_exit | ( | struct loop * | , |
struct niter_desc * | |||
) |
Referenced by get_simple_loop_desc().
bool finite_loop_p | ( | struct loop * | ) |
Referenced by analyze_function(), and find_obviously_necessary_stmts().
unsigned fix_loop_structure | ( | bitmap | changed_bbs | ) |
bool flow_bb_inside_loop_p | ( | const struct loop * | , |
const_basic_block | |||
) |
void flow_loop_dump | ( | const struct loop * | loop, |
FILE * | file, | ||
void(*)(const struct loop *, FILE *, int) | loop_dump_aux, | ||
int | verbose | ||
) |
Dump the loop information specified by LOOP to the stream FILE using auxiliary dump callback function LOOP_DUMP_AUX if non null.
References free(), get_loop_body(), get_loop_latch_edges(), loop::header, basic_block_def::index, loop::latch, loop_depth(), loop_outer(), loop::num, loop::num_nodes, and edge_def::src.
Referenced by flow_loops_dump(), and tree_ssa_iv_optimize().
void flow_loop_free | ( | struct loop * | ) |
int flow_loop_nodes_find | ( | basic_block | , |
struct loop * | |||
) |
Loop data structure manipulation/querying.
void flow_loop_tree_node_remove | ( | struct loop * | ) |
void flow_loops_dump | ( | FILE * | file, |
void(*)(const struct loop *, FILE *, int) | loop_dump_aux, | ||
int | verbose | ||
) |
Dump the loop information about loops to the stream FILE, using auxiliary dump callback function LOOP_DUMP_AUX if non null.
References cfun, flow_loop_dump(), flow_loops_cfg_dump(), LI_INCLUDE_ROOT, and number_of_loops().
Referenced by analyze_function(), compute_alignments(), estimate_function_body_sizes(), loop_optimizer_init(), and tree_estimate_probability_driver().
void flow_loops_free | ( | struct loops * | ) |
void force_single_succ_latches | ( | void | ) |
Forces all loop latches to have only single successor.
References find_edge(), loop::header, loop::latch, LOOPS_HAVE_SIMPLE_LATCHES, loops_state_set(), single_succ_p(), and split_edge().
Referenced by apply_loop_flags().
void free_simple_loop_desc | ( | struct loop * | loop | ) |
Referenced by loop_optimizer_finalize(), peel_loop_completely(), and peel_loop_simple().
Referenced by iv_extend(), iv_subreg(), and may_unswitch_on().
|
staticread |
Accessors for the loop structures.
Returns the loop with index NUM from FNs loop tree.
Referenced by add_to_evolution_1(), chrec_component_in_loop_num(), chrec_contains_symbols_defined_in_loop(), chrec_evaluate(), copy_cfg_body(), debug_loop_num(), draw_cfg_nodes(), evolution_function_is_invariant_rec_p(), get_chrec_loop(), get_loop_copy(), hide_evolution_in_other_loops_than_loop(), move_sese_region_to_fn(), output_cfg(), rdg_flag_loop_exits(), reset_evolution_in_loop(), vect_is_simple_iv_evolution(), and vectorize_loops().
basic_block* get_loop_body | ( | const struct loop * | ) |
Loops & cfg manipulation.
basic_block* get_loop_body_in_bfs_order | ( | const struct loop * | ) |
basic_block* get_loop_body_in_custom_order | ( | const struct loop * | loop, |
int(*)(const void *, const void *) | bb_comparator | ||
) |
Gets body of a LOOP sorted via provided BB_COMPARATOR.
References get_loop_body(), and loop::num_nodes.
basic_block* get_loop_body_in_dom_order | ( | const struct loop * | ) |
unsigned get_loop_body_with_size | ( | const struct loop * | loop, |
basic_block * | body, | ||
unsigned | max_size | ||
) |
Gets basic blocks of a LOOP. Header is the 0-th block, rest is in dfs order against direction of edges from latch. Specially, if header != latch, latch is the 1-st block. LOOP cannot be the fake loop tree root, and its size must be at most MAX_SIZE. The blocks in the LOOP body are stored to BODY, and the size of the LOOP is returned.
References dfs_enumerate_from(), glb_enum_p(), and loop::header.
Referenced by add_loop(), get_loop_body(), slpeel_tree_duplicate_loop_to_edge_cfg(), and verify_loop_structure().
vec<basic_block> get_loop_hot_path | ( | const struct loop * | loop | ) |
Referenced by tree_estimate_loop_size().
unsigned get_loop_level | ( | const struct loop * | ) |
Referenced by doloop_modify(), doloop_optimize(), and get_loop_level().
location_t get_loop_location | ( | struct loop * | loop | ) |
Returns the list of loops in FN.
Referenced by create_loop_tree_nodes(), fix_loop_structure(), fixup_loop_arrays_after_move(), mark_all_loops_for_removal(), mark_loops_for_removal(), more_one_region_p(), rebuild_regno_allocno_maps(), and setup_entered_from_non_parent_p().
|
read |
Referenced by decide_peel_completely(), decide_peel_once_rolling(), decide_unroll_constant_iterations(), decide_unroll_runtime_iterations(), decide_unroll_stupid(), doloop_optimize(), get_loop_location(), loop_exit_at_end_p(), peel_loop_completely(), peel_loop_simple(), report_unroll_peel(), unroll_loop_constant_iterations(), unroll_loop_runtime_iterations(), and unroll_loop_stupid().
Initializes loops structure LOOPS, reserving place for NUM_LOOPS loops (including the root of the loop tree).
References alloc_loop(), loop::header, loops::larray, loop::latch, memset(), loop::num_nodes, loops::tree_root, and vec_alloc().
Referenced by flow_loops_find(), init_lowered_empty_function(), input_cfg(), and move_sese_region_to_fn().
void init_set_costs | ( | void | ) |
Initialize the constants for computing set costs.
References default_rtl_profile(), emit_move_insn(), end_sequence(), gen_raw_REG(), gen_rtx_MEM(), get_insns(), seq_cost(), start_sequence(), and validize_mem().
Referenced by lang_dependent_init_target().
void iv_analysis_done | ( | void | ) |
Free the data for an induction variable analysis.
References clean_slate, clear_iv_info(), df_finish_pass(), hash_table< Descriptor, Allocator >::dispose(), free(), and iv_ref_table_size.
Referenced by doloop_optimize_loops(), unroll_and_peel_loops(), and unswitch_loops().
void iv_analysis_loop_init | ( | struct loop * | ) |
Referenced by analyze_insns_in_loop(), doloop_optimize(), get_simple_loop_desc(), and unswitch_single_loop().
Referenced by iv_number_of_iterations(), and may_unswitch_on().
Referenced by iv_analyze_def(), and iv_analyze_expr().
Referenced by analyze_iv_to_split_insn().
bool just_once_each_iteration_p | ( | const struct loop * | , |
const_basic_block | |||
) |
Loop analysis.
Referenced by canonicalize_loop_induction_variables(), find_loop_niter_by_eval(), iv_get_reaching_def(), latch_dominating_def(), may_unswitch_on(), single_dom_exit(), suitable_component_p(), and unswitch_loop().
|
inlinestatic |
Returns the number of superloops of LOOP.
Referenced by add_subscript_strides(), calculate_loop_reg_pressure(), compare_bb_depths(), compute_live_loop_exits(), compute_scalar_evolution_in_loop(), def_split_header_continue_p(), determine_invariantness_stmt(), draw_cfg_nodes_for_loop(), edge_badness(), edge_initial_value_for_loop_phi(), equiv_init_movable_p(), establish_preds(), expr_invariant_in_loop_p(), find_common_loop(), find_sibling_superloop(), fix_loop_structure(), flow_loop_dump(), flow_loop_nested_p(), initial_value_for_loop_phi(), inline_merge_summary(), inner_loop_header_p(), instantiate_scev_name(), interpret_loop_phi(), loop_compare_func(), lst_distribute_lst(), mark_all_loops_for_removal(), mark_irreducible_loops(), mark_loops_for_removal(), outermost_indep_loop(), outermost_invariant_loop(), outermost_invariant_loop_for_expr(), print_loop_title(), scalar_evolution_in_region(), scev_const_prop(), scopdet_basic_block_info(), single_pred_cond_non_loop_exit(), stmt_invariant_in_loop_p(), superloop_at_depth(), update_equiv_regs(), vect_analyze_data_ref_dependence(), and vect_find_same_alignment_drs().
bool loop_exit_edge_p | ( | const struct loop * | , |
const_edge | |||
) |
bool loop_exits_from_bb_p | ( | struct loop * | , |
basic_block | |||
) |
bool loop_exits_to_bb_p | ( | struct loop * | , |
basic_block | |||
) |
|
inlinestatic |
Returns true if LOOP has at least one exit edge.
Referenced by sel_setup_region_sched_flags().
void loop_optimizer_finalize | ( | void | ) |
Finalize loop structures.
References cfun, function::curr_properties, flow_loops_free(), free_numbers_of_iterations_estimates(), free_simple_loop_desc(), ggc_free(), LOOP_CLOSED_SSA, basic_block_def::loop_father, LOOPS_HAVE_FALLTHRU_PREHEADERS, LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS, LOOPS_HAVE_PREHEADERS, LOOPS_HAVE_RECORDED_EXITS, LOOPS_HAVE_SIMPLE_LATCHES, LOOPS_MAY_HAVE_MULTIPLE_LATCHES, loops_state_clear(), loops_state_satisfies_p(), loops_state_set(), release_recorded_exits(), timevar_pop(), and timevar_push().
Referenced by analyze_function(), compute_alignments(), copy_loop_headers(), do_pre(), do_reload(), estimate_function_body_sizes(), execute_sink_code(), execute_strength_reduction(), execute_vrp(), fini_reassoc(), fwprop_done(), gate_handle_loop2(), if_convert(), ira(), perform_tree_ssa_dce(), rebuild_frequencies(), release_function_body(), rtl_loop_done(), sms_schedule(), tree_complete_unroll_inner(), tree_estimate_probability_driver(), tree_ssa_cs_elim(), tree_ssa_dominator_optimize(), and tree_ssa_loop_done().
void loop_optimizer_init | ( | unsigned | ) |
Loop optimizer initialization.
Referenced by analyze_function(), compute_alignments(), copy_loop_headers(), do_pre(), estimate_function_body_sizes(), execute_build_cfg(), execute_sink_code(), execute_strength_reduction(), execute_vrp(), fwprop_init(), if_convert(), init_reassoc(), ira(), perform_tree_ssa_dce(), rebuild_frequencies(), rtl_loop_init(), sms_schedule(), tree_complete_unroll_inner(), tree_estimate_probability_driver(), tree_function_versioning(), tree_ssa_cs_elim(), tree_ssa_dominator_optimize(), and tree_ssa_loop_init().
|
staticread |
Returns the immediate superloop of LOOP, or NULL if LOOP is the outermost loop.
Referenced by add_loop(), add_loop_to_tree(), analyze_memory_references(), analyze_scalar_evolution_in_loop(), build_scop_iteration_domain(), calculate_loop_reg_pressure(), cancel_loop(), compute_live_loop_exits(), create_loop_tree_nodes(), def_split_header_continue_p(), determine_invariantness_stmt(), determine_loop_nest_reuse(), duplicate_block(), dw2_build_landing_pads(), find_common_loop(), find_sibling_superloop(), find_uses_to_rename_use(), fix_bb_placement(), fix_bb_placements(), fix_loop_placement(), fix_loop_placements(), fix_loop_structure(), flow_loop_dump(), flow_loop_tree_node_remove(), form_loop_tree(), fwprop(), fwprop_addr(), gbb_loop_at_index(), get_all_loop_exits(), gimple_duplicate_sese_region(), limit_scops(), loop_canon_p(), loopify(), make_forwarder_block(), mark_loop_exit_edges(), mark_ref_regs(), mark_ref_stored(), mark_regno_live(), move_computations_stmt(), move_sese_region_to_fn(), optimize_loop_nest_for_speed_p(), outermost_invariant_loop(), outermost_loop_in_sese(), record_dep_loop(), remove_path(), rescan_loop_exit(), scopdet_basic_block_info(), sese_loop_depth(), set_level(), sjlj_emit_dispatch_table(), slpeel_can_duplicate_loop_p(), slpeel_tree_duplicate_loop_to_edge_cfg(), stmt_has_simple_data_refs_p(), thread_block(), thread_through_loop_header(), tree_unroll_loops_completely_1(), unloop(), vect_analyze_loop(), verify_loop_structure(), and vrp_var_may_overflow().
|
staticread |
Returns the outermost loop of the loop nest that contains LOOP.
Referenced by gather_memory_references_ref().
|
read |
Main entry point for Loop Versioning transformation. This transformation given a condition and a loop, creates -if (condition) { loop_copy1 } else { loop_copy2 }, where loop_copy1 is the loop transformed in one way, and loop_copy2 is the loop transformed in another way (or unchanged). 'condition' may be a run time test for things that were not resolved by static analysis (overlapping ranges (anti-aliasing), alignment, etc.). THEN_PROB is the probability of the then edge of the if. THEN_SCALE is the ratio by that the frequencies in the original loop should be scaled. ELSE_SCALE is the ratio by that the frequencies in the new loop should be scaled. If PLACE_AFTER is true, we place the new loop after LOOP in the instruction stream, otherwise it is placed before LOOP.
References cfg_hook_duplicate_loop_to_header_edge(), copy_loop_info(), edge_def::dest, extract_cond_bb_edges(), edge_def::flags, basic_block_def::flags, free(), get_bb_copy(), get_loop_body_in_dom_order(), loop::header, loop::latch, loop_preheader_edge(), loopify(), lv_adjust_loop_entry_edge(), lv_flush_pending_stmts(), move_block_after(), loop::num_nodes, single_pred_edge(), single_succ_edge(), and split_edge().
Referenced by gen_parallel_loop(), sms_schedule(), tree_transform_and_unroll_loop(), tree_unswitch_loop(), and vect_loop_versioning().
|
read |
Make area between HEADER_EDGE and LATCH_EDGE a loop by connecting latch to header and update loop tree and dominators accordingly. Everything between them plus LATCH_EDGE destination must be dominated by HEADER_EDGE destination, and back-reachable from LATCH_EDGE source. HEADER_EDGE is redirected to basic block SWITCH_BB, FALSE_EDGE of SWITCH_BB to original destination of HEADER_EDGE and TRUE_EDGE of SWITCH_BB to original destination of LATCH_EDGE. Returns the newly created loop. Frequencies and counts in the new loop are scaled by FALSE_SCALE and in the old one by TRUE_SCALE.
References add_bb_to_loop(), add_loop(), alloc_loop(), apply_probability(), CDI_DOMINATORS, edge_def::count, basic_block_def::count, edge_def::dest, basic_block_def::frequency, loop::header, loop::latch, basic_block_def::loop_father, loop_outer(), loop_redirect_edge(), edge_def::probability, remove_bb_from_loops(), scale_loop_frequencies(), set_immediate_dominator(), edge_def::src, basic_block_def::succs, and update_dominators_in_loop().
Referenced by loop_version(), and unswitch_loop().
|
inlinestatic |
Clears FLAGS from the loops state.
Referenced by fix_loop_structure(), gimple_expand_cfg(), loop_optimizer_finalize(), loop_optimizer_init(), and release_recorded_exits().
|
inlinestatic |
Returns true if state of the loops satisfies all properties described by FLAGS.
Referenced by canonicalize_induction_variables(), cleanup_tree_cfg(), copy_prop_visit_phi_node(), execute_function_todo(), execute_update_addresses_taken(), expand_omp_taskreg(), fix_loop_structure(), get_loop_exit_edges(), gimple_duplicate_loop_to_header_edge(), gimple_merge_blocks(), loop_optimizer_finalize(), loop_optimizer_init(), loop_preheader_edge(), record_loop_exits(), release_recorded_exits(), remove_path(), repair_loop_structures(), rescan_loop_exit(), single_exit(), tree_unroll_loops_completely(), and verify_loop_structure().
|
inlinestatic |
Sets FLAGS to the loops state.
Referenced by apply_loop_flags(), cleanup_empty_eh_merge_phis(), cleanup_tree_cfg_noloop(), copy_cfg_body(), create_cond_insert_point(), create_preheaders(), delete_basic_block(), duplicate_block(), eliminate_degenerate_phis(), execute_fixup_cfg(), execute_vrp(), expand_omp_for(), force_single_succ_latches(), loop_optimizer_finalize(), mark_irreducible_loops(), merge_blocks(), merge_phi_nodes(), process_switch(), record_loop_exits(), rewrite_into_loop_closed_ssa(), thread_block(), thread_through_all_blocks(), thread_through_loop_header(), tracer(), and tree_optimize_tail_calls_1().
bool mark_irreducible_loops | ( | void | ) |
References add_edge(), cfun, vertex::component, graph_edge::data, graph_edge::dest, edge_def::dest, find_common_loop(), edge_def::flags, basic_block_def::flags, flow_bb_inside_loop_p(), free_graph(), g, graphds_scc(), loop::header, loop::latch, loop_depth(), basic_block_def::loop_father, LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS, loops_state_set(), graph::n_vertices, new_graph(), number_of_loops(), graph_edge::src, edge_def::src, vertex::succ, graph_edge::succ_next, basic_block_def::succs, loop::superloops, and graph::vertices.
Referenced by analyze_function(), apply_loop_flags(), canonicalize_induction_variables(), find_obviously_necessary_stmts(), rebuild_frequencies(), recompute_all_dominators(), remove_path(), tree_estimate_probability_driver(), tree_unroll_loops_completely(), and verify_loop_structure().
void mark_loop_exit_edges | ( | void | ) |
Sets EDGE_LOOP_EXIT flag for all loop exits.
References cfun, edge_def::flags, loop_exit_edge_p(), basic_block_def::loop_father, loop_outer(), number_of_loops(), and basic_block_def::succs.
Referenced by if_convert().
bool max_loop_iterations | ( | struct loop * | , |
double_int * | |||
) |
Referenced by adjust_range_with_scev(), decide_peel_simple(), decide_unroll_constant_iterations(), decide_unroll_runtime_iterations(), decide_unroll_stupid(), doloop_modify(), doloop_optimize(), finite_loop_p(), max_loop_iterations_int(), max_stmt_executions(), may_eliminate_iv(), and scev_probably_wraps_p().
HOST_WIDE_INT max_loop_iterations_int | ( | struct loop * | ) |
bool max_stmt_executions | ( | struct loop * | , |
double_int * | |||
) |
Referenced by build_loop_iteration_domains(), and max_stmt_executions_tree().
HOST_WIDE_INT max_stmt_executions_int | ( | struct loop * | ) |
void move_loop_invariants | ( | void | ) |
Move the invariants out of the loops.
References calculate_loop_reg_pressure(), df_analyze(), DF_DEFER_INSN_RESCAN, DF_EQ_NOTES, df_set_flags(), dump_file, free(), free_loop_data(), free_reg_info(), invariant_table_size, ira_set_pseudo_classes(), LI_FROM_INNERMOST, move_single_loop_invariants(), loop::num_nodes, regstat_free_n_sets_and_refs(), regstat_init_n_sets_and_refs(), and verify_flow_info().
Referenced by rtl_move_loop_invariants().
unsigned num_loop_branches | ( | const struct loop * | ) |
int num_loop_insns | ( | const struct loop * | ) |
|
inlinestatic |
Returns the number of loops in FN (including the removed ones and the fake loop that forms the root of the loop tree).
Referenced by analyze_memory_references(), build_scop_iteration_domain(), build_scop_scattering(), check_data_deps(), copy_loop_headers(), create_loop_tree_nodes(), estimate_loops(), estimate_reg_pressure_cost(), execute_update_addresses_taken(), fix_loop_structure(), fixup_loop_arrays_after_move(), flow_loops_dump(), graphite_initialize(), ira_build(), main_tree_if_conversion(), mark_irreducible_loops(), mark_loop_exit_edges(), mark_loops_for_removal(), output_cfg(), place_new_loop(), record_loop_exits(), remove_unnecessary_regions(), rewrite_into_loop_closed_ssa(), rtl_doloop(), rtl_move_loop_invariants(), rtl_unroll_and_peel_loops(), rtl_unswitch(), scev_const_prop(), sms_schedule(), translate_clast_user(), tree_complete_unroll(), tree_complete_unroll_inner(), tree_estimate_probability(), tree_estimate_probability_driver(), tree_parallelize_loops(), tree_ssa_lim_initialize(), tree_ssa_loop_bounds(), tree_ssa_loop_im(), tree_ssa_loop_init(), tree_ssa_loop_ivcanon(), tree_ssa_loop_ivopts(), tree_ssa_loop_prefetch(), tree_ssa_loop_unswitch(), tree_vectorize(), vectorize_loops(), verify_loop_closed_ssa(), and verify_loop_structure().
Referenced by add_loop(), copy_loops(), duplicate_loop(), and input_cfg().
void record_loop_exits | ( | void | ) |
For each loop, record list of exit edges, and start maintaining these lists.
References cfun, loop_exit_eq(), loop_exit_free(), loop_exit_hash(), LOOPS_HAVE_RECORDED_EXITS, loops_state_satisfies_p(), loops_state_set(), number_of_loops(), rescan_loop_exit(), and basic_block_def::succs.
Referenced by apply_loop_flags(), and tree_estimate_probability().
void record_niter_bound | ( | struct loop * | loop, |
double_int | i_bound, | ||
bool | realistic, | ||
bool | upper | ||
) |
Records that every statement in LOOP is executed I_BOUND times. REALISTIC is true if I_BOUND is expected to be close to the real number of iterations. UPPER is true if we are sure the loop iterates at most I_BOUND times.
References loop::any_estimate, loop::any_upper_bound, loop::nb_iterations_estimate, loop::nb_iterations_upper_bound, and double_int::ult().
Referenced by canonicalize_loop_induction_variables(), discover_iteration_bound_by_body_walk(), estimate_numbers_of_iterations_loop(), iv_number_of_iterations(), maybe_lower_iteration_bound(), record_estimate(), vect_do_peeling_for_alignment(), and vect_do_peeling_for_loop_bound().
void release_recorded_exits | ( | void | ) |
Releases lists of loop exits.
References LOOPS_HAVE_RECORDED_EXITS, loops_state_clear(), and loops_state_satisfies_p().
Referenced by fix_loop_structure(), graphite_finalize(), loop_optimizer_finalize(), and loop_optimizer_init().
void remove_bb_from_loops | ( | basic_block | ) |
bool remove_path | ( | edge | ) |
void rescan_loop_exit | ( | edge | , |
bool | , | ||
bool | |||
) |
void scale_loop_frequencies | ( | struct loop * | , |
int | , | ||
int | |||
) |
Referenced by create_empty_loop_on_edge(), loopify(), scale_loop_profile(), and tree_transform_and_unroll_loop().
Referenced by slpeel_tree_peel_loop_to_edge(), and vect_transform_loop().
|
staticread |
Referenced by free_simple_loop_desc(), and get_simple_loop_desc().
Referenced by canonicalize_loop_induction_variables(), and estimate_numbers_of_iterations_loop().
unsigned tree_num_loop_insns | ( | struct loop * | , |
struct eni_weights_d * | |||
) |
Referenced by can_unroll_loop_p(), loop_prefetch_arrays(), and tree_ssa_unswitch_loops().
Remove the latch edge of a LOOP and update loops to indicate that the LOOP was removed. After this function, original loop latch will have no successor, which caller is expected to fix somehow. If this may cause the information about irreducible regions to become invalid, IRRED_INVALIDATED is set to true. LOOP_CLOSED_SSA_INVALIDATED, if non-NULL, is a bitmap where we store basic blocks that had non-trivial update on their loop_father.
References add_bb_to_loop(), delete_loop(), fix_bb_placements(), flow_loop_tree_node_add(), flow_loop_tree_node_remove(), free(), get_loop_body(), loop::inner, loop::latch, loop_outer(), loop_preheader_edge(), loop::num_nodes, remove_bb_from_loops(), remove_edge(), and single_succ_edge().
Referenced by remove_path(), and unloop_loops().
void unroll_and_peel_loops | ( | int | ) |
Referenced by rtl_unroll_and_peel_loops().
void unswitch_loops | ( | void | ) |
Optimization passes.
Main entry point. Perform loop unswitching on all suitable loops.
References calculate_dominance_info(), CDI_DOMINATORS, changed, fix_loop_structure(), iv_analysis_done(), LI_ONLY_INNERMOST, and unswitch_single_loop().
Referenced by rtl_unswitch().
void verify_loop_structure | ( | void | ) |
Checks that information about loops is correct -- sizes of loops are all right -- results of get_loop_body really belong to the loop -- loop header have just single entry edge and single latch edge -- loop latches have only single successor that is header of their loop -- irreducible loops are correctly marked -- the cached loop depth and loop father of each bb is correct
References bb_loop_header_p(), bitmap_bit_p(), bitmap_clear(), bitmap_clear_bit(), bitmap_set_bit(), calculate_dominance_info(), CDI_DOMINATORS, cfun, edge_def::dest, dom_info_available_p(), dominated_by_p(), loop_exit::e, error(), loop::exits, find_edge(), edge_def::flags, basic_block_def::flags, flow_bb_inside_loop_p(), free(), free_dominance_info(), get_exit_descriptions(), get_loop_body_with_size(), loop::header, basic_block_def::index, loop::latch, LI_FROM_INNERMOST, basic_block_def::loop_father, loop_latch_edge(), loop_outer(), LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS, LOOPS_HAVE_PREHEADERS, LOOPS_HAVE_RECORDED_EXITS, LOOPS_HAVE_SIMPLE_LATCHES, LOOPS_NEED_FIXUP, loops_state_satisfies_p(), mark_irreducible_loops(), memset(), loop_exit::next, loop_exit::next_e, loop::num, loop::num_nodes, number_of_loops(), basic_block_def::preds, sbitmap_alloc(), sbitmap_free(), single_succ(), single_succ_p(), edge_def::src, basic_block_def::succs, verify_dominators(), and visited.
Referenced by create_sese_edges(), doloop_optimize_loops(), fix_loop_structure(), graphite_verify(), loop_optimizer_init(), repair_loop_structures(), tree_loop_distribution(), and tree_transform_and_unroll_loop().
struct target_cfgloop default_target_cfgloop |
@verbatim Natural loop analysis code for GNU compiler.
Copyright (C) 2002-2013 Free Software Foundation, Inc.
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/.
struct target_cfgloop* this_target_cfgloop |