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]

Re: Debugging data on Alpha


On Fri, Dec 29, 2000 at 09:47:32AM -0700, Jeffrey A Law wrote:
> You'd have to generate new REG objects during register renaming so that you
> can have multiple instances of the original user variable in different hard
> regs.  Then you could walk over all the REG objects you created to build
> the map.  Ugh.  There's got to be something better.

Probably not, since what you want to build is a set of possibly
overlapping ranges for each DECL.  Don't forget we'll also want
to represent when the DECL lives on the stack as well.  Moreover,
you probably want to evaluate these lifetimes at line number notes
only -- no sense tracking every intermediate change.

> For LRS you typically have multiple pseudos for what was originally a single
> pseudo, so it's a similar problem.  We keep track of the mapping by having
> a special note which holds the map (and the begin/end notes mark the region
> in which the map is valid).

I very much dislike how we implemented this for LRS.  Those notes
remap lots of registers simultaneously, and constrain them all to
the same begin/end notes, and can't represent overlapping ranges.

> I thought the original idea behind using that field to hold the original
> pseudo # was related to your next reload revamp somehow (I've forgotten
> how though).

I don't recall who first proposed it.

I'd been thinking of using something like that on IA-64 to determine
if a particular post-reload register _really_ needed to be call-saved
or not.  At present we arbitrarily split the 96 register window into 
8 inputs (call saved) 8 outputs (call clobbered) and 80 local (call
saved).  So of the 128 general regs, the compiler thinks about 30 of
them are call clobbered.  If we use those up, we start allocating
call-saved registers.

But that division is completely arbitrary.  Suppose somehow we knew
which of those 80 local registers were never live across calls.  In
that case we could have the prologue generation code arrange for
those locals to be allocated in the portion of the register window
that is call clobbered.  This would share more registers between
caller and callee and spill fewer registers to the stack.

One might be able to figure out if a hard register was live across
calls by iterating over regno_reg_rtx and summing REG_N_CALLS_CROSSED
for each hard register found there.

On the other hand, you do have use up 30 call-clobbered registers
before this can even take effect, so this probably isn't really
much of a win.


r~

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