Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-28 Thread Richard Biener
On Thu, Aug 28, 2014 at 12:13 AM, Jeff Law wrote: > On 08/13/14 08:57, Richard Earnshaw wrote: >> >> The problem with the frankenmonster patterns is that they tend to >> proliferate into the machine description, and before you know where you >> are the back-end is full of them. > > Can't argue wit

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-27 Thread Jeff Law
On 08/13/14 08:57, Richard Earnshaw wrote: The problem with the frankenmonster patterns is that they tend to proliferate into the machine description, and before you know where you are the back-end is full of them. Can't argue with that :-) I really do think that the best solution would be to

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-27 Thread Jeff Law
On 08/18/14 04:33, Kyrill Tkachov wrote: On 18/08/14 10:19, Richard Earnshaw wrote: On 14/08/14 09:45, Kyrill Tkachov wrote: On 13/08/14 18:32, Segher Boessenkool wrote: On Wed, Aug 13, 2014 at 03:57:31PM +0100, Richard Earnshaw wrote: The problem with the frankenmonster patterns is that the

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-18 Thread Kyrill Tkachov
On 18/08/14 10:19, Richard Earnshaw wrote: On 14/08/14 09:45, Kyrill Tkachov wrote: On 13/08/14 18:32, Segher Boessenkool wrote: On Wed, Aug 13, 2014 at 03:57:31PM +0100, Richard Earnshaw wrote: The problem with the frankenmonster patterns is that they tend to proliferate into the machine des

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-18 Thread Richard Earnshaw
On 14/08/14 09:45, Kyrill Tkachov wrote: > > On 13/08/14 18:32, Segher Boessenkool wrote: >> On Wed, Aug 13, 2014 at 03:57:31PM +0100, Richard Earnshaw wrote: >>> The problem with the frankenmonster patterns is that they tend to >>> proliferate into the machine description, and before you know whe

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-14 Thread pinskia
> On Aug 14, 2014, at 1:45 AM, Kyrill Tkachov wrote: > > >> On 13/08/14 18:32, Segher Boessenkool wrote: >>> On Wed, Aug 13, 2014 at 03:57:31PM +0100, Richard Earnshaw wrote: >>> The problem with the frankenmonster patterns is that they tend to >>> proliferate into the machine description, and

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-14 Thread Kyrill Tkachov
On 13/08/14 18:32, Segher Boessenkool wrote: On Wed, Aug 13, 2014 at 03:57:31PM +0100, Richard Earnshaw wrote: The problem with the frankenmonster patterns is that they tend to proliferate into the machine description, and before you know where you are the back-end is full of them. Furthermore

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-13 Thread Segher Boessenkool
On Wed, Aug 13, 2014 at 03:57:31PM +0100, Richard Earnshaw wrote: > The problem with the frankenmonster patterns is that they tend to > proliferate into the machine description, and before you know where you > are the back-end is full of them. > > Furthermore, they are very sensitive to the greedy

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-13 Thread Richard Earnshaw
On 12/08/14 18:03, Kyrill Tkachov wrote: > > On 12/08/14 16:16, Kyrill Tkachov wrote: >> On 12/08/14 16:11, Kyrill Tkachov wrote: >>> On 12/08/14 15:22, Jeff Law wrote: On 08/12/14 04:31, Kyrill Tkachov wrote: > On 12/08/14 10:39, Richard Biener wrote: >> On Mon, Aug 11, 2014 at 9:56

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-12 Thread Segher Boessenkool
On Tue, Aug 12, 2014 at 04:16:34PM +0100, Kyrill Tkachov wrote: > >I managed to get combine to recognise this pattern: > >(set (match_operand:GPI 0 "register_operand" "=r") > > (plus:GPI (xor:GPI (neg:GPI (match_operand:GPI 1 > >"register_operand" "r")) > > (mat

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-12 Thread Kyrill Tkachov
On 12/08/14 16:16, Kyrill Tkachov wrote: On 12/08/14 16:11, Kyrill Tkachov wrote: On 12/08/14 15:22, Jeff Law wrote: On 08/12/14 04:31, Kyrill Tkachov wrote: On 12/08/14 10:39, Richard Biener wrote: On Mon, Aug 11, 2014 at 9:56 PM, Jeff Law wrote: On 08/11/14 07:41, Kyrill Tkachov wrote:

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-12 Thread Kyrill Tkachov
On 12/08/14 16:11, Kyrill Tkachov wrote: On 12/08/14 15:22, Jeff Law wrote: On 08/12/14 04:31, Kyrill Tkachov wrote: On 12/08/14 10:39, Richard Biener wrote: On Mon, Aug 11, 2014 at 9:56 PM, Jeff Law wrote: On 08/11/14 07:41, Kyrill Tkachov wrote: I haven't been able to get combine to matc

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-12 Thread Kyrill Tkachov
On 12/08/14 15:22, Jeff Law wrote: On 08/12/14 04:31, Kyrill Tkachov wrote: On 12/08/14 10:39, Richard Biener wrote: On Mon, Aug 11, 2014 at 9:56 PM, Jeff Law wrote: On 08/11/14 07:41, Kyrill Tkachov wrote: I haven't been able to get combine to match the comparison+xor+neg+plus RTL and it s

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-12 Thread Jeff Law
On 08/12/14 04:31, Kyrill Tkachov wrote: On 12/08/14 10:39, Richard Biener wrote: On Mon, Aug 11, 2014 at 9:56 PM, Jeff Law wrote: On 08/11/14 07:41, Kyrill Tkachov wrote: I haven't been able to get combine to match the comparison+xor+neg+plus RTL and it seems like it would be just a workar

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-12 Thread Richard Biener
On Tue, Aug 12, 2014 at 12:31 PM, Kyrill Tkachov wrote: > > On 12/08/14 10:39, Richard Biener wrote: >> >> On Mon, Aug 11, 2014 at 9:56 PM, Jeff Law wrote: >>> >>> On 08/11/14 07:41, Kyrill Tkachov wrote: I haven't been able to get combine to match the comparison+xor+neg+plus

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-12 Thread Marc Glisse
On Mon, 11 Aug 2014, Kyrill Tkachov wrote: The aarch64 target has a conditional negation instruction CSNEG Rd, Rs1, Rs2, cond with semantics Rd = if cond then Rs1 else -Rs2. This, however doesn't get end up getting matched for code such as: int foo2 (unsigned a, unsigned b) { int r = 0; r =

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-12 Thread Kyrill Tkachov
On 12/08/14 10:39, Richard Biener wrote: On Mon, Aug 11, 2014 at 9:56 PM, Jeff Law wrote: On 08/11/14 07:41, Kyrill Tkachov wrote: I haven't been able to get combine to match the comparison+xor+neg+plus RTL and it seems like it would be just a workaround to undo the tree-level transformation

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-12 Thread Richard Biener
On Mon, Aug 11, 2014 at 9:56 PM, Jeff Law wrote: > On 08/11/14 07:41, Kyrill Tkachov wrote: >> >> >> I haven't been able to get combine to match the comparison+xor+neg+plus >> RTL and it seems like it would be just a workaround to undo the >> tree-level transformation. > > Yea, it'd just be a work

Re: Conditional negation elimination in tree-ssa-phiopt.c

2014-08-11 Thread Jeff Law
On 08/11/14 07:41, Kyrill Tkachov wrote: I haven't been able to get combine to match the comparison+xor+neg+plus RTL and it seems like it would be just a workaround to undo the tree-level transformation. Yea, it'd just be a workaround, but it's probably the easiest way to deal with this problem