import CSE ( cseProgram )
import Rules ( RuleBase, emptyRuleBase, mkRuleBase, unionRuleBase,
extendRuleBaseList, pprRuleBase, ruleCheckProgram,
- mkSpecInfo, addSpecInfo )
+ addSpecInfo, addIdSpecialisations )
import PprCore ( pprCoreBindings, pprCoreExpr, pprRules )
-import OccurAnal ( occurAnalysePgm, occurAnalyseGlobalExpr )
+import OccurAnal ( occurAnalysePgm, occurAnalyseExpr )
import IdInfo ( setNewStrictnessInfo, newStrictnessInfo,
setWorkerInfo, workerInfo,
setSpecInfo, specInfo, specInfoRules )
import FloatIn ( floatInwards )
import FloatOut ( floatOutwards )
import Id ( Id, modifyIdInfo, idInfo, isExportedId, isLocalId,
- idSpecialisation, setIdSpecialisation, idName )
+ idSpecialisation, idName )
import VarSet
import VarEnv
import NameEnv ( lookupNameEnv )
update_bndr bndr = case lookupNameEnv local_rules (idName bndr) of
Nothing -> bndr
- Just rules -> bndr `setIdSpecialisation` mkSpecInfo rules
+ Just rules -> bndr `addIdSpecialisations` rules
+ -- The binder might have some existing rules,
+ -- arising from specialisation pragmas
\end{code}
-- enforce that; it just simplifies the expression twice
simplExprGently env expr
- = simplExpr env (occurAnalyseGlobalExpr expr) `thenSmpl` \ expr1 ->
- simplExpr env (occurAnalyseGlobalExpr expr1)
+ = simplExpr env (occurAnalyseExpr expr) `thenSmpl` \ expr1 ->
+ simplExpr env (occurAnalyseExpr expr1)
\end{code}