[GHC] #9476: Implement late lambda-lifting

GHC ghc-devs at haskell.org
Fri Aug 31 10:58:42 UTC 2018


#9476: Implement late lambda-lifting
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  sgraf
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.2
      Resolution:                    |             Keywords:  LateLamLift
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #8763 #13286      |  Differential Rev(s):
       Wiki Page:  LateLamLift       |
-------------------------------------+-------------------------------------

Comment (by sgraf):

 Over the last week, I polished this some more and played around with
 heuristics regarding known and unknown calls. I'm pretty confident the
 transformation can handle every idea outlined in Wiki:LateLamLift. Here
 are is an excerpt from a benchmarks run:

 {{{
 --------------------------------------------------------------------------------
         Program         Allocs    Instrs
 --------------------------------------------------------------------------------
    cryptarithm1          -2.8%     -7.9%
    cryptarithm2          -4.0%     -2.4%
     exact-reals          -2.1%     -0.0%
    k-nucleotide          -0.0%     +2.4%
           kahan          -0.4%     -2.0%
            lcss          -0.1%     -5.8%
            mate          -8.4%     -3.5%
          n-body         -20.2%     -0.0%
          queens         -17.7%     -0.8%
       typecheck          -2.7%     -1.8%
 --------------------------------------------------------------------------------
             Min         -20.2%     -7.9%
             Max          +0.0%     +2.4%
  Geometric Mean          -0.8%     -0.3%
 }}}

 I had to fight with a surprising amount of benchmark wibbles (+-12% in
 instructions, c.f. #15333) related to GC parameters and code layout
 (probably), although I was using cachegrind for measurements. The above
 numbers are from running NoFib with `make EXTRA_RUNTEST_OPTS='-cachegrind
 +RTS -V0 -A128M -H1G -RTS' NoFibRuns=1`.

 I looked at the regression in `k-nucleotide` (+2.4% counted instructions),
 but couldn't reproduce so far.

 I'll probably refactor the one huge module into 2 or 3 smaller ones and
 then prepare a patch.

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


More information about the ghc-tickets mailing list