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]: Easy way to get default def of a variable?


On Thu, 2003-06-05 at 11:37, Daniel Berlin wrote:
> 
> On Thursday, June 5, 2003, at 07:21  AM, Andrew MacLeod wrote:
> 
> > On Thu, 2003-06-05 at 00:38, Daniel Berlin wrote:
> >>>>
> >>>>
> >>> We now connect them to empty_stmt_expr.  Do you want to connect them 
> >>> to
> >>> this table so that we can traverse that table to look for live-
> >>> on-entry
> >>> or uninitialized uses?  I guess we could do that.
> >>
> >> Well, remember, i want the table because right now i have to take a
> >> use, and walk the entire def chain backwards, to get the default def's
> >> version.
> >> This is expensive.
> >>
> >
> > Out of curiosity, why do you need the default def?  ie, why do you care
> > that a_2 is live on entry when you have a_4 = a_3 + 2, and a_3 has a
> > def?
> 
> There are cases where we need to insert *before* the first "real" 
> definition of a variable.
> They are the odd corner case, but it happens.
> One is when we move things out of loops, need to generate a save before 
> the beginning of the loop, and the only definition (of one of the 
> variables in our expression) on entry to the loop is the default one 
> coming from a function argument.
> To insert the save before the loop, we need the default def (of that 
> variable).


If your variable is a_5, and its live on entry to the loop, ie, having
no DEF, couldn't you issue the save as
  pretmp_99 = a_5
and say to heck with the def?

Andrew


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