Re: [PATCH GCC]Move simplification of (A == C1) ? A : C2 to match.pd

2016-11-23 Thread Bin.Cheng
On Wed, Nov 23, 2016 at 2:40 PM, Marc Glisse wrote: > On Fri, 18 Nov 2016, Bin Cheng wrote: > > +(for cmp (lt le gt ge) > + (simplify > + (cond (cmp@0 (convert1? @1) INTEGER_CST@3) (convert2? @1) INTEGER_CST@2) > + (with > + { > + tree from_type = TREE_TYPE (@1); > +

Re: [PATCH GCC]Move simplification of (A == C1) ? A : C2 to match.pd

2016-11-23 Thread Marc Glisse
On Fri, 18 Nov 2016, Bin Cheng wrote: +(for cmp (lt le gt ge) + (simplify + (cond (cmp@0 (convert1? @1) INTEGER_CST@3) (convert2? @1) INTEGER_CST@2) + (with + { + tree from_type = TREE_TYPE (@1); + tree c1_type = TREE_TYPE (@3), c2_type = TREE_TYPE (@2); + enum tree_code code =

Re: [PATCH GCC]Move simplification of (A == C1) ? A : C2 to match.pd

2016-11-23 Thread Richard Biener
On Fri, Nov 18, 2016 at 5:53 PM, Bin Cheng wrote: > Hi, > This is a follow up patch for > https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01898.html > It moves remaining simplification for (A == C1) ? A : C2 in > fold_cond_expr_with_comparison > to match.pd. Bootstrap and test

[PATCH GCC]Move simplification of (A == C1) ? A : C2 to match.pd

2016-11-18 Thread Bin Cheng
Hi, This is a follow up patch for https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01898.html It moves remaining simplification for (A == C1) ? A : C2 in fold_cond_expr_with_comparison to match.pd. Bootstrap and test on x86_64 and AArch64, is it OK? Thanks, bin 2016-11-17 Bin Cheng