> > > Or something equivalent. Example: How do you know moving an
> > > expression out of a for loop is valid? The optimizer needs to
> > > understand the control flow.
> > 
> > is this still a useful thing to be doing?
> 
> Yes.

what's your argument?

my argument is that the cpu is so fast relative to
the network and disk, that wasting a few cycles is a good
tradeoff for compiler and debugging simplicity,
and compile speed.

further, i'm not sure the compiler is in a position
to know when strength reduction will make sense.
intel, for example, does a lot of optimization that
is "not architectural".  that's code that means they
won't tell you what will be a net win.

i can think of a number of things that might defeat
moving code out of a loop, such as the computation using
otherwise idle functional units, keeping the value
in the trace cache, keeping the value out of l2, the
loop detector, etc.

- erik

Reply via email to