[GHC] #6087: Join points need strictness analysis

GHC cvs-ghc at haskell.org
Wed Mar 20 19:31:06 CET 2013


#6087: Join points need strictness analysis
---------------------------------+------------------------------------------
    Reporter:  simonpj           |       Owner:                         
        Type:  bug               |      Status:  new                    
    Priority:  normal            |   Milestone:  7.6.2                  
   Component:  Compiler          |     Version:  7.4.1                  
    Keywords:                    |          Os:  Unknown/Multiple       
Architecture:  Unknown/Multiple  |     Failure:  Runtime performance bug
  Difficulty:  Unknown           |    Testcase:                         
   Blockedby:                    |    Blocking:                         
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by nfrisby):

 A second demand analysis at the end of the pipeline does help here.

 {{{
                  let {
                     $j_sRv [Dmd=<C(C(S)),U>]
                       :: GHC.Types.Int
                          -> GHC.Types.Int
                          -> [KnightHeuristic.Direction]
 }}}

 {{{
     Entries     Allocs    Alloc'd Arity    Kinds      Function
 --------------------------------------------------------------------------------
        6003      51444       1334      1    L          go{v s12q}
 (main:KnightHeuristic)
        5336      24190          0      2    SS         $j{v s12J}
 (main:KnightHeuristic)
 }}}

 becomes

 {{{
        6003      24764       1334      1    L          go{v s187}
 (main:KnightHeuristic)
        5336      31464          0      2    iS         $w$j{v s18r}
 (main:KnightHeuristic)
 }}}

 This is ~ -7% overall change in allocation.

 At O2 (and without my more precise ticky numbers), the opportunity for
 this improvement gets a bit clobbered, but others apparently show up.

 {{{
         567      20851      1     0    L          go{v s1Ba}
 (main:KnightHeuristic)
         400       5200      2     0    ET
 main:KnightHeuristic.move{v rfN}
         110       2274      5     0    SSiSL
 main:KnightHeuristic.$wdescendents{v r1qa}
         168       1002      1     0    S
 main:KnightHeuristic.descAndNo{v rfU}
 }}}

 becomes

 {{{
         567      18204      1     0    L          go{v s1MK}
 (main:KnightHeuristic)

         111        872      5     0    SSiSL
 main:KnightHeuristic.$wdescendents{v r1Cl}
         169        835      4     0    SSTL
 main:KnightHeuristic.$wdescAndNo{v r1Cp}
 }}}

 For -3.8% allocation.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6087#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list