Re: [GHC] #6087: Join points need strictness analysis

#6087: Join points need strictness analysis
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: (none)
Type: bug | Status: infoneeded
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 7.4.1
Resolution: | Keywords: JoinPoints
Operating System: Unknown/Multiple | Architecture:
Type of failure: Runtime | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by osa1):
Now that I understand ticky profiling better I also took another look at
`cse` again.
The difference is is these two functions:
{{{
Entries Alloc Alloc'd Non-void Arguments STG Name
--------------------------------------------------------------------------------
524 12072 0 2 Li $wgo1{v r6T8}
(main:Main) (fun)
394 9984 0 2 LL $wdraw{v r6Tg}
(main:Main) (fun)
total: 918 22056
}}}
after late demand analysis this becomes:
{{{
Entries Alloc Alloc'd Non-void Arguments STG Name
--------------------------------------------------------------------------------
524 11424 0 2 Li $w$wgo{v r71J}
(main:Main) (fun)
394 12768 0 2 LL $wdraw{v r71R}
(main:Main) (fun)
total: 918 24192
}}}
Definitions: (common parts in `wdraw` functions removed)
{{{
$wgo1_r6T8 :: [GHC.Types.Char] -> GHC.Prim.Int# -> [GHC.Types.Char]
[GblId, Arity=2, Str=m2, Unf=OtherCon []] =
sat-only [] \r [w_s6XW ww_s6XX]
case w_s6XW of {
[] -> $wxs1_r6T7 ww_s6XX;
: y_s6XZ [Occ=Once*] ys_s6Y0 [Occ=Once] ->
case ww_s6XX of ds11_s6Y1 {
__DEFAULT ->
let {
sat_s6Y3 [Occ=Once] :: [GHC.Types.Char]
[LclId] =
[ys_s6Y0 ds11_s6Y1] \u []
case -# [ds11_s6Y1 1#] of sat_s6Y2 {
__DEFAULT -> $wgo1_r6T8 ys_s6Y0 sat_s6Y2;
};
} in : [y_s6XZ sat_s6Y3];
1# -> : [y_s6XZ n_r6T1];
};
};
$wdraw_r6Tg
:: [GHC.Types.Char]
-> [Main.GenTree [GHC.Types.Char]] -> [[GHC.Types.Char]]
[GblId, Arity=2, Str=, Unf=OtherCon []] =
sat-only [] \r [ww_s6ZI ww1_s6ZJ]
let {
sat_s70m [Occ=Once, Dmd=, Unf=OtherCon []] =
sat-only [] \r [w_s76A w1_s76B]
case w_s76A of {
[] -> $w$wxs_r71I w1_s76B;
: y_s76D [Occ=Once*] ys_s76E [Occ=Once] ->
case w1_s76B of ds11_s76F {
__DEFAULT ->
let {
sat_s76K [Occ=Once] :: [GHC.Types.Char]
[LclId] =
[ys_s76E ds11_s76F] \u []
case -# [ds11_s76F 1#] of sat_s76G {
__DEFAULT ->
case $w$wgo_r71J ys_s76E sat_s76G of {
(#,#) ww1_s76I [Occ=Once] ww2_s76J
[Occ=Once] ->
: [ww1_s76I ww2_s76J];
};
};
} in (#,#) [y_s76D sat_s76K];
1# -> (#,#) [y_s76D n_r71D];
};
};
$wdraw_r71R
:: [GHC.Types.Char]
-> [Main.GenTree [GHC.Types.Char]] -> [[GHC.Types.Char]]
[GblId, Arity=2, Str=, Unf=OtherCon []] =
sat-only [] \r [ww_s78p ww1_s78q]
let {
karg_s78r [Occ=Once*, Dmd=
participants (1)
-
GHC