This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Higher level RTL issues
- To: Daniel Berlin <dan at cgsoftware dot com>
- Subject: Re: Higher level RTL issues
- From: Daniel Berlin <dan at cgsoftware dot com>
- Date: Mon, 22 Oct 2001 17:28:20 -0400
- Cc: law at redhat dot com, dnovillo at redhat dot com, gcc at gcc dot gnu dot org
On Monday, October 22, 2001, at 05:25 PM, Daniel Berlin wrote:
>
> On Monday, October 22, 2001, at 05:04 PM, law@redhat.com wrote:
>
>> In message <BF0CB0D7-C728-11D5-9F25-0030657B5340@cgsoftware.com>you
>> write:
>>>> So how is this done when SSA names are not reflected in the IR?
>>> You can do the same thing.
>>> You just need names.
>>
>>> If you look at the ssa-ccp patch i submitted, you'll note i added a
>>> unique id number to each ref, and use it in the following way to give
>>> an
>>> ssa name:
>>> For a phi or a def, the ssa name is the id number.
>>> For a use, the ssa name is the id number of the associated def.
>>> This gives you the same "name" an explicit renamed representation
>>> would
>>> give you, but we still haven't rewritten any code.
>> Right, but whenever you make this kind of transformation you have to
>> scrurry
>> around and find all the uses the update the id number to point to the
>> new
>> def.
> None that you wouldn't have to do anyway, since you need to update the
> use's chain to point to the new def anyway. The ID number is part of
> the def/use structure, so doing the required update makes it work.
> Though i think this is what you meant, i'm just having a bit of trouble
> parsing your sentence. Criminal law class does it to me.
> Remember, we have all the uses for a def, too, so when you remove the
> def, you can just automatically update all the uses to the new def
> pretty simply (since, in the case of dominator optimizations, we know
> which def is the new one).
Scratch that, i forgot you are talking about dominator optimizations
done *before* we build the links.
I was thinking of doing it as a value numbering pass once we *had* ssa
form.
In the case of doing it coming into ssa form, it would certainly be a
pain in the ass.
>
>
>
>> Ugh. How unpleasant. The beauty of a rewriting SSA is it just works.
>>
> It's not actually as unpleasant as one might think, because all the
> updating can be done in replace_expr_in_tree, without *too* much
> trouble.
> So from a programming perspective, it's quite possible to make it so it
> is never seen by the ssa passes.
>
>
>>> I'm assuming you keep the definitions/uses/phi links updated
>>> approriately, which is where the real pain lies.
>> No need for this kind of bookkeeping since the dominator opts happen
>> before we build those links.
>>
>> jeff
>>
>