#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   |  
----------------------+-----------------------------------------------------
Comment (by guest):

 If it is deliberate, why does exporting foo make a difference?
 That's rather unintuitive.

 I'm not sure I buy that argument that not inlining foo is the right
 decision here.
 Look at the difference in code without and with inlining.  I think the
 inlined version looks better.

 {{{
 -- No inline
 Foo.bar =
   \ (@ a_a6v) ($dC_a6F :: Foo.C a_a6v) ->
     let {
       foo1_s7R [Just L] :: (GHC.Base.Int -> GHC.Base.Int) -> a_a6v ->
 a_a6v
       [Str: DmdType]
       foo1_s7R = Foo.foo @ a_a6v $dC_a6F } in
     \ (f_a5Y :: GHC.Base.Int -> GHC.Base.Int) ->
       let {
         f1_s7T [Just L] :: a_a6v -> a_a6v
         [Str: DmdType]
         f1_s7T = foo1_s7R f_a5Y } in
       \ (x_a6R :: a_a6v) -> f1_s7T (f1_s7T x_a6R)

 -- Inline (because foo was not exported)
 Foo.bar =
   \ (@ a_a6v) ($dC_a6F :: Foo.C a_a6v) ->
     let {
       from1_s7I [Just L] :: GHC.Base.Int -> a_a6v
       [Str: DmdType]
       from1_s7I = Foo.from @ a_a6v $dC_a6F } in
     let {
       to1_s7G [Just L] :: a_a6v -> GHC.Base.Int
       [Str: DmdType]
       to1_s7G = Foo.to @ a_a6v $dC_a6F } in
     \ (f_a5Y :: GHC.Base.Int -> GHC.Base.Int) (eta_s6T :: a_a6v) ->
       from1_s7I (f_a5Y (to1_s7G (from1_s7I (f_a5Y (to1_s7G eta_s6T)))))
 }}}

 Also, if INLINE doesn't really inline, then I'd like a REALLYINLINE
 pragma.  Sometimes I know what I'm doing, and I'd like the compiler to
 obey.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2353#comment:2>
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