Changes between Version 11 and Version 12 of Commentary/Compiler/NewCodeGenStupidity


Ignore:
Timestamp:
Apr 8, 2011 9:22:40 PM (3 years ago)
Author:
ezyang
Comment:

add notes about inlining memory accesses

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/NewCodeGenStupidity

    v11 v12  
    5656 
    5757We see that these temporary variables are being repeatedly rewritten to the stack, even when there are no changes. 
     58 
     59Since these areas on the stack are all old call areas, one way to fix this is to inline all of the memory references. However, this has certain undesirable properties for other code, so we need to be a little more clever. The key thing to notice is that these accesses are only used once per control flow path, in which case sinking the loads down and then inlining them should be OK (it will increase code size but not execution time.) However, the other difficulty is that the CmmOpt inliner, as it stands, won't inline things that look like this because although the variable is only used once in different branches, the same name is used, so it can't distinguish between the temporaries with mutually exclusive live ranges. Building a more clever inliner with Hoopl is also a bit tricky, because inlining is a forward analysis/transformation, but usage counting is a backwards analysis. 
    5860 
    5961== Spilling Hp/Sp ==