]> git.ipfire.org Git - thirdparty/gcc.git/commit
Split gimple range folding with ranges into a stand alone class.
authorAndrew MacLeod <amacleod@redhat.com>
Wed, 19 May 2021 00:33:09 +0000 (20:33 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Wed, 19 May 2021 20:22:13 +0000 (16:22 -0400)
commitdc6758f03effbf7d6946d8c314576c7a6c0003af
tree5d56151f75df24c220ad5f0908dd195781553f9b
parentcd67343703ef4fa61de837f4690eba70d2760825
Split gimple range folding with ranges into a stand alone class.

Introduces fold_using_range which folds any kind of gimple statement by
querying argument ranges thru a generic range_query.
This pulls all the statement processing into a client neutral location.

* gimple-range.cc (fur_source::get_operand): New.
(gimple_range_fold): Delete.
(fold_using_range::fold_stmt): Move from gimple_ranger::calc_stmt.
(fold_using_range::range_of_range_op): Move from gimple_ranger.
(fold_using_range::range_of_address): Ditto.
(fold_using_range::range_of_phi): Ditto.
(fold_using_range::range_of_call): Ditto.
(fold_using_range::range_of_builtin_ubsan_call): Move from
range_of_builtin_ubsan_call.
(fold_using_range::range_of_builtin_call): Move from
range_of_builtin_call.
(gimple_ranger::range_of_builtin_call): Delete.
(fold_using_range::range_of_cond_expr): Move from gimple_ranger.
(gimple_ranger::fold_range_internal): New.
(gimple_ranger::range_of_stmt): Use new fold_using_range API.
(fold_using_range::range_of_ssa_name_with_loop_info): Move from
gimple_ranger.  Improve ranges of SSA_NAMES when possible.
* gimple-range.h (gimple_ranger): Remove various range_of routines.
(class fur_source): New.
(class fold_using_range): New.
(fur_source::fur_source): New.
(fold_range): New.
* vr-values.c (vr_values::extract_range_basic): Use fold_using_range
instead of range_of_builtin_call.
gcc/gimple-range.cc
gcc/gimple-range.h
gcc/vr-values.c