[Top][All Lists]

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

Re: [Lightning] Register liveness analysis and spilling

From: Marc Nieper-Wißkirchen
Subject: Re: [Lightning] Register liveness analysis and spilling
Date: Mon, 04 Sep 2017 09:38:20 +0000

Would it make sense, for example, to expose the functions jit_get_reg and jit_unget_reg to user code?

Marc Nieper-Wißkirchen <address@hidden> schrieb am So., 3. Sep. 2017 um 17:18 Uhr:
When generating lightning instructions from higher level code, scratch registers are sometimes needed (for example, to code a move from memory to memory).

The generating code could analyze which registers do not contain live data and use those as scratch registers (if there are none, it has to spill some registers).

Browsing through the lighting source code it seems that lightning already contains some liveness analysis and some spilling algorithm. It would be great if some interface to this could be offered to user code, for example by offering two "virtual registers" that are emulated by overlaying them to real registers (that are either dead or spilled during the live time of the virtual registers).

On some ports, e.g. the AMD64 port, these virtual registers could, in fact, be real registers like RSI or RDI most of the time, which are usually only used for arguments to C procedure calls, and are wasted otherwise.


reply via email to

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