[GHC] #15573: Make bindings with multiple occurrences a join point instead of duplicating code during inlining.

GHC ghc-devs at haskell.org
Tue Aug 28 09:51:32 UTC 2018


#15573: Make bindings with multiple occurrences a join point instead of duplicating
code during inlining.
-------------------------------------+-------------------------------------
        Reporter:  AndreasK          |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:  JoinPoints
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15560            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by AndreasK):

 * related:   => #15560


Comment:

 Replying to [comment:1 simonpj]:
 > This relates to #15560: in the current ticket you are proposing the to
 use float-in (the opposite of float-out) to make `cseAlts_s1dD` a local
 binging again.
 >
 > I'd prefer instead to make the top-level version (in the Description)
 more efficient so that it's just as efficient as the join-point version.

 While we can (and should!) improve on the current cost even with your
 suggestions there will likely still be an overhead caused by code layout
 and calling convention. Even if far smaller.

 > One reason I want to do that is because it improves inlining
 opportunities, by making the function (`fmerge` in this case) smaller.

 Indeed this sounds good. However I'm not sure if we can make calling top
 level functions efficient enough to **never** warant inlining. And
 assuming we still end up inlining in some cases this optimization would be
 good to have.

 But I agree that the ideas discussed in #15560 have the chance to remove
 the need for this.

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


More information about the ghc-tickets mailing list