summaryrefslogtreecommitdiff
path: root/compiler/specialise/Specialise.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/specialise/Specialise.hs')
-rw-r--r--compiler/specialise/Specialise.hs44
1 files changed, 22 insertions, 22 deletions
diff --git a/compiler/specialise/Specialise.hs b/compiler/specialise/Specialise.hs
index 60bb890461..6ef320f8af 100644
--- a/compiler/specialise/Specialise.hs
+++ b/compiler/specialise/Specialise.hs
@@ -22,17 +22,17 @@ import Predicate
import Module( Module, HasModule(..) )
import Coercion( Coercion )
import CoreMonad
-import qualified CoreSubst
-import CoreUnfold
+import qualified GHC.Core.Subst
+import GHC.Core.Unfold
import Var ( isLocalVar )
import VarSet
import VarEnv
-import CoreSyn
-import Rules
-import CoreOpt ( collectBindersPushingCo )
-import CoreUtils ( exprIsTrivial, mkCast, exprType )
-import CoreFVs
-import CoreArity ( etaExpandToJoinPointRule )
+import GHC.Core
+import GHC.Core.Rules
+import GHC.Core.SimpleOpt ( collectBindersPushingCo )
+import GHC.Core.Utils ( exprIsTrivial, mkCast, exprType )
+import GHC.Core.FVs
+import GHC.Core.Arity ( etaExpandToJoinPointRule )
import UniqSupply
import Name
import MkId ( voidArgId, voidPrimId )
@@ -607,7 +607,7 @@ specProgram guts@(ModGuts { mg_module = this_mod
-- accidentally re-use a unique that's already in use
-- Easiest thing is to do it all at once, as if all the top-level
-- decls were mutually recursive
- top_env = SE { se_subst = CoreSubst.mkEmptySubst $ mkInScopeSet $ mkVarSet $
+ top_env = SE { se_subst = GHC.Core.Subst.mkEmptySubst $ mkInScopeSet $ mkVarSet $
bindersOfBinds binds
, se_interesting = emptyVarSet }
@@ -1036,7 +1036,7 @@ Avoiding this recursive specialisation loop is the reason for the
-}
data SpecEnv
- = SE { se_subst :: CoreSubst.Subst
+ = SE { se_subst :: GHC.Core.Subst.Subst
-- We carry a substitution down:
-- a) we must clone any binding that might float outwards,
-- to avoid name clashes
@@ -1051,7 +1051,7 @@ data SpecEnv
}
specVar :: SpecEnv -> Id -> CoreExpr
-specVar env v = CoreSubst.lookupIdSubst (text "specVar") (se_subst env) v
+specVar env v = GHC.Core.Subst.lookupIdSubst (text "specVar") (se_subst env) v
specExpr :: SpecEnv -> CoreExpr -> SpecM (CoreExpr, UsageDetails)
@@ -1144,7 +1144,7 @@ specCase env scrut' case_bndr [(con, args, rhs)]
subst_prs = (case_bndr, Var case_bndr_flt)
: [ (arg, Var sc_flt)
| (arg, Just sc_flt) <- args `zip` mb_sc_flts ]
- env_rhs' = env_rhs { se_subst = CoreSubst.extendIdSubstList (se_subst env_rhs) subst_prs
+ env_rhs' = env_rhs { se_subst = GHC.Core.Subst.extendIdSubstList (se_subst env_rhs) subst_prs
, se_interesting = se_interesting env_rhs `extendVarSetList`
(case_bndr_flt : sc_args_flt) }
@@ -1402,7 +1402,7 @@ specCalls mb_mod env existing_rules calls_for_me fn rhs
-- See Note [Account for casts in binding]
rhs_tyvars = filter isTyVar rhs_bndrs
- in_scope = CoreSubst.substInScope (se_subst env)
+ in_scope = GHC.Core.Subst.substInScope (se_subst env)
already_covered :: DynFlags -> [CoreRule] -> [CoreExpr] -> Bool
already_covered dflags new_rules args -- Note [Specialisations already covered]
@@ -1691,9 +1691,9 @@ bindAuxiliaryDicts env@(SE { se_subst = subst, se_interesting = interesting })
= (env', dx_binds, spec_dict_args)
where
(dx_binds, spec_dict_args) = go call_ds inst_dict_ids
- env' = env { se_subst = subst `CoreSubst.extendSubstList`
+ env' = env { se_subst = subst `GHC.Core.Subst.extendSubstList`
(orig_dict_ids `zip` spec_dict_args)
- `CoreSubst.extendInScopeList` dx_ids
+ `GHC.Core.Subst.extendInScopeList` dx_ids
, se_interesting = interesting `unionVarSet` interesting_dicts }
dx_ids = [dx_id | (NonRec dx_id _, _) <- dx_binds]
@@ -2595,20 +2595,20 @@ mapAndCombineSM f (x:xs) = do (y, uds1) <- f x
extendTvSubstList :: SpecEnv -> [(TyVar,Type)] -> SpecEnv
extendTvSubstList env tv_binds
- = env { se_subst = CoreSubst.extendTvSubstList (se_subst env) tv_binds }
+ = env { se_subst = GHC.Core.Subst.extendTvSubstList (se_subst env) tv_binds }
substTy :: SpecEnv -> Type -> Type
-substTy env ty = CoreSubst.substTy (se_subst env) ty
+substTy env ty = GHC.Core.Subst.substTy (se_subst env) ty
substCo :: SpecEnv -> Coercion -> Coercion
-substCo env co = CoreSubst.substCo (se_subst env) co
+substCo env co = GHC.Core.Subst.substCo (se_subst env) co
substBndr :: SpecEnv -> CoreBndr -> (SpecEnv, CoreBndr)
-substBndr env bs = case CoreSubst.substBndr (se_subst env) bs of
+substBndr env bs = case GHC.Core.Subst.substBndr (se_subst env) bs of
(subst', bs') -> (env { se_subst = subst' }, bs')
substBndrs :: SpecEnv -> [CoreBndr] -> (SpecEnv, [CoreBndr])
-substBndrs env bs = case CoreSubst.substBndrs (se_subst env) bs of
+substBndrs env bs = case GHC.Core.Subst.substBndrs (se_subst env) bs of
(subst', bs') -> (env { se_subst = subst' }, bs')
cloneBindSM :: SpecEnv -> CoreBind -> SpecM (SpecEnv, SpecEnv, CoreBind)
@@ -2616,7 +2616,7 @@ cloneBindSM :: SpecEnv -> CoreBind -> SpecM (SpecEnv, SpecEnv, CoreBind)
-- Return the substitution to use for RHSs, and the one to use for the body
cloneBindSM env@(SE { se_subst = subst, se_interesting = interesting }) (NonRec bndr rhs)
= do { us <- getUniqueSupplyM
- ; let (subst', bndr') = CoreSubst.cloneIdBndr subst us bndr
+ ; let (subst', bndr') = GHC.Core.Subst.cloneIdBndr subst us bndr
interesting' | interestingDict env rhs
= interesting `extendVarSet` bndr'
| otherwise = interesting
@@ -2625,7 +2625,7 @@ cloneBindSM env@(SE { se_subst = subst, se_interesting = interesting }) (NonRec
cloneBindSM env@(SE { se_subst = subst, se_interesting = interesting }) (Rec pairs)
= do { us <- getUniqueSupplyM
- ; let (subst', bndrs') = CoreSubst.cloneRecIdBndrs subst us (map fst pairs)
+ ; let (subst', bndrs') = GHC.Core.Subst.cloneRecIdBndrs subst us (map fst pairs)
env' = env { se_subst = subst'
, se_interesting = interesting `extendVarSetList`
[ v | (v,r) <- pairs, interestingDict env r ] }