Changes between Version 31 and Version 32 of PIRCDevelopment

Show
Ignore:
Timestamp:
08/13/09 12:45:15 (12 years ago)
Author:
kjs
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PIRCDevelopment

    v31 v32  
    402402In this case, {{{$I0}}} lives from 0 to 1, whereas {{{$1}}} lives from 2 to 3. Since they do not overlap, these variables can share a register. This can be calculated by the algorithm described in the above mentioned paper. These details will not be discussed here; instead the reader is referred to the paper. 
    403403 
    404 Now you know the basic working and purpose of the register optimizer, let's look at the implementation. Following the design principle of PIRC to be as modular as possible, the register optimizer's state is stored in a struct. A new [source:/trunk/compiler/pirc/src/pirregalloc.h#L66 lsr_allocator] object (lsr stands for Linear Scan Register) can be created in the function [source:/trunk/compilers/pirc/src/pirregalloc.c#L85 new_linear_scan_register_allocator]. This constructor takes a pointer to the PIRC compiler struct instance. Yes, this does mean it is somewhat dependent on this other object, but it made the implementation somewhat easier. 
     404Now you know the basic working and purpose of the register optimizer, let's look at the implementation. Following the design principle of PIRC to be as modular as possible, the register optimizer's state is stored in a struct. A new [source:/trunk/compilers/pirc/src/pirregalloc.h#L66 lsr_allocator] object (lsr stands for Linear Scan Register) can be created in the function [source:/trunk/compilers/pirc/src/pirregalloc.c#L85 new_linear_scan_register_allocator]. This constructor takes a pointer to the PIRC compiler struct instance. Yes, this does mean it is somewhat dependent on this other object, but it made the implementation somewhat easier. 
    405405The struct keeps a list of all "active" live intervals (one for each variable that's alive).  
    406406