X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2FsimplCore%2FOccurAnal.lhs;h=06133d6bdb15a7bfd49ebc035ebf1c001727595f;hb=HEAD;hp=c593e81eb668faa151fb31f1fc24a08bb3d93230;hpb=fdf8656855d26105ff36bdd24d41827b05037b91;p=ghc-hetmet.git diff --git a/compiler/simplCore/OccurAnal.lhs b/compiler/simplCore/OccurAnal.lhs index c593e81..06133d6 100644 --- a/compiler/simplCore/OccurAnal.lhs +++ b/compiler/simplCore/OccurAnal.lhs @@ -53,13 +53,14 @@ import Data.List Here's the externally-callable interface: \begin{code} -occurAnalysePgm :: Maybe (Activation -> Bool) -> [CoreRule] +occurAnalysePgm :: Maybe (Activation -> Bool) -> [CoreRule] -> [CoreVect] -> [CoreBind] -> [CoreBind] -occurAnalysePgm active_rule imp_rules binds +occurAnalysePgm active_rule imp_rules vects binds = snd (go (initOccEnv active_rule imp_rules) binds) where - initial_uds = addIdOccs emptyDetails (rulesFreeVars imp_rules) - -- The RULES keep things alive! + initial_uds = addIdOccs emptyDetails + (rulesFreeVars imp_rules `unionVarSet` vectsFreeVars vects) + -- The RULES and VECTORISE declarations keep things alive! go :: OccEnv -> [CoreBind] -> (UsageDetails, [CoreBind]) go _ [] @@ -101,11 +102,6 @@ occAnalBind env _ (NonRec binder rhs) body_usage | isTyVar binder -- A type let; we don't gather usage info = (body_usage, [NonRec binder rhs]) - | isCoVar binder -- A coercion let; again no usage info - -- We trust that it'll get inlined away - -- as soon as it takes form (cv = Coercion co) - = (body_usage, [NonRec binder rhs]) - | not (binder `usedIn` body_usage) -- It's not mentioned = (body_usage, [])