On Sun, 2005-09-18 at 09:13 -0400, Andrew MacLeod wrote:
> On Sat, 2005-09-17 at 14:59, Daniel Berlin wrote:
> > It seems the only reason we have PHI_ARG_IMM_USE_NODE (and a struct
> > ssa_use_operand_d) in a phi node argument (struct phi_arg_d) is *just*
> > so we can iterate over the uses and hand back use_operand_p.
> > 
> > I'm talking, in particular, about:
> > 
> >  struct phi_arg_d GTY(())
> >  {
> >   /* imm_use MUST be the first element in struct because we do some
> >      pointer arithmetic with it.  See phi_arg_index_from_use.  */
> >   struct ssa_use_operand_d imm_use;
> >   
> > }
> > 
> > It's not actually usfeul as an immediate use, since it doesn't actually
> > point to an immediate use, and because you can get the argument itself
> > from PHI_ARG_DEF.
> > 
> 
> how do you figure that? 
> 
> a_1 = b_9
>      = a_1
> <...>
> a_9 = PHI <a_1(0), a_4(1), a_1 (2), a_6(3)>
> 
> If I want to replace all the uses of a_1 with b_9, I have to visit all 3
> uses of a_1, via FOR_EACH_IMM_USE_SAFE... including the ones in the PHI
> node.

No argument there.

> 
> So the arguments of the PHI node are indeed part the use list for a_1.
No argument there.


> The imm_use structure *is* the use (in both PHI args and in stmts), and
> it is linked
>  in with the other uses of a_1.
Rawr. This is not what i was told.

I was told the list only existed in the defining statement, and didn't
actually point *into the ssa_names that were users*.  But i guess that's
impossible if we want SET_USE to work.
Sigh.


Reply via email to