[GHC] #14152: Float exit paths out of recursive functions

GHC ghc-devs at haskell.org
Sun Oct 29 22:36:09 UTC 2017


#14152: Float exit paths out of recursive functions
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:  (none)
            Type:  task              |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  JoinPoints
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14137 #10918     |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Joachim Breitner <mail@…>):

 In [changeset:"0e953da147c405648356f75ee67eda044fffad49/ghc"
 0e953da1/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="0e953da147c405648356f75ee67eda044fffad49"
 Implement a dedicated exitfication pass #14152

 The idea is described in #14152, and can be summarized: Float the exit
 path out of a joinrec, so that the simplifier can do more with it.
 See the test case for a nice example.

 The floating goes against what the simplifier usually does, hence we
 need to be careful not inline them back.

 The position of exitification in the pipeline was chosen after a small
 amount of experimentation, but may need to be improved. For example,
 exitification can allow rewrite rules to fire, but for that it would
 have to happen before the `simpl_phases`.

 Perf.haskell.org reports these nice performance wins:

     Nofib allocations
     fannkuch-redux    78446640  - 99.92%      64560
     k-nucleotide     109466384  - 91.32%    9502040
     simple            72424696  -  5.96%   68109560

     Nofib instruction counts
     fannkuch-redux  1744331636  -  3.86% 1676999519
     k-nucleotide    2318221965  -  6.30% 2172067260
     scs             1978470869  -  3.35% 1912263779
     simple           669858104  -  3.38%  647206739
     spectral-norm    186423292  -  5.37%  176411536

 Differential Revision: https://phabricator.haskell.org/D3903
 }}}

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


More information about the ghc-tickets mailing list