]> git.ipfire.org Git - thirdparty/gcc.git/commit
phiopt: Move the common code between pass_phiopt and pass_cselim into a seperate...
authorAndrew Pinski <quic_apinski@quicinc.com>
Mon, 9 Sep 2024 22:34:11 +0000 (15:34 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Tue, 10 Sep 2024 06:43:25 +0000 (23:43 -0700)
commitb081e6c860eb9688d24365d39586bc1b4c3fe28b
treea618e8260cd5e7268ec2ddb745056dc09f01c862
parent1b4497d61d47420a625240a117175a707bddb8fc
phiopt: Move the common code between pass_phiopt and pass_cselim into a seperate function

When r14-303-gb9fedabe381cce was done, it was missed that some of the common parts could
be done in a template and a lambda could be used. This patch implements that. This new
function can be used later on to implement a simple ifcvt pass.

gcc/ChangeLog:

* tree-ssa-phiopt.cc (execute_over_cond_phis): New template function,
moved the common parts from pass_phiopt::execute/pass_cselim::execute.
(pass_phiopt::execute): Move the functon specific parts of the loop
into an lamdba.
(pass_cselim::execute): Likewise.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/tree-ssa-phiopt.cc