phi-opt: Do limited form of cselim from phiopt [PR120533]
So currently cselim is limited to targets which have conditional move
and also happens later in the pipeline. This adds the limited form of cselim;
where there is only one store in the two sides and no loads after the store.
This fixes phiprop-2.c for gcn target and now can match the MIN in phiopt1
so it moves the matching of MIN to phiopt1.
The other testcases already disable cselim so they need to disable phiopt too.
Bootstrapped and tested on x86_64-linux-gnu.
PR tree-optimization/120533
gcc/ChangeLog:
* tree-ssa-phiopt.cc (cond_if_else_store_replacement_limited): New function.
(pass_phiopt::execute): Call cond_if_else_store_replacement_limited
for diamand case.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/pr35286.c: Add -fno-ssa-phiopt.
* gcc.dg/tree-ssa/split-path-6.c: Likewise.
* gcc.dg/tree-ssa/split-path-7.c: Likewise.
* gcc.dg/tree-ssa/phiprop-2.c: Move the check for MIN_EXPR to phiopt1.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>