[GHC] #10918: Float once-used let binding into a recursive function
GHC
ghc-devs at haskell.org
Mon Sep 28 12:45:59 UTC 2015
#10918: Float once-used let binding into a recursive function
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: task | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
-------------------------------------+-------------------------------------
Comment (by nomeata):
Looking at the code, maybe this is a viable course of action:
In `FloatIn`, in the equation of `fiExpr` for recursive bindings, where
`extra_fvs` are calculated, exclude any variables that are free variables
of a right-hand-side of the binding if they have a Dmd signature that
indicates that they are used at most once. This allows them to float
inside the `let`
Then we still need to ensure that they pass past the lambda. So the lambda
case of `fiExpr` needs to be improved to separate the used-once floats
from the others and float only those in.
I’m not sure if the float in pass is the right place to do this, though.
Shouldn’t the simplifier be able to do these things? So maybe
`simplRecBind` should not zap all floats, but rather distinguish between
those that may float into a recursive group and the others?
This needs advise from one of the experts on the simplifier.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10918#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list