diff options
author | Richard Biener <rguenther@suse.de> | 2023-04-25 16:38:44 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-04-26 08:39:58 +0200 |
commit | db29daa5e627c185aa599aa0dad093ae3a86317c (patch) | |
tree | 310057a101b07b6f95566ef9bf721eef8c10dec2 /gcc/tree-parloops.cc | |
parent | 5fce06b868ec0d4f75530a17d6fe6b12b7c9b5f0 (diff) | |
download | gcc-db29daa5e627c185aa599aa0dad093ae3a86317c.zip gcc-db29daa5e627c185aa599aa0dad093ae3a86317c.tar.gz gcc-db29daa5e627c185aa599aa0dad093ae3a86317c.tar.bz2 |
More last_stmt removal
This adjusts more users of last_stmt where it is clear that debug
stmt skipping is unnecessary. In most cases this also allowed
significant code simplification.
gcc/c/
* gimple-parser.cc (c_parser_parse_gimple_body): Avoid
last_stmt.
gcc/
* gimple-range-path.cc (path_range_query::compute_outgoing_relations):
Avoid last_stmt.
* ipa-pure-const.cc (pass_nothrow::execute): Likewise.
* predict.cc (apply_return_prediction): Likewise.
* sese.cc (set_ifsese_condition): Likewise. Simplify.
* tree-cfg.cc (assert_unreachable_fallthru_edge_p): Avoid last_stmt.
(make_edges_bb): Likewise.
(make_cond_expr_edges): Likewise.
(end_recording_case_labels): Likewise.
(make_gimple_asm_edges): Likewise.
(cleanup_dead_labels): Likewise.
(group_case_labels): Likewise.
(gimple_can_merge_blocks_p): Likewise.
(gimple_merge_blocks): Likewise.
(find_taken_edge): Likewise. Also handle empty fallthru blocks.
(gimple_duplicate_sese_tail): Avoid last_stmt.
(find_loop_dist_alias): Likewise.
(gimple_block_ends_with_condjump_p): Likewise.
(gimple_purge_dead_eh_edges): Likewise.
(gimple_purge_dead_abnormal_call_edges): Likewise.
(pass_warn_function_return::execute): Likewise.
(execute_fixup_cfg): Likewise.
* tree-eh.cc (redirect_eh_edge_1): Likewise.
(pass_lower_resx::execute): Likewise.
(pass_lower_eh_dispatch::execute): Likewise.
(cleanup_empty_eh): Likewise.
* tree-if-conv.cc (if_convertible_bb_p): Likewise.
(predicate_bbs): Likewise.
(ifcvt_split_critical_edges): Likewise.
* tree-loop-distribution.cc (create_edge_for_control_dependence):
Likewise.
(loop_distribution::transform_reduction_loop): Likewise.
* tree-parloops.cc (transform_to_exit_first_loop_alt): Likewise.
(try_transform_to_exit_first_loop_alt): Likewise.
(transform_to_exit_first_loop): Likewise.
(create_parallel_loop): Likewise.
* tree-scalar-evolution.cc (get_loop_exit_condition): Likewise.
* tree-ssa-dce.cc (mark_last_stmt_necessary): Likewise.
(eliminate_unnecessary_stmts): Likewise.
* tree-ssa-dom.cc
(dom_opt_dom_walker::set_global_ranges_from_unreachable_edges):
Likewise.
* tree-ssa-ifcombine.cc (ifcombine_ifandif): Likewise.
(pass_tree_ifcombine::execute): Likewise.
* tree-ssa-loop-ch.cc (entry_loop_condition_is_static): Likewise.
(should_duplicate_loop_header_p): Likewise.
* tree-ssa-loop-ivcanon.cc (create_canonical_iv): Likewise.
(tree_estimate_loop_size): Likewise.
(try_unroll_loop_completely): Likewise.
* tree-ssa-loop-ivopts.cc (tree_ssa_iv_optimize_loop): Likewise.
* tree-ssa-loop-manip.cc (ip_normal_pos): Likewise.
(canonicalize_loop_ivs): Likewise.
* tree-ssa-loop-niter.cc (determine_value_range): Likewise.
(bound_difference): Likewise.
(number_of_iterations_popcount): Likewise.
(number_of_iterations_cltz): Likewise.
(number_of_iterations_cltz_complement): Likewise.
(simplify_using_initial_conditions): Likewise.
(number_of_iterations_exit_assumptions): Likewise.
(loop_niter_by_eval): Likewise.
(estimate_numbers_of_iterations): Likewise.
Diffstat (limited to 'gcc/tree-parloops.cc')
-rw-r--r-- | gcc/tree-parloops.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-parloops.cc b/gcc/tree-parloops.cc index dfb75c3..eae240b 100644 --- a/gcc/tree-parloops.cc +++ b/gcc/tree-parloops.cc @@ -2354,7 +2354,7 @@ transform_to_exit_first_loop_alt (class loop *loop, basic_block latch = loop->latch; edge exit = single_dom_exit (loop); basic_block exit_block = exit->dest; - gcond *cond_stmt = as_a <gcond *> (last_stmt (exit->src)); + gcond *cond_stmt = as_a <gcond *> (*gsi_last_bb (exit->src)); tree control = gimple_cond_lhs (cond_stmt); edge e; @@ -2510,7 +2510,7 @@ try_transform_to_exit_first_loop_alt (class loop *loop, /* Check whether the latch contains the loop iv increment. */ edge back = single_succ_edge (loop->latch); edge exit = single_dom_exit (loop); - gcond *cond_stmt = as_a <gcond *> (last_stmt (exit->src)); + gcond *cond_stmt = as_a <gcond *> (*gsi_last_bb (exit->src)); tree control = gimple_cond_lhs (cond_stmt); gphi *phi = as_a <gphi *> (SSA_NAME_DEF_STMT (control)); tree inc_res = gimple_phi_arg_def (phi, back->dest_idx); @@ -2632,7 +2632,7 @@ transform_to_exit_first_loop (class loop *loop, orig_header = single_succ (loop->header); hpred = single_succ_edge (loop->header); - cond_stmt = as_a <gcond *> (last_stmt (exit->src)); + cond_stmt = as_a <gcond *> (*gsi_last_bb (exit->src)); control = gimple_cond_lhs (cond_stmt); gcc_assert (gimple_cond_rhs (cond_stmt) == nit); @@ -2712,7 +2712,7 @@ transform_to_exit_first_loop (class loop *loop, /* Initialize the control variable to number of iterations according to the rhs of the exit condition. */ gimple_stmt_iterator gsi = gsi_after_labels (ex_bb); - cond_nit = as_a <gcond *> (last_stmt (exit->src)); + cond_nit = as_a <gcond *> (*gsi_last_bb (exit->src)); nit_1 = gimple_cond_rhs (cond_nit); nit_1 = force_gimple_operand_gsi (&gsi, fold_convert (TREE_TYPE (control_name), nit_1), @@ -2797,7 +2797,7 @@ create_parallel_loop (class loop *loop, tree loop_fn, tree data, /* Extract data for GIMPLE_OMP_FOR. */ gcc_assert (loop->header == single_dom_exit (loop)->src); - cond_stmt = as_a <gcond *> (last_stmt (loop->header)); + cond_stmt = as_a <gcond *> (*gsi_last_bb (loop->header)); cvar = gimple_cond_lhs (cond_stmt); cvar_base = SSA_NAME_VAR (cvar); |