This is the mail archive of the gcc@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: RFC: Are V_MUST_DEFs really necessary?


On 3/8/06, Diego Novillo <dnovillo@redhat.com> wrote:
>
> While doing the memory SSA work, I started wondering about V_MUST_DEFs.
> I think we don't need them anymore.
>
> This may be a bit hasty on my part, I have not really thought it
> through.  But I cannot think of a single transformation that absolutely
> *requires* V_MUST_DEFs to work.
>
> When they were introduced, they would help propagation and DCE in cases
> like:
>
>   #   a_5 = V_MUST_DEF <a_4>;
>   a = 4;
>   #   a_6 = V_MUST_DEF <a_5>;
>   a = 1;
>
> where 'a' is a non-escaping addressable local.  However, DSE will/should
> also detect this chain, even if we used preserving defs (V_MAY_DEF).
>
> This could also be handled with memory SSA by not chaining these two stores.
>
> The propagators will happily propagate stores into V_MAY_DEFs, they do
> not require V_MUST_DEFs to work.

We have one distinction at the moment:

typedef struct { int x[10]; } X;
X a, b;
  #   a_3 = V_MUST_DEF <a_2>;
  #   VUSE <b_1>;
  a = b;
  #   VUSE <b_1>;
  D.1284_4 = b.x[2];
  #   a_5 = V_MAY_DEF <a_3>;
  a.x[2] = D.1284_4;

i.e. we see that for a = b it's a killing def, while the assignment to
a.x[2] is only
partial.  So what will we have in mem-ssa for the killing a = b and
the partial def?

Richard.


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