Re: x86 register allocation (Ben Combee)
28 Mar 1999 17:02:26 -0500

          From comp.compilers

Related articles
x86 register allocation (1999-03-23)
Re: x86 register allocation (1999-03-28)
Re: x86 register allocation (Robert Sherry) (1999-03-28)
x86 register allocation (Matt Postiff) (1999-03-28)
Re: x86 register allocation (1999-03-28)
Re: x86 register allocation (Sander Vesik) (1999-03-28)
Re: x86 register allocation (Charles E. Bortle, Jr.) (1999-03-28)
| List of all articles for this month |

From: (Ben Combee)
Newsgroups: comp.compilers
Date: 28 Mar 1999 17:02:26 -0500
Organization: Metrowerks
References: 99-03-080
Keywords: 386, registers 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 <> -- x86/Win32/NetWare CompilerWarrior

Post a followup to this message

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