[Haskell-cafe] How far compilers are allowed to go with optimizations?
Brandon Allbery
allbery.b at gmail.com
Wed Feb 6 14:55:45 CET 2013
On Wed, Feb 6, 2013 at 6:45 AM, Jan Stolarek <jan.stolarek at p.lodz.pl> wrote:
> nevertheless I objected to his opinion, claiming that if compiler
> performed such a high-level
> optimization - replace underlying data structure with a different one and
> turn one algorithm into
> a completely different one - programmer wouldn't be able to reason about
> space behaviour of a
> program. I concluded that such a solution should not be built into a
> compiler but instead turned
> into an EDSL.
>
For what it's worth, the main dividing line between -O1 and -O2 in gcc is
that -O2 may change space or time behavior in unexpected ways. (This may
explain e.g.
https://plus.google.com/u/0/102208456519922110915/posts/DZsZ6mvA4T6)
--
brandon s allbery kf8nh sine nomine associates
allbery.b at gmail.com ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130206/33b48636/attachment.htm>
More information about the Haskell-Cafe
mailing list