]> git.ipfire.org Git - thirdparty/gcc.git/commit
PHIOPT: move factor_out_conditional_operation over to use gimple_match_op
authorAndrew Pinski <quic_apinski@quicinc.com>
Sat, 20 Apr 2024 07:13:12 +0000 (00:13 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Sun, 18 Aug 2024 18:21:39 +0000 (11:21 -0700)
commitcd2f394418be0cc15d05c97ed72567f2f5e15172
treed0c585db38a5a0af0c1d263d0bb8205fd0ab1186
parent1cfe4a4d0d4447b364815d5e5c889deb2e533669
PHIOPT: move factor_out_conditional_operation over to use gimple_match_op

To start working on more with expressions with more than one operand, converting
over to use gimple_match_op is needed.
The added side-effect here is factor_out_conditional_operation can now support
builtins/internal calls that has one operand without any extra code added.

Note on the changed testcases:
* pr87007-5.c: the test was testing testing for avoiding partial register stalls
for the sqrt and making sure there is only one zero of the register before the
branch, the phiopt would now merge the sqrt's so disable phiopt.

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

* gimple-match-exports.cc (gimple_match_op::operands_occurs_in_abnormal_phi):
New function.
* gimple-match.h (gimple_match_op): Add operands_occurs_in_abnormal_phi.
* tree-ssa-phiopt.cc (factor_out_conditional_operation): Use gimple_match_op
instead of manually extracting from/creating the gimple.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr87007-5.c: Disable phi-opt.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/gimple-match-exports.cc
gcc/gimple-match.h
gcc/testsuite/gcc.target/i386/pr87007-5.c
gcc/tree-ssa-phiopt.cc