This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ipa-branch] Transforming IPCP to SSA
- From: Razya Ladelsky <RAZYA at il dot ibm dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, hubicka at ucw dot cz, jh at suse dot cz
- Date: Sun, 19 Feb 2006 12:59:40 +0200
- Subject: Re: [ipa-branch] Transforming IPCP to SSA
Diego Novillo <dnovillo@redhat.com> wrote on 18/02/2006 00:26:18:
>
> Last time I checked this patch, it was just adding a constant assignment
> at the start of the function and allow the intraprocedural CCP deal with
it.
>
> How about secondary side-effects? I believe those are the potentially
> interesting ones to handle. The patch does not try to integrate inter
> and intra procedural CCP, so it wouldn't see things like this
> (admittedly contrived) example:
>
> baz (int x)
> {
> ...
> }
>
> foo (int i)
> {
> int j;
>
> if (i > 0)
> j = i * 2;
> else
> j = i + 2;
>
> baz (j);
> }
>
> main ()
> {
> foo (2);
> }
>
> In principle IPCP would not version baz(), right? But, if you do
> version foo(), will we realize that we *always* call baz with x == 4?
No, we won't.
As you said, this requires interleaving of inter and intra procedural CCP.
This is not done currently.
Thanks,
Razya