[GHC] #13208: Do two-phase inlining in simpleOptPgm

GHC ghc-devs at haskell.org
Wed Feb 8 15:12:45 UTC 2017


#13208: Do two-phase inlining in simpleOptPgm
-------------------------------------+-------------------------------------
        Reporter:  lukemaurer        |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:  JoinPoints
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * keywords:   => JoinPoints


Comment:

 Done!
 {{{
 commit 8e9593fb2147252ecb8b685ef6bf9c0237a71219
 Author: Simon Peyton Jones <simonpj at microsoft.com>
 Date:   Tue Feb 7 00:32:43 2017 +0000

     Improve the simple optimiser

     The previous version of the simple optimiser would leave
     beta-redexes, which was bad for join points.  E.g.

       join j x = ....   -- a join point
       in (\x. j x) y

     This would be ok if we beta-reduced the (\x) but not if
     we don't.

     This patch improves the simple optimiser, to follow the plan
     described in "Secrets of the GHC inliner", and implemented in
     the Mighty Simplifier.  It turns out not to be too hard to
     use the same plan here, and we get slightly better code as
     a result.
 }}}
 Luke, you say:

 >  The simpleOptPgm β-redexes are the only reason for the special rule in
 Core Lint (see Note [Beta redexes] in CoreLint.hs), so once this is done
 we can be rid of that.

 but don't we sometimes generate some beta-redexes in worker/wrapper after
 strictness analysis?  I have not yet changed this.

 Adding keyword `JoinPoints` so we don't lose track of this. It'd be cool
 to finish it off.  Ideally getting rid of type-lets too.

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


More information about the ghc-tickets mailing list