[PATCH] Prevent ifcvt from moving computations into loop

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Tue Jul 15 22:50:00 GMT 2003


Hello,

> On Tue, Jul 15, 2003 at 07:27:56PM +0200, Zdenek Dvorak wrote:
> > does someone know about some reason why the condition removed by this
> > patch is in find_if_case_2?
> 
> If the ELSE block can be removed entirely, then we'll remove one
> (static) branch from the program.  It's most useful for if-then-else
> diamonds, but the same concept applies to more complex DAGs.
> 
> > In cases like
> > 
> >   ---> something  ---> "else" --> "else_succ"
> >    /              \              /
> >    \              /            /
> >      -<- "then" -            ...
> 
> Perhaps we should just reject moving into the TEST block if either
> of the two successor edges have EDGE_DFS_BACK?

this won't help -- the loop may of course be more complicated.  Perhaps
just check for the diamond case you mention above?

Zdenek



More information about the Gcc-patches mailing list