
#14844: SpecConstr also non-recursive function -------------------------------------+------------------------------------- Reporter: nomeata | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.5 Resolution: | Keywords: SpecConstr Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sgraf): I'm currently on vacation, so I'm afraid I won't be able to write much code. I'm not doing anything targeting non-recursive functions, that in itself should be pretty much independent. But given that you seem to have stumbled over the same "phase dependency" problems, here are some notes: Re: "anticipates the state after simplifications": That's what I figured out, too, and becomes much more crucial once you add lambdas, which does beta-reduction and makes seeing which arguments are scrutinized a little harder. Currently, SpecConstr only gets its `ArgOcc`s (which is a criterion for how deep it's worth to specialise in absence of forced `SPEC`) only considers the original RHS. Specialised RHS' Occs are never considered, although /calls/ from their RHSs are considered. My plan forward is to revise the fix-pointing scheme in a way that we can translate occurences in specialised RHSs back to occurences on the original RHS' arguments. In the case of lambdas, this also involves unification of call patterns with bound variables, which is rather nasty and what I've been fiddling with the last weeks. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14844#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler