Ticket #6087 (new bug)
Join points need strictness analysis
| Reported by: | simonpj | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.6.2 |
| Component: | Compiler | Version: | 7.4.1 |
| Keywords: | Cc: | stefan@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Runtime performance bug | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
I came across this code in the nofib/spectral progam knights, in the code for KnightHeuristic.possibleMoves:
let {
$j_sU3
:: GHC.Types.Int -> GHC.Types.Int -> [KnightHeuristic.Direction]
[LclId, Arity=2]
$j_sU3 =
\ (ww2_sRl :: GHC.Types.Int) (ww3_sRm :: GHC.Types.Int) ->
case ww2_sRl of ww4_XQY { GHC.Types.I# ww5_sQU ->
case GHC.Prim.>=# ww5_sQU 1 of _ {
GHC.Types.False -> go1_azF ys_azM;
GHC.Types.True ->
case ds1_azR of _ { GHC.Types.I# y1_azp ->
case GHC.Prim.<=# ww5_sQU y1_azp of _ {
GHC.Types.False -> go1_azF ys_azM;
GHC.Types.True ->
case ww3_sRm of wild6_XAB { GHC.Types.I# x_XAE ->
case GHC.Prim.>=# x_XAE 1 of _ {
GHC.Types.False -> go1_azF ys_azM;
GHC.Types.True ->
case GHC.Prim.<=# x_XAE y1_azp of _ {
GHC.Types.False -> go1_azF ys_azM;
GHC.Types.True ->
case GHC.List.notElem
@ ChessSetList.Tile
ChessSetList.isSquareFree_$dEq
(ww4_XQY, wild6_XAB)
wild2_azW
of _ {
GHC.Types.False -> go1_azF ys_azM;
GHC.Types.True ->
GHC.Types.:
@ KnightHeuristic.Direction y_azL (go1_azF ys_azM)
}
}
}
}
}
}
}
} } in
case y_azL of _ {
KnightHeuristic.UL ->
$j_sU3
(case ww_sQJ of _ { GHC.Types.I# x_aya ->
GHC.Types.I# (GHC.Prim.-# x_aya 1)
})
(case ww1_sQK of _ { GHC.Types.I# x_aya ->
GHC.Types.I# (GHC.Prim.-# x_aya 2)
});
KnightHeuristic.UR ->
$j_sU3
(case ww_sQJ of _ { GHC.Types.I# x_ayl ->
GHC.Types.I# (GHC.Prim.+# x_ayl 1)
})
(case ww1_sQK of _ { GHC.Types.I# x_aya ->
GHC.Types.I# (GHC.Prim.-# x_aya 2)
});
...lots more similar case alternatives follow...
Just look at all those Ints getting boxed, and the immediately unboxed by the join point! The strictness analyser would spot this easily, but presumably the join point is constructed after strictness analysis.
There must be an opportunity here to run a later strictness analysis pass.
Change History
Note: See
TracTickets for help on using
tickets.
