]> git.ipfire.org Git - thirdparty/gcc.git/commit
ipa-cp: Use the VR and bits lattices for clones of non-local functions too
authorMartin Jambor <mjambor@suse.cz>
Wed, 7 Jan 2026 12:34:45 +0000 (13:34 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 9 Jan 2026 14:34:58 +0000 (15:34 +0100)
commite58b11cd6c9ca3d05752ad84f743a46aa92a6979
tree381d894af22e6839719a3f1582f3912f9d7cad1f
parent3fd5a1e76bbf1bc031934a9d96f284a22a5f307f
ipa-cp: Use the VR and bits lattices for clones of non-local functions too

Since the IPA-CP lattices for value ranges cannot hold more values and
don't have any "variable" flag, we initialize them to bottom for
non-local nodes.  However, that means we don't make use of known
information gathered in jump functions when the corresponding node is
cloned for some other reason.  This patch allows collection of the
information and only does not use them for the original non-local
nodes, while making sure that we do not propagate information through
such-non local nodes as there may be unknown calls.

gcc/ChangeLog:

2026-01-06  Martin Jambor  <mjambor@suse.cz>

* ipa-cp.h (class ipcp_bits_lattice): New members set_recipient_only,
recipient_only_p and m_recipient_only.
(class ipcp_vr_lattice): Likewise.
(ipcp_vr_lattice::init): Initialize also m_recipient_only.
* ipa-cp.cc (ipcp_bits_lattice::print): Adjust printting to also
print the new flag.
(ipcp_vr_lattice::print): Likewise.
(ipcp_vr_lattice::set_recipient_only): New function.
(ipcp_bits_lattice::set_recipient_only): Likewise.
(set_all_contains_variable): New parameter MAKE_SIMPLE_RECIPIENTS, set
bits and vr lattices to recibient only insted to bottom when it is
true.
(initialize_node_lattices): Pass true to the second parameter of
set_all_contains_variable.
(propagate_bits_across_jump_function): Treat recipient_only source
lattices like bottom.
(propagate_vr_across_jump_function): Likewise.
(ipcp_store_vr_results): Skip non-local nodes.
gcc/ipa-cp.cc
gcc/ipa-cp.h