Hi Andrew, just a nit..
On Wed, 23 Jun 2021 15:19:13 -0700 apinski--- via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > From: Andrew Pinski <apin...@marvell.com> > > Since match and simplify does not have all of the inverted > comparison patterns, it make sense to just have > phi-opt try to do the inversion and try match and simplify again. > > OK? Bootstrapped and tested on x86_64-linux-gnu. > > Thanks, > Andrew Pinski > > gcc/ChangeLog: > > * tree-ssa-phiopt.c (gimple_simplify_phiopt): > If "A ? B : C" fails to simplify, try "(!A) ? C : B". > --- > gcc/tree-ssa-phiopt.c | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c > index 8b0e68c1e90..5f099eca343 100644 > --- a/gcc/tree-ssa-phiopt.c > +++ b/gcc/tree-ssa-phiopt.c > @@ -828,7 +828,8 @@ phiopt_early_allow (enum tree_code code) > with parts pushed if EARLY_P was true. Also rejects non allowed tree code > if EARLY_P is set. > Takes the comparison from COMP_STMT and two args, ARG0 and ARG1 and tries > - to simplify CMP ? ARG0 : ARG1. */ > + to simplify CMP ? ARG0 : ARG1. > + Also try to simplify (!CMP) ? ARG0 : ARG1 if the non-inverse failed. */ commentary typo above, args need swap: + Also try to simplify (!CMP) ? ARG1 : ARG0 if the non-inverse failed. */ thanks,