Prefer global range info setters that take a range.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 7 Mar 2022 13:56:34 +0000 (14:56 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Fri, 29 Apr 2022 08:43:36 +0000 (10:43 +0200)
commit6ccc4356e7c5b4ca69d2029898a6439bb735cbc5
tree5a61901594d131055e574313a5471b8395574fc5
parent17dea11cf4388fb2cd8c3894d3ce5583765e71a4
Prefer global range info setters that take a range.

This patch consolidates the multiple ways we have of storing global
ranges into one accepting a range.

In an upcoming patch series later this cycle we will be providing a
way to store iranges globally, as opposed to the mechanism we have now
which squishes wider ranges into value_range's.  This is preparation
for such work.

Tested and benchmarked on x86-64 Linux.

gcc/ChangeLog:

* gimple-ssa-evrp-analyze.cc
(evrp_range_analyzer::set_ssa_range_info): Use *range_info methods
that take a range.
* gimple-ssa-sprintf.cc (try_substitute_return_value): Same.
* ipa-prop.cc (ipcp_update_vr): Same.
* tree-inline.cc (remap_ssa_name): Same.
* tree-ssa-copy.cc (fini_copy_prop): Same.
* tree-ssa-math-opts.cc (optimize_spaceship): Same.
* tree-ssa-phiopt.cc (replace_phi_edge_with_variable): Same.
* tree-ssa-pre.cc (insert_into_preds_of_block): Same.
* tree-ssa-sccvn.cc (eliminate_dom_walker::eliminate_stmt): Same.
* tree-ssa-strlen.cc (set_strlen_range): Same.
(strlen_pass::handle_builtin_string_cmp): Same.
* tree-ssanames.cc (set_range_info): Make static.
(duplicate_ssa_name_range_info): Make static and add a new variant
calling the static.
* tree-ssanames.h (set_range_info): Remove version taking wide ints.
(duplicate_ssa_name_range_info): Remove version taking a
range_info_def and replace with a version taking SSA names.
* tree-vect-loop-manip.cc (vect_gen_vector_loop_niters): Use *range_info methods
that take a range.
(vect_do_peeling): Same.
* tree-vrp.cc (vrp_asserts::remove_range_assertions): Same.
* vr-values.cc (simplify_truth_ops_using_ranges): Same.
15 files changed:
gcc/gimple-ssa-evrp-analyze.cc
gcc/gimple-ssa-sprintf.cc
gcc/ipa-prop.cc
gcc/tree-inline.cc
gcc/tree-ssa-copy.cc
gcc/tree-ssa-math-opts.cc
gcc/tree-ssa-phiopt.cc
gcc/tree-ssa-pre.cc
gcc/tree-ssa-sccvn.cc
gcc/tree-ssa-strlen.cc
gcc/tree-ssanames.cc
gcc/tree-ssanames.h
gcc/tree-vect-loop-manip.cc
gcc/tree-vrp.cc
gcc/vr-values.cc