Skip to content
Snippets Groups Projects
Commit ae24c9bc authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Marge Bot
Browse files

Slight improvement in WorkWrap

Ensure that WorkWrap preserves lambda binders, in case of join points.  Sadly I
have forgotten why I made this change (it was while I was doing a lot of
meddling in the Simplifier, but
  * it does no harm,
  * it is slightly more efficient, and
  * presumably it made something better!

Anyway I have kept it in a separate commit.
parent 609cd32c
No related branches found
No related tags found
No related merge requests found
......@@ -768,11 +768,19 @@ splitFun ww_opts fn_id rhs
return [(fn_id, rhs)]
Just stuff
| let opt_wwd_rhs = simpleOptExpr (wo_simple_opts ww_opts) rhs
-- We need to stabilise the WW'd (and optimised) RHS below
| let opt_wwd_rhs = mkLams arg_vars $
simpleOptExpr (wo_simple_opts ww_opts) body
-- Run the simple optimiser on the WW'd body, to get rid of
-- junk. Keep all the original `arg_vars` binders though: this
-- might be a join point, and we don't want to lose the
-- one-shot annotations. At least I think that's the reason
-- (honestly, I have forgottne), but doing it this way
-- certainly does no harm and is slightly more efficient.
, Just stable_unf <- certainlyWillInline uf_opts fn_info opt_wwd_rhs
-- We could make a w/w split, but in fact the RHS is small
-- See Note [Don't w/w inline small non-loop-breaker things]
, let id_w_unf = fn_id `setIdUnfolding` stable_unf
-- See Note [Inline pragma for certainlyWillInline]
-> return [ (id_w_unf, rhs) ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment