[GHC] #15056: Wrappers inlined too late
GHC
ghc-devs at haskell.org
Fri Apr 20 12:31:44 UTC 2018
#15056: Wrappers inlined too late
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.2.2
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):
Another example comes from `nofib/real/veritas`. In `Edlib.hs` we have
{{{
(...) :: Xio_fn -> Xio_fn -> Xin -> Xio
(...) f g xin = f xin \\\ g
}}}
and in `X_interface` we get
{{{
x_send_argL argL = x_send x_multi_arg_esc_seq ...
x_send [toEnum (length argL)] ...
app ( map x_send_arg argL ) ...
x_send x_end_arg_esc_seq
}}}
It turns out that `...` gets w/w'd (because it is CPR'd in fact), and that
means it doesn't inline until phase 0. If we inline in phase 2 we get
lots
of fold/build fusion, which leads to a whopping 25% improvement in the
allocation of the veritas benchmark.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15056#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list