]> git.ipfire.org Git - thirdparty/gcc.git/commit
Minor range type fixes for IPA in preparation for prange.
authorAldy Hernandez <aldyh@redhat.com>
Tue, 19 Mar 2024 16:55:58 +0000 (17:55 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 7 May 2024 10:17:50 +0000 (12:17 +0200)
commit24853cd854eb9b8a5c7b9706ad0908221bf964ce
tree5efdaa06ab5e3d2c868d2a50fbd626cab7cba6c3
parentf68e90a0fe88c50ad6f4b15ba9e9503c710d3444
Minor range type fixes for IPA in preparation for prange.

The polymorphic Value_Range object takes a tree type at construction
so it can determine what type of range to use (currently irange or
frange).  It seems a few of the types are slightly off.  This isn't a
problem now, because IPA only cares about integers and pointers, which
can both live in an irange.  However, with prange coming about, we
need to get the type right, because you can't store an integer in a
pointer range or vice versa.

Also, in preparation for prange, the irange::supports_p() idiom will become:

      irange::supports_p () || prange::supports_p()

To avoid changing all these places, I've added an inline function we
can later change and change everything at once.

Finally, there's a Value_Range::supports_type_p() &&
irange::supports_p() in the code.  The latter is a subset of the
former, so there's no need to check both.

gcc/ChangeLog:

* ipa-cp.cc (ipa_vr_operation_and_type_effects): Use ipa_supports_p.
(ipa_value_range_from_jfunc): Change Value_Range type.
(propagate_vr_across_jump_function): Same.
* ipa-cp.h (ipa_supports_p): New.
* ipa-fnsummary.cc (evaluate_conditions_for_known_args): Change Value_Range type.
* ipa-prop.cc (ipa_compute_jump_functions_for_edge): Use ipa_supports_p.
(ipcp_get_parm_bits): Same.
gcc/ipa-cp.cc
gcc/ipa-cp.h
gcc/ipa-fnsummary.cc
gcc/ipa-prop.cc