Note [No eta reduction needed in rhsToBody]
Historical note. In the olden days we used to have a Prep-specific
eta-reduction step in rhsToBody:
rhsToBody expr@(Lam {})
| Just no_lam_result <- tryEtaReducePrep bndrs body
= return (emptyFloats, no_lam_result)
The goal was to reduce
case x of { p -> \xs. map f xs }
==> case x of { p -> map f }
to avoid allocating a lambda. Of course, we'd allocate a PAP
instead, which is hardly better, but that's the way it was.
Now we simply don't bother with this. It doesn't seem to be a win,
and it's extra work. References 0
This Note does not link to any other.
Referenced by 2
- Do not eta reduce PAPs GHC.Core.Opt.Arity
- GHC.CoreToStg.Prep call site