This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Help in understanding ccp propagator
- From: Richard Guenther <rguenther at suse dot de>
- To: Revital1 Eres <ERES at il dot ibm dot com>
- Cc: Daniel Berlin <dberlin at dberlin dot org>, Diego Novillo <dnovillo at acm dot org>, gcc at gcc dot gnu dot org
- Date: Mon, 18 Jun 2007 10:37:42 +0200 (CEST)
- Subject: Re: Help in understanding ccp propagator
- References: <OF102961E7.662D9D62-ONC22572FD.0064BE5E-C22572FD.0064CC95@il.ibm.com>
On Sun, 17 Jun 2007, Revital1 Eres wrote:
> Hello,
>
> I have one more question regarding the comment in
> tree-ssa-ccp.c file -
>
>
> /* Note that for propagation purposes, we are only interested in
> visiting statements that load the exact same memory reference
> stored here. Those statements will have the exact same list
> of virtual uses, so it is enough to set the output of this
> statement to be its first virtual definition. */
> *output_p = first_vdef (stmt);
>
> I wonder if this comment is true also if the vuses are not immediate as
> in stmt no. 1 in the following example:
>
> 1) arr[i].x = tmp1;
> ...
> 2) arr[i].y = tmp2;
> ...
> 3) reg1 = arr[i].x;
> ...
> 4) arr[i].z = tmp2;
> ...
> 5) reg2 = arr[i].x;
>
> Is it because we are looking for the exact same memory reference (although
> not immediate) it is enough to look at only first_vdef of every store we
> encounter in our walk through the virtual def-use chain; or by looking
> only at the first vdef we could miss vuses that could have been reached
> by vdefs other than the first one?
Well, in the current code we do not walk virtual use-def chains, but make
sure all virtual operands are the same. So the above works. If you
walk the chains you need to make sure that all virtual operands of the
final def you are using are the same - then the above will work again.
Richard.