Skip to content
Snippets Groups Projects
Commit f7cf3dcd authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Be a bit less gung-ho in exprIsConApp_maybe

In particular, don't second-guess callSiteInline by
effectively inlining function call.  This eliminates
the "Interesting!" debug messages we've been getting.
I concluded they weren't interesting enough to account
for the extra complexity!
parent e99f3234
No related branches found
No related tags found
No related merge requests found
......@@ -1197,16 +1197,15 @@ exprIsConApp_maybe id_unf expr
mk_arg e = mkApps e args
= dealWithCoercion co (con, substTys subst dfun_res_tys, map mk_arg ops)
-- Look through unfoldings, but only cheap ones, because
-- we are effectively duplicating the unfolding
| Just rhs <- expandUnfolding_maybe unfolding
= -- pprTrace "expanding" (ppr fun $$ ppr rhs) $
let in_scope' = extendInScopeSetSet in_scope (exprFreeVars rhs)
res = go (Left in_scope') rhs cont
in WARN( unfoldingArity unfolding > 0 && isJust res,
text "Interesting! exprIsConApp_maybe:"
<+> ppr fun <+> ppr expr)
res
-- Look through unfoldings, but only arity-zero one;
-- if arity > 0 we are effectively inlining a function call,
-- and that is the business of callSiteInline.
-- In practice, without this test, most of the "hits" were
-- CPR'd workers getting inlined back into their wrappers,
| unfoldingArity unfolding == 0
, Just rhs <- expandUnfolding_maybe unfolding
, let in_scope' = extendInScopeSetSet in_scope (exprFreeVars rhs)
= go (Left in_scope') rhs cont
where
unfolding = id_unf fun
......
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