[tree-ssa] Lazy updating of stmt operands
Andrew MacLeod
amacleod@redhat.com
Wed Dec 17 00:21:00 GMT 2003
On Tue, 2003-12-16 at 17:20, Zdenek Dvorak wrote:
> Hello,
>
> > > > defining stmt's annotation, so given any SSA variable, you can get to
> > > > the immediate uses by looking at the annotation for SSA_NAME_DEF_STMT.
> > > > It needs a marginal extention to deal with the fact that there can be
> > > > multiple defs/vdefs on one stmt, but we need to do that to handle
> > > > virtual defs anyway. I would prefer to keep this information right with
> > > > the stmt rather than in a table on the side.
> > >
> > > Immediate use is not a property of the statement, but the property of
> > > the ssa name; so it should be in the SSA_NAME, as my patch does,
> > > not in the statement annotations.
> >
> > After pondering it, I have concluded you are correct, the immediate uses
> > info should be attached to the SSA_NAME. The pragmatic reason is that
> > it eliminates the need to have the def stmt of the SSA_NAME in place
> > before the uses are seen...
> >
> > ie, keeping the information accurate when you are adding a new ssa_name
> > would *require* you to create the DEF first, or you have no place to put
> > the uses information. Although its probably good practice to issue the
> > DEF first, enforcing that is pretty lame. Putting it in the SSA_NAME
> > resolves ths problem since the SSA_NAME must exist in order to actually
> > occur in the stmt :-).
>
> my reason for having the information stored in the SSA_NAME actually
> was that there may be multiple definitions in a single statement,
> thus making it necessary to somehow determine of which of them is used
> in the statement recorded as the immediate use; this would be extremely
> cumbersome.
>
I would have just associated it with the new operand infrastructure..
ie, you ask for the immediate uses info for a def index or vdef index,
since we have that index info available easily. It was maintaining it
that was the clincher for me.
Andrew
More information about the Gcc
mailing list