[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Optimizing code for expressions

From: Laurent DESNOGUES
Subject: Re: [Tinycc-devel] Optimizing code for expressions
Date: Wed, 9 Jul 2003 14:48:47 +0200

Fabrice wrote:

> I would prefer writing the code generator from scratch, at least to
> learn, as I never wrote a register allocator.

   The difficulty is that a multi-target register allocator
may not be the most efficient:  most RISC compilers use some
variant of graph coloring (NP complete problem so heuristics
have to be used) whereas icc uses some other technics due to
low number of registers on x86.  Definitely a *very*
interesting field!

Jim wrote:

> Otherwise you have to allocate registers once,
> then reallocate them later on.

   Nothing prevents you from using a pseudo RISC with an
infinite number of registers.  This is indeed done by several
assemblers:  ti c6x assembler, and ps2 VU assembler vcl.
Both have the register allocator in the assembler.

   I don't think using a real RISC ISA is the way to go and I
*guess* Fabrice had a "generic" 3 address ISA in mind, not a
concrete one (I am often wrong at guessing ;).

   Regarding the stack-based IL, I used a compiler kit (ACK,
Amsterdam Compiler Kit) with a back-end generator.  The IL,
named em, was a stack-based IL.  The main thing I remember
from this time was the high complexity of the em optimizer...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]