summary refs log tree commit diff
path: root/load.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2017-05-16 11:47:46 -0400
committerQuentin Carbonneaux <quentin@c9x.me>2017-05-16 11:47:46 -0400
commit2d02070af019e9896ecf2a63bedc098092fd395d (patch)
tree271a290f21b812b060abcca5744d97c7818aac7d /load.c
parent436d0fc07e4551dd4265cfed0b0bc459c71ed8ce (diff)
downloadroux-2d02070af019e9896ecf2a63bedc098092fd395d.tar.gz
new hinting in the register allocator
The previous heuristics were ad hoc and it was
hard to understand why they worked at all.

This patch can be summarized in three points:

 1. When a register is freed (an instruction
    assigns it), we try to find if a temporary
    would like to be in it, and if we find one,
    we move it in the newly freed register.
    I call this an "eager move".

 2. Temporaries now remember in what register
    they were last allocated; this information
    is stored in the field Tmp.visit, and
    prevails on the field Tmp.hint when it is
    set.  (This makes having the same hint for
    interfering temporaries not so disastrous.)

 3. Blocks are now allocated in "onion" order,
    from the innermost loop to the outermost.
    This is the change I am the least sure
    about; it should be evaluated thorougly.
Diffstat (limited to 'load.c')
0 files changed, 0 insertions, 0 deletions