[commit: ghc] wip/nested-cpr: More tracing in the demand analyser (9d47492)

git at git.haskell.org git at git.haskell.org
Tue Jan 21 15:33:44 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nested-cpr
Link       : http://ghc.haskell.org/trac/ghc/changeset/9d47492ba10deaba032b871a6e0447207e66673a/ghc

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

commit 9d47492ba10deaba032b871a6e0447207e66673a
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Jan 21 13:59:51 2014 +0000

    More tracing in the demand analyser


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

9d47492ba10deaba032b871a6e0447207e66673a
 compiler/stranal/DmdAnal.lhs |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs
index f302744..f6a4486 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -187,8 +187,14 @@ dmdAnal env dmd (Lam var body)
 	env'		 = extendSigsWithLam env var
 	(body_ty, body') = dmdAnal env' body_dmd body
 	(lam_ty, var')   = annotateLamIdBndr env notArgOfDfun body_ty one_shot var
+        lam_ty'          = postProcessUnsat defer_and_use lam_ty
     in
-    (postProcessUnsat defer_and_use lam_ty, Lam var' body')
+    -- pprTrace "dmdAnal:Lam" (vcat [ text "dmd" <+> ppr dmd
+    --                              , text "body_ty" <+> ppr body_ty
+    --                              , text "lam_ty" <+> ppr lam_ty
+    --                              , text "lam_ty'" <+> ppr lam_ty'
+    --                              ]) $
+    (lam_ty', Lam var' body')
 
 dmdAnal env dmd (Case scrut case_bndr ty [alt@(DataAlt dc, bndrs, _)])
   -- Only one alternative with a product constructor, and a complex scrutinee
@@ -336,6 +342,9 @@ dmdAnal env dmd (Let (Rec pairs) body)
         body_ty1                = deleteFVs body_ty (map fst pairs)
 	body_ty2	        = addLazyFVs body_ty1 lazy_fv 
     in
+    -- pprTrace "dmdAnal:LetRec" (vcat [ text "body_ty" <+> ppr body_ty
+    --                                 , text "body_ty1" <+> ppr body_ty1
+    --                                 , text "body_ty2" <+> ppr body_ty2]) $
     body_ty2 `seq`
     (body_ty2,  Let (Rec pairs') body')
 
@@ -389,6 +398,9 @@ dmdAnalAlt env dmd (con,bndrs,rhs)
 	io_hack_reqd = con == DataAlt unboxedPairDataCon &&
 		       idType (head bndrs) `eqType` realWorldStatePrimTy
     in
+    -- pprTrace "dmdAnalAlt" (vcat [ text "rhs_ty" <+> ppr rhs_ty
+    --                             , text "alt_ty" <+> ppr alt_ty
+    --                             ]) $
     (final_alt_ty, (con, bndrs', rhs'))
 \end{code}
 



More information about the ghc-commits mailing list