Boost logo

Boost :

Subject: Re: [boost] [interprocess] default constructors
From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-12-05 20:39:49


On Fri, Dec 5, 2008 at 4:59 PM, Mathias Gaunard
<mathias.gaunard_at_[hidden]> wrote:
> Emil Dotchevski wrote:
>
>> I don't see how const-propagation is relevant here, but regardless --
>> const-propagation rarely (if ever) leads to optimization
>> possibilities.
>
> It is certainly one of the most (if not the most) important optimization in
> a compiler.
> http://en.wikipedia.org/wiki/Constant_folding
>
> sparse conditional constant propagation is probably quite necessary for good
> propagation across branches.

Ah I misunderstood your point, but even so, this is tricky stuff. For
example, floating point constant expressions are sometimes evaluated
at run-time.

But in this particular case, the compiler can't always see the
"constness" of the if. You can argue that "whole program optimization"
kind of stuff can help, but the thing is, it can help even if by
definition the move semantics are not destructive. :)

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk