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

GHC ghc-devs at haskell.org
Mon Oct 30 17:19:55 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 simonpj):

 > I left it out for now, because instruction counts increase

 So, just to be sure: allocation counts did not change?

 > What I do, how ever, see is exit join points that are called from two
 positions in the code, where inlining duplicates the code.

 What if you inline only join points that are called once?   So that no
 code duplication is involved.

 I'm having a hard time seeing why that should do anything bad.  And it can
 do something good...  if you have
 {{{
 join j x = ...y...
 in
   ...jump j v...
 }}}
 then `y` will get pushed onto the stack at the `join`, so that its RHS
 knows where to find it. If it's inlined that may not happen.  So may be
 more than just eliminating a jump.

 Still, I accept that it's not top priority.

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


More information about the ghc-tickets mailing list