[project @ 2001-03-23 10:47:21 by simonpj]
authorsimonpj <unknown>
Fri, 23 Mar 2001 10:47:21 +0000 (10:47 +0000)
committersimonpj <unknown>
Fri, 23 Mar 2001 10:47:21 +0000 (10:47 +0000)
Comments, plus dead code elim

ghc/compiler/coreSyn/CoreTidy.lhs
ghc/compiler/coreSyn/CoreUtils.lhs
ghc/compiler/simplCore/SimplUtils.lhs

index 09541fe..64d7c73 100644 (file)
@@ -381,12 +381,6 @@ tidyTopBind mod ext_ids cg_info_env top_tidy_env (Rec prs)
 
         rhs' = tidyExpr rec_tidy_env rhs
 
-       -- the CafInfo for a recursive group says whether *any* rhs in
-       -- the group may refer indirectly to a CAF (because then, they all do).
-    (bndrs, rhss) = unzip prs'
-    pred v = v `notElem` bndrs
-
-
 tidyTopBinder :: Module -> IdEnv Bool
              -> CgInfoEnv
              -> TidyEnv -> CoreExpr
index 00d5723..032ab51 100644 (file)
@@ -707,7 +707,7 @@ exprEtaExpandArity e
     ok_note InlineCall   = True
     ok_note other        = False
            -- Notice that we do not look through __inline_me__
-           -- This one is a bit more surprising, but consider
+           -- This may seem surprising, but consider
            --  f = _inline_me (\x -> e)
            -- We DO NOT want to eta expand this to
            --  f = \x -> (_inline_me (\x -> e)) x
@@ -747,8 +747,6 @@ etaExpand :: Int            -- Add this number of value args
 -- would return
 --     (/\b. coerce T (\y::A -> (coerce (A->B) (E b) y)
 
--- (case x of { I# x -> /\ a -> coerce T E)
-
 etaExpand n us expr ty
   | n == 0     -- Saturated, so nothing to do
   = expr
index 55e7fca..501dd60 100644 (file)
@@ -690,6 +690,11 @@ There is no point in looking for a combination of the two, because
 that would leave use with some lets sandwiched between lambdas; that's
 what the final test in the first equation is for.
 
+In Case 1, we may have to sandwich some coerces between the lambdas
+to make the types work.   exprEtaExpandArity looks through coerces
+when computing arity; and etaExpand adds the coerces as necessary when
+actually computing the expansion.
+
 \begin{code}
 tryEtaExpansion :: OutExpr -> OutType -> SimplM ([OutBind], OutExpr)
 tryEtaExpansion rhs rhs_ty