#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 simonpj):
Yes, but as you point out, the "method-sharing" thing commons up the two
occurrences of 'foo'. If we export foo, we get
{{{
Foo.bar =
\ (@ a_a6x) ($dC_a6H :: Foo.C a_a6x) ->
let {
foo1_s7T [ALWAYS Just L] :: (GHC.Base.Int -> GHC.Base.Int) -> a_a6x
-> a_a6x
[Str: DmdType]
foo1_s7T = Foo.foo @ a_a6x $dC_a6H
} in
\ (f_a60 :: GHC.Base.Int -> GHC.Base.Int) ->
let {
f1_s7V [ALWAYS Just L] :: a_a6x -> a_a6x
[Str: DmdType]
f1_s7V = foo1_s7T f_a60
} in \ (x_a6T :: a_a6x) -> f1_s7V (f1_s7V x_a6T)
}}}
Notice just one call to `foo`. If `foo` is not exported, this is the
''only'' call to `foo` so it gets inlined.
It's delicate, I grant you. Maybe I should experiment with making INLINE
inline always (at least if saturated). I'm a bit reluctant to further
complicate the interface with REALLYINLINE.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2353#comment:6>
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