X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FsimplCore%2FSimplEnv.lhs;h=245f313e8f874b4f59f60e26f2dd5ca2a26ba5cc;hb=84923cc7de2a93c22a2f72daf9ac863959efae13;hp=c9fb4fbb8ba23d5d9471a535c0498c71fe0609e1;hpb=6f074a37a1546391632863898da3c32bbb7995df;p=ghc-hetmet.git diff --git a/compiler/simplCore/SimplEnv.lhs b/compiler/simplCore/SimplEnv.lhs index c9fb4fb..245f313 100644 --- a/compiler/simplCore/SimplEnv.lhs +++ b/compiler/simplCore/SimplEnv.lhs @@ -608,8 +608,12 @@ substLetIdBndr :: SimplEnv -> InBndr -- Env and binder to transform -> (SimplEnv, OutBndr) -- C.f. substIdBndr above -- Clone Id if necessary, substitute its type --- Return an Id with completely zapped IdInfo +-- Return an Id with its fragile info zapped +-- namely, any info that depends on free variables -- [addLetIdInfo, below, will restore its IdInfo] +-- We want to retain robust info, especially arity and demand info, +-- so that they are available to occurrences that occur in an +-- earlier binding of a letrec -- Augment the subtitution -- if the unique changed, *or* -- if there's interesting occurrence info @@ -620,7 +624,10 @@ substLetIdBndr env@(SimplEnv { seInScope = in_scope, seIdSubst = id_subst }) old where id1 = uniqAway in_scope old_id id2 = substIdType env id1 - new_id = setIdInfo id2 vanillaIdInfo + + -- We want to get rid of any info that's dependent on free variables, + -- but keep other info (like the arity). + new_id = zapFragileIdInfo id2 -- Extend the substitution if the unique has changed, -- or there's some useful occurrence information