WorkWrap: Update Unfolding with WW'd body prior to `tryWW` (#20510)
We have a function in #20510 (closed) that is small enough to get a stable unfolding in WW:
small :: Int -> Int
small x = go 0 x
where
go z 0 = z * x
go z y = go (z+y) (y-1)
But it appears we failed to use the WW'd RHS as the stable unfolding. As a result,
inlining small
would expose the non-WW'd version of go
. That appears to regress
badly in #19727 (closed) which is a bit too large to extract a reproducer from that is
guaranteed to reproduce across GHC versions.
The solution is to simply update the unfolding of the binder we call tryWW
on
with its WW'd RHS (that itself is not yet worker-wrapper-split at that point).
Fixes #20510 (closed).