[GHC] #5302: Unused arguments in join points
GHC
ghc-devs at haskell.org
Wed Feb 22 11:04:15 UTC 2017
#5302: Unused arguments in join points
-------------------------------------+-------------------------------------
Reporter: reinerp | Owner: simonpj
Type: bug | Status: new
Priority: low | Milestone: 8.4.1
Component: Compiler | Version: 7.0.3
Resolution: | Keywords: JoinPoints
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 simonpj):
Still reproducible in HEAD.
* The reason the late demand-analysis doesn't catch it is because we don't
do w/w. (Reason: see `Note [Final Demand Analyser run]` in `DmdAnal`.)
* The absent argument is actually a case binder, passed as a result of
`Note [Case binders and join points]` in `Simplify`. But in this case it
turns out that not only is the case-binder argument eventually unused, but
(even worse) every `juump` to that join point looks like `jump j x (I#
x)`. So we box it, and then immediately discard it. Urk.
Just recording breadcrumbs for now. My thought: never pass the case binder
to a join point; instead re-box it. It's much the same trade-off as in
other places where we worry about re-boxing. And it would be a lot
simpler; in particular, we can stop having unfoldings in lambda-binders,
which is pretty dodgy anyway.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/5302#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list