#4428: Local functions lose their unfoldings
---------------------------------+------------------------------------------
Reporter: rl | Owner:
Type: bug | Status: merge
Priority: normal | Milestone: 7.0.2
Component: Compiler | Version: 7.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Runtime performance bug
---------------------------------+------------------------------------------
Comment(by simonpj):
I'm really not sure what behaviour you want here. When you write `{-#
INLINE foo #-}` you mean "when you see code using `foo`, behave as if
you'd seen that code using `foo`'s RHS instead". So
{{{
bar = ...foo...
}}}
behaves as if you had written
{{{
bar = ...(let {-# INLINE [0] local #-}
[Tmpl = <unoptimised rhs>]
local = <unoptimised rhs>]
in
... <foo rhs> ...) ...
}}}
I assume this is what you wanted.
Now suppose you wrote that in the first place. Well then, the `{-#
INLINE[0] local #-}` says "in phase 0 please inline `local`, replacing it
with the original (unoptimised) RHS. And that's exactly what happens.
Without understanding more clearly what you are trying to achieve I don't
think I can help much more. Maybe an example showing how you are
exploiting these nested inlinings?
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4428#comment:7>
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