From 3c52dff792878306515056ecd94c8aa909f388fb Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Mon, 22 May 2023 20:29:01 +0200 Subject: Convert remaining uses of value_range in ipa-*.cc to Value_Range. Minor cleanups to get rid of value_range in IPA. There's only one left, but it's in the switch code which is integer specific. gcc/ChangeLog: * ipa-cp.cc (decide_whether_version_node): Adjust comment. * ipa-fnsummary.cc (evaluate_conditions_for_known_args): Adjust for Value_Range. (set_switch_stmt_execution_predicate): Same. * ipa-prop.cc (ipa_compute_jump_functions_for_edge): Same. --- gcc/ipa-prop.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gcc/ipa-prop.cc') diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc index d93234e..41c8121 100644 --- a/gcc/ipa-prop.cc +++ b/gcc/ipa-prop.cc @@ -2348,7 +2348,6 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi, gcall *call = cs->call_stmt; int n, arg_num = gimple_call_num_args (call); bool useful_context = false; - value_range vr; if (arg_num == 0 || args->jump_functions) return; @@ -2379,6 +2378,7 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi, useful_context = true; } + Value_Range vr (TREE_TYPE (arg)); if (POINTER_TYPE_P (TREE_TYPE (arg))) { bool addr_nonzero = false; @@ -2404,15 +2404,14 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi, { if (TREE_CODE (arg) == SSA_NAME && param_type - /* Limit the ranger query to integral types as the rest - of this file uses value_range's, which only hold - integers and pointers. */ + && Value_Range::supports_type_p (TREE_TYPE (arg)) + && Value_Range::supports_type_p (param_type) && irange::supports_p (TREE_TYPE (arg)) && irange::supports_p (param_type) && get_range_query (cfun)->range_of_expr (vr, arg) && !vr.undefined_p ()) { - value_range resvr = vr; + Value_Range resvr (vr); range_cast (resvr, param_type); if (!resvr.undefined_p () && !resvr.varying_p ()) ipa_set_jfunc_vr (jfunc, resvr); -- cgit v1.1