
#14816: Missed Called Arity opportunity? -------------------------------------+------------------------------------- Reporter: dfeuer | 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: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sgraf): OK, this is due to the call to [https://github.com/ghc/ghc/blob/81a5e05d376c075a38e55bc124ea6226c1f3bef7/com... reuseEnv here] (that function effectively duplicates every demand, so `1*C1(U(U)) -> C(U(U))`) with the explanation in `Aggregated demand for cardinality`, the gist of which is that we have to treat free variables of let-bound thunks differently in usage analysis than we would like to for strictness analysis. I think this should only be relevant for thunks, e.g. we should first `splitFVs is_thunk rhs_fv` and only then `reuseEnv` the `lazy_fv`. I'll give that a shot. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14816#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler