From ce8dbe7d834b9264d7a5cd74d3ce6c750d28b3af Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Mon, 4 Jul 2022 17:32:07 +0200 Subject: Misc conversions to vrange. The following converts a handful of places that were irange centric. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range-fold.cc (fold_using_range::range_of_ssa_name_with_loop_info): Restrict the call to SCEV for irange supported types. (fold_using_range::range_of_builtin_int_call): Convert to vrange. * gimple-range.cc (gimple_ranger::prefill_stmt_dependencies): Same. * tree-ssa-dom.cc (cprop_operand): Same. --- gcc/gimple-range-fold.cc | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'gcc/gimple-range-fold.cc') diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc index 0f815b5..6f907df 100644 --- a/gcc/gimple-range-fold.cc +++ b/gcc/gimple-range-fold.cc @@ -1006,19 +1006,21 @@ fold_using_range::range_of_builtin_int_call (irange &r, gcall *call, switch (func) { case CFN_BUILT_IN_CONSTANT_P: - arg = gimple_call_arg (call, 0); - if (src.get_operand (r, arg) && r.singleton_p ()) - { - r.set (build_one_cst (type), build_one_cst (type)); - return true; - } - if (cfun->after_inlining) - { - r.set_zero (type); - // r.equiv_clear (); - return true; - } - break; + { + arg = gimple_call_arg (call, 0); + Value_Range tmp (TREE_TYPE (arg)); + if (src.get_operand (tmp, arg) && tmp.singleton_p ()) + { + r.set (build_one_cst (type), build_one_cst (type)); + return true; + } + if (cfun->after_inlining) + { + r.set_zero (type); + return true; + } + break; + } case CFN_BUILT_IN_TOUPPER: { @@ -1335,7 +1337,9 @@ fold_using_range::range_of_ssa_name_with_loop_info (irange &r, tree name, { gcc_checking_assert (TREE_CODE (name) == SSA_NAME); tree min, max, type = TREE_TYPE (name); - if (bounds_of_var_in_loop (&min, &max, src.query (), l, phi, name)) + // FIXME: Remove the supports_p() once all this can handle floats, etc. + if (irange::supports_p (type) + && bounds_of_var_in_loop (&min, &max, src.query (), l, phi, name)) { if (TREE_CODE (min) != INTEGER_CST) { -- cgit v1.1