[PATCH]: Improve ability of PRE to detect redundancies

Daniel Berlin dberlin@dberlin.org
Tue Nov 30 14:53:00 GMT 2004


On Nov 29, 2004, at 10:28 AM, Zdenek Dvorak wrote:



> Hello,
>
>
> I guess this can happen if the original iv happens to be defined in
> a phi node.  I am not entirely sure rest of ivopts would behave sanely 
> then,
> even if this function is fixed.  The proper fix for the function is to
> add
>
> if (TREE_CODE (cand->incremented_at) == PHI_NODE)
>   return true;
>
> before the loop.
>
> On the other hand, the source of the need for the patch -- PRE creating
> the wrapped around ivs -- seems like a wrong idea to me.  This
> transformation seems to do nothing but increase register pressure.

Again, it actually saves a computation, which is why it wants to do it.
I still plan on stopping it from doing it, but we still should be 
handling wrap-around variables created elsewhere.
Just because I can easily stop PRE from doing it doesn't mean that it 
doesn't occur in real code, and that it isn't something we should 
handle.
Claiming that PRE is the only source of the need of the patch seems 
somewhat suspect, since i've hit wraparounds in real code that
we should be analyzing and optimizing.
--Dan




More information about the Gcc-patches mailing list