Changes between Version 5 and Version 6 of Commentary/Compiler/Backends/NCG/RegisterAllocator


Ignore:
Timestamp:
Sep 17, 2007 5:35:22 PM (8 years ago)
Author:
guest
Comment:

added hacking/debugging section

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/Backends/NCG/RegisterAllocator

    v5 v6  
    2222 
    2323 
    24  
    2524== References == 
    2625 
    27 If you decide to do some hacking on the register allocator, I would take a look at (at least) these papers first: 
     26If you decide to do some hacking on the register allocator I would take a look at (at least) these papers first: 
    2827 
    2928'''Iterated Register Coalescing'''[[BR]] 
     
    4039 
    4140 
     41== Hacking/Debugging == 
     42 
     43{{{-fasm-lint}}}[[BR]] 
     44Breaking the allocator can result in compiled programs crashing randomly (if you're lucky) or producing the wrong output, which can hard to debug. 
     45When working on the allocator, make sure to always turn on {{{-fasm-lint}}} this will call {{{GraphOps.validateGraph}}} after every spill/color stage. {{{validateGraph}}} checks that all the edges point to valid nodes, that no conflicting nodes have the same color, and if the graph is supposed to be colored then all nodes are really colored. 
     46 
     47The main dump flags are 
     48 
     49 {{{-ddump-asm-regalloc-stages}}}[[BR]] 
    4250 
    4351 
     52 {{{-ddump-asm-stats}}}[[BR]] 
    4453 
     54 
     55 {{{-ddump-asm}}}[[BR]] 
     56  
     57 {{{-ddump-to-file}}}[[BR]] 
     58 
     59 
     60== Possible Improvements == 
     61 
     62 * work lists 
     63 
     64 * spill code 
     65 
     66 * spill candidates 
     67 
     68 * aliasing register sets 
     69 
     70