Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/f7cf3dcd66d6a096401f187b3a138eca98113286

>---------------------------------------------------------------

commit f7cf3dcd66d6a096401f187b3a138eca98113286
Author: Simon Peyton Jones <[email protected]>
Date:   Sun Nov 27 19:42:19 2011 +0000

    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!

>---------------------------------------------------------------

 compiler/coreSyn/CoreSubst.lhs |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/compiler/coreSyn/CoreSubst.lhs b/compiler/coreSyn/CoreSubst.lhs
index 09f00c7..6268405 100644
--- a/compiler/coreSyn/CoreSubst.lhs
+++ b/compiler/coreSyn/CoreSubst.lhs
@@ -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
 



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to