A (late-)demand analysis and w/w question

Ömer Sinan Ağacan omeragacan at gmail.com
Tue Feb 20 16:25:23 UTC 2018


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?



More information about the ghc-devs mailing list