[GHC] #14137: Do more inlining into non-recursive join points

GHC ghc-devs at haskell.org
Thu Aug 24 23:26:21 UTC 2017


#14137: Do more inlining into non-recursive join points
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  nomeata
            Type:  bug               |               Status:  new
        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:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 > I do not quite see the difference between the first two threads

 The original Description is about floating a non-join point into a nullary
 join point:
 {{{
 let x = e in
 join j = Just x in
 ...
 }}}
 where this is the only occurrence of `x`.  Here we want to transform to
 {{{
 join j = Just e
 }}}
 so that the thunk creation occurs only if `j` is executed rather than
 always.

 But for nullary lets we do the reverse transform
 {{{
 let x = Just e
 ===>
 let a = e in
 let x = Just e
 }}}
 for reasons described above.

 In contrast, the second thread is about inlining ''join points'', not
 about inlining ''lets''.  And as I say in comment:14 I'm no longer so keen
 on this idea, esp in view of #14152

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


More information about the ghc-tickets mailing list