[GHC] #12603: INLINE and manually inlining produce different code

GHC ghc-devs at haskell.org
Fri Oct 21 12:06:30 UTC 2016


#12603: INLINE and manually inlining produce different code
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  bgamari
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
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):

 > The guarantee that would help greatly would be that the behaviour of the
 program with neither INLINE nor NOINLINE for function f is the same as the
 behaviour with INLINE or that with NOINLINE.

 I think that's very problematic.  Currently GHC decides on a call-site-by-
 call-site basis whether to inline a given function.  See module
 `CoreUnfold` and in particular `callSiteInline`.  You could change it to
 do something different but I believe that'd make GHC generate either
 bigger code or slower code or both.  But do try!

 INLINE/NOINLINE let you take control; otherwise you are letting GHC
 decide.

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


More information about the ghc-tickets mailing list