This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] reaching def. question
- From: law at redhat dot com
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: Devang Patel <dpatel at apple dot com>, "gcc at gcc dot gnu dot org list" <gcc at gcc dot gnu dot org>
- Date: Tue, 16 Mar 2004 16:42:20 -0700
- Subject: Re: [tree-ssa] reaching def. question
- Reply-to: law at redhat dot com
In message <1079475458.3173.461.camel@localhost.localdomain>, Diego Novillo wri
tes:
>On Tue, 2004-03-16 at 16:59, Devang Patel wrote:
>
>> S1: a_1 = x;
>> S2: if (...)
>> S3: a_2 = b;
>>
>> Now, to if-convert S3, I need to know if a_2 is first def. of variable
>> 'a'
>> or not. Based on that info I can replace S3 with
>>
>> S3: MODIFY_EXPR <a_2, COND_EXPR < c, b, a_1>>
>>
>> OR
>>
>> S3: MODIFY_EXPR <a_2, COND_EXPR < c, b, NULL>>
>>
>Hmm, you could always if-convert S3 to MODIFY_EXPR <a, COND_EXPR <c, b,
>a>> and then mark 'a' for rewriting. After if-conversion, the renamer
>will correctly pick up a_1 or a_0 (ie, a's default definition).
It seems to me that to do that he must first take the affected variables
out of SSA form. Otherwise how does the renamer know which instance of
"a" ought to be used?
jeff