This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC][PATCH] Extend store ccp
- From: Diego Novillo <dnovillo at google dot com>
- To: Revital1 Eres <ERES at il dot ibm dot com>
- Cc: Daniel Berlin <dberlin at dberlin dot org>, gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Tue, 19 Jun 2007 16:35:56 -0400
- Subject: Re: [RFC][PATCH] Extend store ccp
- References: <OFE835C8E8.AB0603C8-ONC22572FF.00668BC7-C22572FF.0069B275@il.ibm.com>
On 6/19/07 3:14 PM, Revital1 Eres wrote:
>>> +static bool
>>> +do_store_ccp (void)
>>> +{
>>> + return (flag_tree_store_ccp != 0);
>>> +}
>> No. This will return 'true' every time we run CCP. We only want this
>> to return 'true' when flag_tree_store_ccp is set *and* we are running
>> pass_store_ccp.
>
> This relates to the comment I posted in the original message regarding
> the extra parameter
But the extra parameter was in the final replacement routines, wasn't
it? If it wasn't, then I misunderstood the problem you were describing,
sorry.
> the problem is I do not know how to check what pass
> currently running. I did not find a similar example.
OK, so what we need to do is for the propagator to be able to query the
client before doing the expensive check. One thing I forgot to mention
in my initial reply is that we may want to use this new code for
copy-propagation as well.
So, when we are in the propagator, we are interested in whether the
client code wants to do the use-def traversals (i.e., when the client is
operating on stores). One thing we could do is add a flag to the
propagator's initialization routine. The caller would set this flag to
true when it's interested in follow use-def chains for stores.
> I took this comment from add_ssa_edge () function so for consistency
> reasons it might stay lhs.
OK, but it still needs fixing. LHS is an acronym.
>>> + /* For now just handle a distance of one. If the RHS of the
> DEF
>>> + is another ref, we could recurse here.
>>> + ??? Recurse here? */
>> A distance of one? What do you mean in this comment?
>
> Actually I took this comment from Richard's code... I guess it refers
> to a recursive propgation of constants, for example -
>
> 1) *p = 5;
> ...
> 2) a[i] = *p;
> ...
> 3) x = a[i];
>
> Visiting stmt 3 we walk to it's definition in stmt 2 and because it's
> rhs is also a ref we recursively find it's def stmt to propagate 5.
> It seems this comment is redundant as it's the propagator job to take
> care of such propagation...
Yes, it wouldn't make sense to do this here. Richard, do you remember
what you had in mind?