Re: Optimize calls to functions that return one of their arguments

2012-05-15 Thread Eric Botcazou
> I checked in a fix. Thanks! -- Eric Botcazou

Re: Optimize calls to functions that return one of their arguments

2012-05-15 Thread Bernd Schmidt
On 05/15/2012 09:12 AM, Eric Botcazou wrote: Ok, that looks like three votes in favour. I've checked in the following variant with a few minor changes. I've added strcpy and memset to the list of functions, and split off a new function in ira-lives. Changes to subdirectories must be documented

Re: Optimize calls to functions that return one of their arguments

2012-05-15 Thread Eric Botcazou
> Ok, that looks like three votes in favour. I've checked in the following > variant with a few minor changes. I've added strcpy and memset to the > list of functions, and split off a new function in ira-lives. Changes to subdirectories must be documented in the subdirectory's ChangeLog (ada, c-f

Re: Optimize calls to functions that return one of their arguments

2012-05-14 Thread Vladimir Makarov
On 05/14/2012 08:08 AM, Bernd Schmidt wrote: On 05/09/2012 05:53 PM, Vladimir Makarov wrote: It is pretty interesting and original idea. My only major objection to the patch is about treatment of ALLOCNO_CHEAP_CALLS_CROSSED_NUM. I think it should be accumulated as ALLOCNO_CALLS_CROSSED_NUM. Ch

Re: Optimize calls to functions that return one of their arguments

2012-05-14 Thread Jakub Jelinek
On Mon, May 14, 2012 at 02:08:34PM +0200, Bernd Schmidt wrote: > --- gcc/builtins.def (revision 187411) > +++ gcc/builtins.def (working copy) > @@ -532,10 +532,10 @@ DEF_EXT_LIB_BUILTIN(BUILT_IN_BZERO, > DEF_EXT_LIB_BUILTIN(BUILT_IN_INDEX, "index", > BT_FN_STRING_CONST_STRING_INT, ATTR_

Re: Optimize calls to functions that return one of their arguments

2012-05-14 Thread Bernd Schmidt
On 05/09/2012 05:53 PM, Vladimir Makarov wrote: It is pretty interesting and original idea. My only major objection to the patch is about treatment of ALLOCNO_CHEAP_CALLS_CROSSED_NUM. I think it should be accumulated as ALLOCNO_CALLS_CROSSED_NUM. Changed (places in ira-buld.c). I don't expect

Re: Optimize calls to functions that return one of their arguments

2012-05-09 Thread Vladimir Makarov
On 04/28/2012 11:31 AM, Bernd Schmidt wrote: This patch allows us to recognize that even if the argument to memcpy lives across the call, we can allocate it to a call-used register by reusing the return value of the function. First, the patch sets the existing "fn spec" attribute for memcpy/m

Re: Optimize calls to functions that return one of their arguments

2012-05-07 Thread Vladimir Makarov
On 05/07/2012 10:30 AM, Bernd Schmidt wrote: On 05/03/2012 07:47 PM, Richard Sandiford wrote: Richard Guenther writes: On Sat, Apr 28, 2012 at 5:31 PM, Bernd Schmidt wrote: This patch allows us to recognize that even if the argument to memcpy lives across the call, we can allocate it to a ca

Re: Optimize calls to functions that return one of their arguments

2012-05-07 Thread Bernd Schmidt
On 05/03/2012 07:47 PM, Richard Sandiford wrote: Richard Guenther writes: On Sat, Apr 28, 2012 at 5:31 PM, Bernd Schmidt wrote: This patch allows us to recognize that even if the argument to memcpy lives across the call, we can allocate it to a call-used register by reusing the return value o

Re: Optimize calls to functions that return one of their arguments

2012-05-03 Thread Richard Sandiford
Richard Guenther writes: > On Sat, Apr 28, 2012 at 5:31 PM, Bernd Schmidt > wrote: >> This patch allows us to recognize that even if the argument to memcpy lives >> across the call, we can allocate it to a call-used register by reusing the >> return value of the function. >> >> First, the patch

Re: Optimize calls to functions that return one of their arguments

2012-05-02 Thread Bernd Schmidt
On 05/02/2012 11:10 AM, Richard Guenther wrote: On Sat, Apr 28, 2012 at 5:31 PM, Bernd Schmidt wrote: This patch allows us to recognize that even if the argument to memcpy lives across the call, we can allocate it to a call-used register by reusing the return value of the function. Heh, inte

Re: Optimize calls to functions that return one of their arguments

2012-05-02 Thread Richard Guenther
On Sat, Apr 28, 2012 at 5:31 PM, Bernd Schmidt wrote: > This patch allows us to recognize that even if the argument to memcpy lives > across the call, we can allocate it to a call-used register by reusing the > return value of the function. > > First, the patch sets the existing "fn spec" attribut

Optimize calls to functions that return one of their arguments

2012-04-28 Thread Bernd Schmidt
This patch allows us to recognize that even if the argument to memcpy lives across the call, we can allocate it to a call-used register by reusing the return value of the function. First, the patch sets the existing "fn spec" attribute for memcpy/memmove. This is translated to a new form of C