[Gllug] code optimisations

Nix nix at esperi.org.uk
Thu Mar 24 10:29:26 UTC 2005


On Wed, 23 Mar 2005, nix at esperi.org.uk mused:
> On Tue, 22 Mar 2005, Rich Walker stipulated:
>> But it's ... interesting ... to communicate to a C compiler that the
>> second optimisation is valid. If you did:
>> 
>>   void foo(int ** __restrict__ a) { }
> 
> As long as i and j are locals, I think that is acceptable. The compiler
> knows that a[i][j] and a[i+1000000/2][j] cannot alias :)

Except of course that they can: if i == 10000000, they would alias.
This optimization is not valid in this case. :)

-- 
This is like system("/usr/funky/bin/perl -e 'exec sleep 1'");
   --- Peter da Silva
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list