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: [tree-ssa] reaching def. question


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).

That would be my recommendation.  You won't get NULL, but a's default
def, which amounts to the same thing.

If you want to work hard, you'll need to duplicate the dominator walk
done by the SSA renamer (not really worth it, unless you can prove that
the extra call to the renamer is killing compile time performance).


Diego.


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