Re: gsoc: Loop invariant hoisting

Christopher Stacy <[email protected]> Sat, 23 Jun 2018 23:04:18 -0400
Newsgroups gmane.lisp.clisp.devel
Message-ID <[email protected]>
Measuring / timing or relying on the delay of code is naturally an 
implementation dependent thing, and it's also something that is useful 
and that programs are known to do.

We have the OPTIMIZE declarations, which are ignorable and allow 
implementation dependent qualities; sometimes documented (which 
programmers are tempted to view as guarantees).

I don't think this hoisting feature should necessarily respect the SPEED 
quality either way: you shouldn't have to make a declaration to get 
ordinary optimizations like this, especially ones that don't argue 
against SAFETY in whatever strategy calculus is in the mind of the 
implementor.  Note that there are no negative values allowed for 
optimize qualities.

When someone writes timing code like this, it is for a special purpose, 
so they should have to make a more specific declaration of their weird 
intent. The most conservative approach, and coincidentally perhaps the 
easiest to implement, would be a very specific "negative quality" called 
NO-HOIST that given any value other than 0 means not to do this 
particular optimization. This would also flag the source code for 
humans; for third-party tools, it would be flagged as an unknown 
optimization (which is about as meaningful as it can really be at that 
level, anyway).


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel