Re: Using associativity for optimization

2014-12-02 Thread shmeel gutl
On 02-Dec-14 12:23 PM, Richard Biener wrote: On Tue, Dec 2, 2014 at 12:11 AM, shmeel gutl wrote: While testing my implementation of passing arguments in registers, I noticed that gcc 4.7 creates instruction dependencies when it doesn't have to. Consider: int foo(int a1, int a2, int a3, int a4)

Re: Using associativity for optimization

2014-12-02 Thread John Vickers
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [Apologies if I'm talking rubbish, or spamming folk with the obvious] Such an optimisation would ideally be dependent on some estimate on the register pressure for the relevant register class[es], and perhaps on some heuristic estimate of the relative

Re: Using associativity for optimization

2014-12-02 Thread shmeel gutl
It works fine for my test case. Thanks Richard Biener wrote: >On Tue, Dec 2, 2014 at 12:11 AM, shmeel gutl > wrote: >> While testing my implementation of passing arguments in registers, I noticed >> that gcc 4.7 creates instruction dependencies when it doesn't have to. >> Consider: >> >> int foo

Re: Using associativity for optimization

2014-12-02 Thread Richard Biener
On Tue, Dec 2, 2014 at 12:11 AM, shmeel gutl wrote: > While testing my implementation of passing arguments in registers, I noticed > that gcc 4.7 creates instruction dependencies when it doesn't have to. > Consider: > > int foo(int a1, int a2, int a3, int a4) > { > return a1|a2|a3|a4; > } > >