diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2022-07-04 17:32:07 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2022-07-04 20:43:14 +0200 |
commit | ce8dbe7d834b9264d7a5cd74d3ce6c750d28b3af (patch) | |
tree | fb4da914116702e19d96324158147373de69facc /gcc/gimple-range-fold.cc | |
parent | ac4c8f53b0f735be17aa020796602de2299da1c5 (diff) | |
download | gcc-ce8dbe7d834b9264d7a5cd74d3ce6c750d28b3af.zip gcc-ce8dbe7d834b9264d7a5cd74d3ce6c750d28b3af.tar.gz gcc-ce8dbe7d834b9264d7a5cd74d3ce6c750d28b3af.tar.bz2 |
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.
Diffstat (limited to 'gcc/gimple-range-fold.cc')
-rw-r--r-- | gcc/gimple-range-fold.cc | 32 |
1 files changed, 18 insertions, 14 deletions
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) { |