Re: [GHC] #1600: Optimisation: CPR the results of IO

#1600: Optimisation: CPR the results of IO -------------------------------------+------------------------------------- Reporter: simonmar | Owner: (none) Type: task | Status: new Priority: lowest | Milestone: Component: Compiler | Version: 6.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: #8598 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by akio):
There are two changes in that commit:
Making data con wrapper have ug_boring_ok = boringCxtOk. I'm not sure I buy this in full. In Note [Inline data constructor wrappers aggresively]
Actually the only change is the latter one. The former change is already
in HEAD, as of 2be364ac8c.
there's a claim that we get better nested-CPR info.
I don't think the improvement has anything to do with nested CPR, because
I'm testing this change in isolation, without any other changes from the
nested CPR branch.
The big difference in nofib comes from the `GHC.Integer.Types` module in
`integer-gmp`. This module has this definition:
{{{#!hs
data Integer = S# !Int#
-- ^ iff value in @[minBound::'Int', maxBound::'Int']@
range
| Jp# {-# UNPACK #-} !BigNat
-- ^ iff value in @]maxBound::'Int', +inf[@ range
| Jn# {-# UNPACK #-} !BigNat
-- ^ iff value in @]-inf, minBound::'Int'[@ range
}}}
Note the redundant bang in the `S#` constructor. This causes a wrapper for
this constructor to be created:
{{{#!hs
GHC.Integer.Type.$WS# =
\ (dt [Occ=Once] :: Int#) ->
case dt of dt { __DEFAULT -> GHC.Integer.Type.S# dt }
}}}
And this wrapper remains un-inlined in various places like:
{{{#!hs
quotRemInteger =
\ (n :: Integer) (ds :: Integer) ->
join {
fail1 [Dmd=
participants (1)
-
GHC