]> git.ipfire.org Git - thirdparty/gcc.git/commit
Allow single PHI initial values.
authorAndrew MacLeod <amacleod@redhat.com>
Fri, 14 Nov 2025 21:11:30 +0000 (16:11 -0500)
committerAndrew MacLeod <amacleod@redhat.com>
Sun, 16 Nov 2025 22:20:41 +0000 (17:20 -0500)
commitbeba09b5c5a2f4ec4e75e5f6d3dd1e2494b04a2b
treeb74a42fcecde8fe98aa9b348ed3753a4ae69e091
parent337ebeccfdaaea5549324e749ad503ac6008d860
Allow single PHI initial values.

There are some single PHI groups that can benefit from an initial
value.  Also improve the iteration calculation by bounding each
iteration with the known global value.

PR tree-optimization/121345
gcc/
* gimple-range-phi.cc (phi_group::phi_group): Add modifier name.
(phi_group::is_modifier_p): Set modifier stmt operand name.
(phi_group::calculate_using_modifier): Bound the iteration range
by known global range.
(phi_analyzer::process_phi): Allow single PHIS if they meet certain
criteria.
* gimple-range-phi.h (m_modifier_name): New member.
(is_modifier_p): Adjust prototype.

gcc/testsuite/
* g++.dg/pr121345.C: New.
gcc/gimple-range-phi.cc
gcc/gimple-range-phi.h
gcc/testsuite/g++.dg/pr121345.C [new file with mode: 0644]