This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa]: Constant propagation into PHI's screws up IVR and PRE
On Wed, Jul 30, 2003 at 12:47:41PM -0400, Daniel Berlin wrote:
> >
> >I would think you ought to be able to tell that the edge from 2 is the
> >initialization edge, and it doesn't matter what value is there.
> You can't, without knowing the original variable before propagation.
> Otherwise you risk calling things that *aren't* induction variables,
> induction variables.
I don't think so. Do you have an example?
One of the values comes from a nesting level less than that of the loop's
phi-node, and this is the initial value of the IV. The other value comes
from a nesting level greater or equal to the loops phi node, and this is
the evolution part. The initial condition is the only argument that
could contain a constant (after CCP), the other argument points to the
update assignment in the current loop nest.
> Which we can't get, since DCE will remove the original set now that
> it's useless.
> In the i = 0 case, the set of i = 0 will be completely removed, so we
> have *zero* way of telling what the original variable was.
>
???
The phi node does contain the initial condition for the variable i:
# i_1 = PHI <0(0), i_7(10)>;
initial condition ^^^^
The other pointer (i_7) is necessarily nested in the current loop.