This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Avoid ssa update in cfg cleanup


On Thu, 2006-02-23 at 18:22 +0100, Zdenek Dvorak wrote:
> Hello,
> 

> a_2 = V_MAY_DEF (a_1)
> b_4 = V_MAY_DEF (b_3)
> *p = 0;
> 
> copy/constant propagation changes this to
> 
> int x = 0;
> int a, b;
> 
> p= &b;
> 
> a_2 = V_MAY_DEF (a_1)
> b_4 = V_MAY_DEF (b_3)
> b = 0;                         (*)
> 
> Now, during update for statement (*), we want it to become
> 
> b_4 = V_MUST_DEF (b_3)
> b = 0;
> 
> Therefore, in finalize_ssa_v_must_def_ops, we must also look for
> the ssa names in the v_may_def list.  The way tree-ssa-opfinalize.h:FINALIZE_FUNC
> is written, it is fairly hard to make it walk two different lists when
> looking for such a ssa name, and to transform the may_def to must_def.

my question is *how* do you know to change it to a MUSTDEF there.
because there is a 'b' symbol on the stmt, the b_4 = V_MAY_DEF (b_3)
would normally be kept around as a MAYDEF, and you are now changing it
to a mustdef.

but then if we had,

b_6 = V_MAY_DEF <b_7>
  b = <..>

and we changed it to something else like
  b = foo()

we would also have keep the maydef around, but as a MAYDEF, not as a
MUSTDEF.

how do you know in opfinalize whether it should be a MAYDEF or a
MUSTDEF? it has no context in order to make the change? 

if the structures were combined, and there was a bit to twiddle, where
do you have the context that would enable you to twiddle the bit? during
the call to replace_uses_by() ?

Andrew
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]