From: simonpj Date: Fri, 23 Mar 2001 10:47:21 +0000 (+0000) Subject: [project @ 2001-03-23 10:47:21 by simonpj] X-Git-Tag: Approximately_9120_patches~2337 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=08002107c35bdf124b1e3814d42734d82e392d45;p=ghc-hetmet.git [project @ 2001-03-23 10:47:21 by simonpj] Comments, plus dead code elim --- diff --git a/ghc/compiler/coreSyn/CoreTidy.lhs b/ghc/compiler/coreSyn/CoreTidy.lhs index 09541fe..64d7c73 100644 --- a/ghc/compiler/coreSyn/CoreTidy.lhs +++ b/ghc/compiler/coreSyn/CoreTidy.lhs @@ -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 diff --git a/ghc/compiler/coreSyn/CoreUtils.lhs b/ghc/compiler/coreSyn/CoreUtils.lhs index 00d5723..032ab51 100644 --- a/ghc/compiler/coreSyn/CoreUtils.lhs +++ b/ghc/compiler/coreSyn/CoreUtils.lhs @@ -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 diff --git a/ghc/compiler/simplCore/SimplUtils.lhs b/ghc/compiler/simplCore/SimplUtils.lhs index 55e7fca..501dd60 100644 --- a/ghc/compiler/simplCore/SimplUtils.lhs +++ b/ghc/compiler/simplCore/SimplUtils.lhs @@ -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