#5302: Unused arguments in join points
---------------------------------+------------------------------------------
Reporter: reinerp | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.0.3 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Runtime performance bug
---------------------------------+------------------------------------------
Sometimes GHC produces join points with unused parameters. In the example
attached, we get join points like the following (when compiled with -O2):
{{{
...
$j1_XHI
:: GHC.Prim.Int#
-> GHC.Types.Int
-> (# Unboxed.FingerTree
Unboxed.Size (Unboxed.Node Unboxed.Size b_ahY),
Unboxed.Node Unboxed.Size b_ahY,
Unboxed.FingerTree
Unboxed.Size (Unboxed.Node Unboxed.Size b_ahY) #)
[LclId, Arity=2, Str=DmdType LL]
$j1_XHI =
\ (x2_XE8 :: GHC.Prim.Int#) _ ->
...
}}}
which is always called as follows:
{{{
...
$j1_XHI x2_XE2 (GHC.Types.I# x2_XE2)
...
}}}
i.e. where the second argument is a boxed version of the first. GHC should
remove the dead parameter from the join point, to avoid unnecessary
boxing.
I get this Core with 7.0.3 and with 7.1.20110629.
I've attached a self-contained example, as small as I can make it. (Making
it smaller lets GHC do more unfolding and the problem disappears.) These
join points occur inside the 'Deep' case of '$wsplitTree'.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5302>
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