X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FsimplStg%2FSRT.lhs;h=54b3a358d6726fe6fc7e019a6613fe7c86675b9d;hb=3fe733ed69f3ffbd60ca42bf88477f2c79321f8b;hp=3cf92e5f26b1dfa6fada14f5406e42e6f43648dc;hpb=f4605cb834abed2ffd2e09a6437fb1e3cc8a7296;p=ghc-hetmet.git diff --git a/ghc/compiler/simplStg/SRT.lhs b/ghc/compiler/simplStg/SRT.lhs index 3cf92e5..54b3a35 100644 --- a/ghc/compiler/simplStg/SRT.lhs +++ b/ghc/compiler/simplStg/SRT.lhs @@ -9,9 +9,9 @@ bindings have no CAF references, and record the fact in their IdInfo. \begin{code} module SRT where -import Id ( Id, setIdCafInfo, getIdCafInfo, externallyVisibleId, - idAppIsBottom +import Id ( Id, setIdCafInfo, idCafInfo, externallyVisibleId, ) +import CoreUtils( idAppIsBottom ) import IdInfo ( CafInfo(..) ) import StgSyn @@ -223,7 +223,12 @@ srtExpr rho (cont,lne) off e@(StgApp f args) = (e, global_refs, [], off) getGlobalRefs rho (StgVarArg f:args) `unionUniqSets` lookupPossibleLNE lne f -srtExpr rho (cont,lne) off e@(StgCon con args ty) = +srtExpr rho (cont,lne) off e@(StgLit l) = (e, cont, [], off) + +srtExpr rho (cont,lne) off e@(StgConApp con args) = + (e, cont `unionUniqSets` getGlobalRefs rho args, [], off) + +srtExpr rho (cont,lne) off e@(StgPrimApp op args ty) = (e, cont `unionUniqSets` getGlobalRefs rho args, [], off) srtExpr rho c@(cont,lne) off (StgCase scrut live1 live2 uniq _{-srt-} alts) = @@ -445,11 +450,12 @@ globalRefArg rho (StgVarArg id) | otherwise = case lookupUFM rho id of { - Just _ -> [id]; -- can't look at the caf_info yet... - Nothing -> + Just _ -> [id]; -- Can't look at the caf_info yet... + Nothing -> -- but we will look it up and filter later + -- in maybeHaveCafRefs if externallyVisibleId id - then case getIdCafInfo id of + then case idCafInfo id of MayHaveCafRefs -> [id] NoCafRefs -> [] else []