A (late-)demand analysis and w/w question
Simon Peyton Jones
simonpj at microsoft.com
Tue Feb 20 22:47:18 UTC 2018
It's called "reboxing" and is referred to in all the strictness analysis papers about GHC. I don't know a reliable way to get rid of it; but I have it paged out at the moment.
https://www.microsoft.com/en-us/research/publication/demand-analysis/ (the box-demad stuff in the appendix is not implemented in GHC)
| -----Original Message-----
| From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Ömer
| Sinan Agacan
| Sent: 20 February 2018 16:25
| To: ghc-devs <ghc-devs at haskell.org>
| Subject: A (late-)demand analysis and w/w question
| I was recently looking at #6087. One of the cases that increased
| allocations (see comment:27) is when we do worker/wrapper to pass an
| `Int#` instead of `Int` when we need the boxed form in the function body.
| This causes redundant allocations because we already have the boxed
| version of the value but we passed it unboxed as a result of
| This raises the obvious (but maybe naive?) question of whether we could
| improve the demand analysis and/or worker/wrapper to avoid unpacking
| arguments when the argument is boxed again somewhere in the function
| Does this make sense? Has anyone tried this before?
| ghc-devs mailing list
| ghc-devs at haskell.org
More information about the ghc-devs