Compiler Terminology

"Pallav Gupta" <pgupt@ece.arizona.edu>
4 Jul 2002 23:18:35 -0400

          From comp.compilers

Related articles
Compiler Terminology pgupt@ece.arizona.edu (Pallav Gupta) (2002-07-04)
Re: Compiler Terminology peter_flass@yahoo.com (Peter Flass) (2002-07-15)
Re: Compiler Terminology journeyman@compilerguru.com (journeyman) (2002-07-15)
| List of all articles for this month |
From: "Pallav Gupta" <pgupt@ece.arizona.edu>
Newsgroups: comp.compilers
Date: 4 Jul 2002 23:18:35 -0400
Organization: The University of Arizona
Keywords: question, storage
Posted-Date: 04 Jul 2002 23:18:35 EDT

I have some generic compiler termilogy questions. I'm reading about
register usage between function calls in a program.


I see three terms that describe how registers are to be used:


1. clobbered list
2. used list
3. args list


Furthermore the restriction is clobbered list must be a subset of used
list while args list should be a subset of the clobbered list.


Now my understanding is that between a function call, the compiler
should generally save/restore ALL registers that the callee function
uses. Correct? (Ofcourse there can be some global registers that need
not be saved/restored say for instance the stack pointer)


The args list specifies (I think) the registers to be used in giving
the argumetns to the function. What's the purpose of the clobbered
list? It seems like this list tells teh calle function which registers
it can use as scratch registsers (for computation within the
function).


So say I define the following register usage defintion for a function
(some artifical architecture):


used list: r0-r54
clobbered list: r0-r40
args list: r36-r40


So then if r41-r54 aren't clobbered what will they likely contain?
Constants? or possibily just one assignment and then will never be
used again throughout the rest of the function?


In other words, whats the reason for making the clobbered list a
subset (and not the whole list itself) of the used list?


Also what are the benefits of defining various levels of register
usage? One thing I can think of is the cycles penalty in
saving/restoring all registers to memory and back.


thanks for yoru time.
pallav


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.