[4.5] Doloop improvement patches, 7/7

Steven Bosscher stevenb.gcc@gmail.com
Sun Mar 8 23:08:00 GMT 2009


[xf. http://gcc.gnu.org/ml/gcc-patches/2009-03/msg00349.html ]

Bernd Schmidt wrote:
> Zdenek Dvorak wrote:
> > Hi,
> >
> >> This adds another way for simplify_using_initial_values to simplify an
> >> expression.  If there's only on def for a given reg in the function, and
> >> it sets the register to a constant, we can simply replace that register
> >> in our expression.
> >
> > why does not constant propagation take care of this?  I am somewhat
> > reluctant about letting this change in, if it merely masks a deficiency
> > in another optimization,
>
> To be honest, I didn't consider it, but I think that if a constant is
> used multiple times, it's expected that it won't be propagated -
> otherwise we'd just be undoing the effects of CSE.  Even if the constant
> is used only once, it may have been moved out of a loop (an outer loop
> in the case we're looking at here), so I think there is no missed
> optimization elsewhere.

But shouldn't there be a REG_EQUAL note in this case?  Normally, if a
constant could be propagated but it is not profitable, then we leave a
REG_EQUAL note on it. At least fwprop and CPROP used to do so.

Gr.
Steven



More information about the Gcc-patches mailing list