• Andreas Klebinger's avatar
    Add loop level analysis to the NCG backend. · 535a88e1
    Andreas Klebinger authored
    For backends maintaining the CFG during codegen
    we can now find loops and their nesting level.
    
    This is based on the Cmm CFG and dominator analysis.
    
    As a result we can estimate edge frequencies a lot better
    for methods, resulting in far better code layout.
    
    Speedup on nofib: ~1.5%
    Increase in compile times: ~1.9%
    
    To make this feasible this commit adds:
    * Dominator analysis based on the Lengauer-Tarjan Algorithm.
    * An algorithm estimating global edge frequences from branch
    probabilities - In CFG.hs
    
    A few static branch prediction heuristics:
    
    * Expect to take the backedge in loops.
    * Expect to take the branch NOT exiting a loop.
    * Expect integer vs constant comparisons to be false.
    
    We also treat heap/stack checks special for branch prediction
    to avoid them being treated as loops.
    535a88e1
Name
Last commit
Last update
..
Hoopl Loading commit data...
Bitmap.hs Loading commit data...
BlockId.hs Loading commit data...
BlockId.hs-boot Loading commit data...
CLabel.hs Loading commit data...
Cmm.hs Loading commit data...
CmmBuildInfoTables.hs Loading commit data...
CmmCallConv.hs Loading commit data...
CmmCommonBlockElim.hs Loading commit data...
CmmContFlowOpt.hs Loading commit data...
CmmExpr.hs Loading commit data...
CmmImplementSwitchPlans.hs Loading commit data...
CmmInfo.hs Loading commit data...
CmmLayoutStack.hs Loading commit data...
CmmLex.x Loading commit data...
CmmLint.hs Loading commit data...
CmmLive.hs Loading commit data...
CmmMachOp.hs Loading commit data...
CmmMonad.hs Loading commit data...
CmmNode.hs Loading commit data...
CmmOpt.hs Loading commit data...
CmmParse.y Loading commit data...
CmmPipeline.hs Loading commit data...
CmmProcPoint.hs Loading commit data...
CmmSink.hs Loading commit data...
CmmSwitch.hs Loading commit data...
CmmType.hs Loading commit data...
CmmUtils.hs Loading commit data...
Debug.hs Loading commit data...
MkGraph.hs Loading commit data...
PprC.hs Loading commit data...
PprCmm.hs Loading commit data...
PprCmmDecl.hs Loading commit data...
PprCmmExpr.hs Loading commit data...
SMRep.hs Loading commit data...
cmm-notes Loading commit data...