Changes between Version 5 and Version 6 of Commentary/Compiler/NewCodeGenStupidity


Ignore:
Timestamp:
Mar 23, 2011 1:54:44 PM (4 years ago)
Author:
ezyang
Comment:

fixed one issue

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/NewCodeGenStupidity

    v5 v6  
    77Lots of temporary variables (these can tickle other issues when the temporaries are long-lived, but otherwise would be optimized away). You can at least eliminate some of them by looking at the output of `-ddump-opt-cmm`, which utilizes some basic temporary inlining when used with the native backend `-fasm`, but this doesn't currently apply to the GCC or LLVM backends. 
    88 
    9 At least one major culprit for this is `allocDynClosure`, described in Note `Return a LocalReg`; this pins down the value of the `CmmExpr` to be something for one particular time, but for a vast majority of use-cases the expression is used immediately afterwards. Actually, this is mostly my patches fault, because the extra rewrite means that the inline pass is broken. 
     9<s>At least one major culprit for this is `allocDynClosure`, described in Note `Return a LocalReg`; this pins down the value of the `CmmExpr` to be something for one particular time, but for a vast majority of use-cases the expression is used immediately afterwards. Actually, this is mostly my patches fault, because the extra rewrite means that the inline pass is broken.</s> Fixed in latest version of the pass; we don't quite manage to inline enough but there's only one extra temporary. 
    1010 
    1111== Rewriting stacks == 
     
    100100        I32[Hp - 4] = _B2::I32; 
    101101        I32[Hp + 0] = _B1::I32; 
    102         _c7J4::I32 = Hp - 8; 
    103         _c7J4::I32 = _c7J4::I32 + 1; 
     102        _c7J4::I32 = Hp - 7; 
    104103        R1 = _c7J4::I32; 
    105104        Sp = Sp - 4; 
     
    146145 - We do an unnecessary stack check on entry to this function 
    147146 - Sp should be bumped before the stack check (but we need this fishy code due to ncg spilling before the check) 
    148  - The `R1` assignment is silly (although that's my fault; I should probably fix up the offending patch) 
    149147 - Sp is getting bumped too much, and then being adjusted back down again