Re: [PATCH 2/2][GCC] Add one more pattern to RTL if-conversion

2016-06-02 Thread Bernd Schmidt
On 05/24/2016 07:21 PM, Mikhail Maltsev wrote: + target = expand_simple_binop (mode, (diff < 0) ? MINUS : PLUS, Parentheses around (diff < 0) aren't needed. Otherwise I think this is also OK. Bernd

Re: [PATCH 2/2][GCC] Add one more pattern to RTL if-conversion

2016-05-24 Thread Mikhail Maltsev
On 05/23/2016 05:15 PM, Kyrill Tkachov wrote: > > expand_simple_binop may fail. I think you should add a check that diff_rtx is > non-NULL > and bail out early if it is. > Fixed. -- Regards, Mikhail Maltsev diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index a9c146b..e1473eb 100644 --- a/gcc/ifcvt

Re: [PATCH 2/2][GCC] Add one more pattern to RTL if-conversion

2016-05-23 Thread Kyrill Tkachov
Hi Mikhail, On 23/05/16 15:00, Mikhail Maltsev wrote: This patch adds a new if-conversion pattern for the following case: if (test) x = A; else x = B; A and B are constants, abs(A - B) == 2^N, A != 0, B != 0 Bootstrapped and regtested on x86_64-linux. OK for trunk? @@ -1453,6 +1460,

[PATCH 2/2][GCC] Add one more pattern to RTL if-conversion

2016-05-23 Thread Mikhail Maltsev
This patch adds a new if-conversion pattern for the following case: if (test) x = A; else x = B; A and B are constants, abs(A - B) == 2^N, A != 0, B != 0 Bootstrapped and regtested on x86_64-linux. OK for trunk? -- Regards, Mikhail Maltsev gcc/testsuite/ChangeLog: 2016-05-23 Mikhai