[GHC] #15056: Wrappers inlined too late

GHC ghc-devs at haskell.org
Fri Apr 20 16:08:13 UTC 2018


#15056: Wrappers inlined too late
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Simon Peyton Jones <simonpj@…>):

 In [changeset:"8b10b8968f25589b1857f12788fc79b3b142c467/ghc"
 8b10b896/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="8b10b8968f25589b1857f12788fc79b3b142c467"
 Inline wrappers earlier

 This patch has a single significant change:

   strictness wrapper functions are inlined earlier,
   in phase 2 rather than phase 0.

 As shown by Trac #15056, this gives a better chance for RULEs to fire.
 Before this change, a function that would have inlined early without
 strictness analyss was instead inlining late. Result: applying
 "optimisation" made the program worse.

 This does not make too much difference in nofib, but I've stumbled
 over the problem more than once, so even a "no-change" result would be
 quite acceptable.  Here are the headlines:

 --------------------------------------------------------------------------------
         Program           Size    Allocs   Runtime   Elapsed  TotalMem
 --------------------------------------------------------------------------------
       cacheprof          -0.5%     -0.5%     +2.5%     +2.5%      0.0%
          fulsom          -1.0%     +2.6%     -0.1%     -0.1%      0.0%
            mate          -0.6%     +2.4%     -0.9%     -0.9%      0.0%
         veritas          -0.7%    -23.2%     0.002     0.002      0.0%
 --------------------------------------------------------------------------------
             Min          -1.4%    -23.2%    -12.5%    -15.3%      0.0%
             Max          +0.6%     +2.6%     +4.4%     +4.3%    +19.0%
  Geometric Mean          -0.7%     -0.2%     -1.4%     -1.7%     +0.2%

 * A worthwhile reduction in binary size.

 * Runtimes are not to be trusted much but look as if they
   are moving the right way.

 * A really big win in veritas, described in comment:1 of
   Trac #15056; more fusion rules fired.

 * I investigated the losses in 'mate' and 'fulsom'; see #15056.
 }}}

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


More information about the ghc-tickets mailing list