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-ssa-loop-manip.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-ssa-loop-manip.cc')
-rw-r--r-- | gcc/tree-ssa-loop-manip.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gcc/tree-ssa-loop-manip.cc b/gcc/tree-ssa-loop-manip.cc index a52277a..909b705 100644 --- a/gcc/tree-ssa-loop-manip.cc +++ b/gcc/tree-ssa-loop-manip.cc @@ -768,7 +768,6 @@ ip_end_pos (class loop *loop) basic_block ip_normal_pos (class loop *loop) { - gimple *last; basic_block bb; edge exit; @@ -776,9 +775,7 @@ ip_normal_pos (class loop *loop) return NULL; bb = single_pred (loop->latch); - last = last_stmt (bb); - if (!last - || gimple_code (last) != GIMPLE_COND) + if (!safe_is_a <gcond *> (*gsi_last_bb (bb))) return NULL; exit = EDGE_SUCC (bb, 0); @@ -1588,7 +1585,7 @@ canonicalize_loop_ivs (class loop *loop, tree *nit, bool bump_in_latch) rewrite_all_phi_nodes_with_iv (loop, var_before); - stmt = as_a <gcond *> (last_stmt (exit->src)); + stmt = as_a <gcond *> (*gsi_last_bb (exit->src)); /* Make the loop exit if the control condition is not satisfied. */ if (exit->flags & EDGE_TRUE_VALUE) { |