This is the mail archive of the 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: Higher level RTL issues

[ 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)
                (reg:DI 617)
                (const_int 22 [0x16])
                (reg:DI 617)
                (const_int 21 [0x15])
                (reg:DI 617)
                (const_int 20 [0x14])
                (reg:DI 617)
                (const_int 19 [0x13])
                (reg:DI 614)
                (const_int 16 [0x10])
                (reg:DI 607)
                (const_int 9 [0x9])
                (reg/v:DI 344)
                (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


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