Changes between Version 50 and Version 51 of Internships/JanStolarek

Oct 8, 2013 9:34:49 AM (4 years ago)



  • Internships/JanStolarek

    v50 v51  
    11= Jan Stolarek's internship notes =
    3 = Wise people say... =
    5 Austin Seipp:
    6   - i took the time to implement a half-assed almost-working loopification pass a few months ago. the sinking pass by Simon is what really does a huge amount of the optimizations Kryzsztof's thesis attacked differently. but i think doing loopification could maybe lead to identifying things like loop invariant expressions. it can't bootstrap the compiler with it (JS: it = Austin's patch). i think whenever i tie the knot in the new graph, i don't abandon parts of the old !CmmNode, which then causes dead labels to hang around
    7   - oh, yeah, and as i noted in the commit message, you have to be careful when ordering those optimizations around. this is obviously only a valid transform pre-CPS. also you have to run a block elimination passes, otherwise things can happen where work can get duplicated into empty blocks
    8   -  i think another problem is that the new codegen doesn't always discard empty basic blocks which pisses off the native code generator (see #7574 ) so we need a little refactoring to handle that correctly, too, by being able to do SCC passes from any particular node
    9   - i think that the fix for #7574 is probably pretty easily actually, it just requires shuffling things around. oh, and to be clear it's not *empty* basic blocks, it's *unreachable* basic blocks that make the codegen mad
    11 Simon Marlow:
    12   - !CmmSink removes dead assignments (though not in loops), which is why it's commented out.  A single removeDeadAssigments pass costs about 5% of compilation time, and in the vast majority of code does nothing over what !CmmSink already does.
    13   - '''PLEASE make sure that you're carefully measuring compilation time when making changes to the code generator'''.  Expensive optimisations need to go in -O2 (at least).
    153= Back-end notes =
    16 == Various notes to self ==
    17   * Does it make sense to create a separate flag for every Cmm optimisation I add? After all they are designed to work together
    18   * I need to remember to cerfully choose at which optimization levels my Cmm passes are enabled
    19   * Here's an interesting bit from `CoreToStg.lhs`: "a dead variable's stack slot (if it has one): should be stubbed to avoid space leaks"
    20   * During stack layout phase we generates stores of variables live across calls. This could lead to potentially unnecessary stores and loads. The question is whether we avoid that? If we do then how do that?
    225== Some interesting tickets ==
    4124  * [ cmm-notes]
    43 = Various clean-up tasks =
    44 == Cmm clean-up ==
    45   * remove unused !CmmRewriteAssignments
    46   * `cmm/CmmLive.hs:106`. This function is not used:
    48 {{{
    49 removeDeadAssignments :: DynFlags -> CmmGraph
    50                       -> UniqSM (CmmGraph, BlockEnv CmmLocalLive)
    51 }}}
    52 It is however referenced in some of the comments. I might be able to use it for my dead assignment removal. Simon PJ notes: ", we want to eliminate dead assignments to stack locations too, so the liveness info need to be augmented with stack areas.
    53 "
    54   * Cmm dumping could be improved. Right now it dumps all optimisation passes for one fragment of Cmm code, then for next fragment and so on. It would be more convinient to dump whole Cmm code after each pass. I'm not sure if that's possible with the current pipeline design. It seems that Stg->Cmm pass is intentionally design to produce Cmm code incrementally (via Stream) and I suspect that this might be the reason why the code is processed incrementally.
    55   * Simon M. says: The !CmmSink pass before stack layout is disabled because I never got around to measuring it to determine whether it is a good idea or not. By all means do that!
    5726= Various stuff =
    5827Tickets that I could potentially look into: