Re: x86 register allocation

bcombee@metrowerks.com (Ben Combee)
28 Mar 1999 17:02:26 -0500

          From comp.compilers

Related articles
x86 register allocation dplass@yahoo.com (1999-03-23)
Re: x86 register allocation dwight@pentasoft.com (1999-03-28)
Re: x86 register allocation rsherry@home.com (Robert Sherry) (1999-03-28)
x86 register allocation postiffm@umich.edu (Matt Postiff) (1999-03-28)
Re: x86 register allocation bcombee@metrowerks.com (1999-03-28)
Re: x86 register allocation sander@haldjas.folklore.ee (Sander Vesik) (1999-03-28)
Re: x86 register allocation cbrtjr@ix.netcom.com (Charles E. Bortle, Jr.) (1999-03-28)
| List of all articles for this month |

From: bcombee@metrowerks.com (Ben Combee)
Newsgroups: comp.compilers
Date: 28 Mar 1999 17:02:26 -0500
Organization: Metrowerks
References: 99-03-080
Keywords: 386, registers

dplass@yahoo.com wrote:
> Can anyone give me a pointer to help me with x86 register
> allocation?


The approach we take in CodeWarrior/x86 is pretty simple:


1) Generate code, using virtual registers for most things, but
explicit register references when required by the instruction set.


2) Do lifetime analysis for all variables and temporaries. Treat an
explicit reference as a temporary live for one instruction and already
bound to a register.


3) Starting with that as your begin point, use a standard register
coloring algorithm, such as a weighted graph coloring.


I agree with John that this works better on the more orthogonal
386-based architecture. Weighting is very important -- you really
don't want something with a long lifetime getting put in a register
and forcing your loop variables out into memory.


--
Ben Combee <bcombee@metrowerks.com> -- x86/Win32/NetWare CompilerWarrior


Post a followup to this message

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