diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2023-05-22 20:29:01 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2023-06-27 11:25:48 +0200 |
commit | 3c52dff792878306515056ecd94c8aa909f388fb (patch) | |
tree | 7b50a0d372d9acf9e2dce6b0f4726d9a1c3f8d15 /gcc/ipa-prop.cc | |
parent | 15819a7df1f673357b521daef6bda3c45c2ef49c (diff) | |
download | gcc-3c52dff792878306515056ecd94c8aa909f388fb.zip gcc-3c52dff792878306515056ecd94c8aa909f388fb.tar.gz gcc-3c52dff792878306515056ecd94c8aa909f388fb.tar.bz2 |
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.
Diffstat (limited to 'gcc/ipa-prop.cc')
-rw-r--r-- | gcc/ipa-prop.cc | 9 |
1 files changed, 4 insertions, 5 deletions
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); |