Re: [Patch] Teach RTL ifcvt to handle multiple simple set instructions

2015-09-12 Thread Eric Botcazou
> Some targets have -mbranch-cost to allow overriding the default costing. > visium has a branch cost of 10! Yeah, the GR5 variant is pipelined but has no branch prediction; moreover there is an additional adverse effect coming for the instructions bus... > Several ports have a cost of 6

Re: [Patch] Teach RTL ifcvt to handle multiple simple set instructions

2015-09-11 Thread James Greenhalgh
On Fri, Sep 11, 2015 at 10:04:12AM +0100, Ramana Radhakrishnan wrote: > On Fri, Sep 11, 2015 at 10:53:13AM +0200, Bernd Schmidt wrote: > > On 09/10/2015 11:11 PM, Jeff Law wrote: > > >I think that's probably what James is most interested in getting some > > >ideas around -- the cost model. > > > >

Re: [Patch] Teach RTL ifcvt to handle multiple simple set instructions

2015-09-11 Thread Kyrill Tkachov
On 10/09/15 22:11, Jeff Law wrote: On 09/10/2015 12:23 PM, Bernd Schmidt wrote: > No testcase provided, as currently I don't know of targets with a high > enough branch cost to actually trigger the optimisation. Hmm, so the code would not actually be used right now? In that case I'll

Re: [Patch] Teach RTL ifcvt to handle multiple simple set instructions

2015-09-11 Thread Bernd Schmidt
On 09/10/2015 11:11 PM, Jeff Law wrote: I think that's probably what James is most interested in getting some ideas around -- the cost model. I think the fundamental problem is BRANCH_COST isn't actually relative to anything other than the default value of "1". It doesn't directly correspond

Re: [Patch] Teach RTL ifcvt to handle multiple simple set instructions

2015-09-11 Thread Ramana Radhakrishnan
On Fri, Sep 11, 2015 at 10:53:13AM +0200, Bernd Schmidt wrote: > On 09/10/2015 11:11 PM, Jeff Law wrote: > >I think that's probably what James is most interested in getting some > >ideas around -- the cost model. > > > >I think the fundamental problem is BRANCH_COST isn't actually relative > >to

Re: [Patch] Teach RTL ifcvt to handle multiple simple set instructions

2015-09-11 Thread Jeff Law
On 09/11/2015 02:49 AM, Kyrill Tkachov wrote: On 10/09/15 22:11, Jeff Law wrote: On 09/10/2015 12:23 PM, Bernd Schmidt wrote: > No testcase provided, as currently I don't know of targets with a high > enough branch cost to actually trigger the optimisation. Hmm, so the code would not

Re: [Patch] Teach RTL ifcvt to handle multiple simple set instructions

2015-09-10 Thread Bernd Schmidt
On 09/08/2015 04:53 PM, James Greenhalgh wrote: One big question I have with this patch is how I ought to write a meaningful cost model I've used. It seems like yet another misuse of RTX costs, and another bit of stuff for targets to carefully balance. Now, if the relative cost of branches and

Re: [Patch] Teach RTL ifcvt to handle multiple simple set instructions

2015-09-10 Thread Jeff Law
On 09/10/2015 12:23 PM, Bernd Schmidt wrote: > No testcase provided, as currently I don't know of targets with a high > enough branch cost to actually trigger the optimisation. Hmm, so the code would not actually be used right now? In that case I'll leave it to others to decide whether we

[Patch] Teach RTL ifcvt to handle multiple simple set instructions

2015-09-08 Thread James Greenhalgh
Hi, RTL "noce" ifcvt will currently give up if the branches it is trying to make conditional are too complicated. One of the conditions for "too complicated" is that the branch sets more than one value. One common idiom that this misses is something like: int d = a[i]; int e = b[i]; if