This is the mail archive of the
mailing list for the GCC project.
Re: Higher level RTL issues
- From: Diego Novillo <dnovillo at redhat dot com>
- To: law at redhat dot com
- Cc: dan at cgsoftware dot com, gcc at gcc dot gnu dot org
- Date: Thu, 22 Nov 2001 22:56:32 -0500
- Subject: Re: Higher level RTL issues
- Organization: Red Hat Canada
- References: <firstname.lastname@example.org>
[ Apologies for joining so late. I've been away for a month. ]
On Mon, 22 Oct 2001, Jeff Law wrote:
> So how is this done when SSA names are not reflected in the IR? I have
> ideas, but I'd like to hear from someone with more experience in the
> non-rewriting camp. You certainly can't do the naive thing and drop the
> SSA names in favor of the original names.
In the non-rewriting SSA there are no names to drop. There is no
SSA->normal translation because the SSA data structure is simply
laid on top of the flow graph.
However, eliminating redundancy does force you to update the SSA
web. The work you have to do is similar to the work you would do
manipulating the SSA names.
> When we reach insn 458, we lookup (sign_extend:DI (reg:SI 343)) and we
> get (reg:DI 444). Cool. That means insn 458 is redundant. Delete it.
> Do some manipulation of our renaming stacks to arrange for uses of
> (reg:DI 617) to be rewritten as (reg:DI 444). The only uses of
> (reg:DI 617) are at insn 765.
The above transformation in the non-rewriting SSA goes like this:
When you decide to eliminate insn 458, instead of doing a
manipulation of the renaming stacks, you just manipulate the
use-def and def-use links between the def of r344 at bb 18 and
the phi term for r344 at bb 23.
This is the original phi term:
(insn 765 744 276 (set (reg:DI 603)
(const_int 22 [0x16])
(const_int 21 [0x15])
(const_int 20 [0x14])
(const_int 19 [0x13])
(const_int 16 [0x10])
(const_int 9 [0x9])
(const_int 7 [0x7])
] )) -1 (nil)
In this case, all the arguments for r617 are actually pointers to
the definition for r344 at insn 458. Since insn 458 is being
removed, you simply make those use-def links point to the
definition for r444 in insn 305. This operation is akin to
manipulating the renaming stacks you have to do in the rewriting