
#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 nomeata):
You can circumvent that if you make f an argument to go (reverse static arg transform, essentially):
That’s smart! By making it an argument, you essentially tell GHC to apply inductive reasoning, and then the Demand Analyzer finds out that `f` is used at most once! Cool. And I presume if the recursion were non-linear, it would also do the right thing… So – can we just include the free variables in the strictness signature during fixpointing and get that optimization without the code transformation? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14816#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler