#2353: GHC inliner doesn't
----------------------+-----------------------------------------------------
 Reporter:  guest     |          Owner:         
     Type:  bug       |         Status:  new    
 Priority:  normal    |      Milestone:         
Component:  Compiler  |        Version:  6.9    
 Severity:  normal    |     Resolution:         
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  Unknown
       Os:  Unknown   |  
----------------------+-----------------------------------------------------
Changes (by simonpj):

  * difficulty:  => Unknown

Comment:

 GHC deliberately doesn't inline a function, even if there's an INLINE
 pragma, if there is nothing "interesting" about the arguments or context.
 For example
 {{{
    f x y = g (h x y)
 }}}
 Here GHC won't inline `h` even if `h` has an INLINE pragma.  Why?  Because
 doing so just increases code duplication.

 However, GHC does take account of context too.  If `g` has a RULE, then
 `h` will be inlined in case that inlining allows g's RULE to match.

 It's possible that even this isn't enough in some circumstances.  Perhaps
 you have such a case in mind.

 But as things stand, it's deliberate.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2353#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to