Commit 0239d8cc authored by Simon Peyton Jones's avatar Simon Peyton Jones

Eliminate the GlomBinds pass

It is now done when necessary by OccurAnal
(see Note [Glomming] in OccurAnal)
parent 4e72e093
......@@ -224,7 +224,6 @@ data CoreToDo -- These are diff core-to-core passes,
| CoreDoWorkerWrapper
| CoreDoSpecialising
| CoreDoSpecConstr
| CoreDoGlomBinds
| CoreCSE
| CoreDoRuleCheck CompilerPhase String -- Check for non-application of rules
-- matching this string
......@@ -261,7 +260,6 @@ coreDumpFlag CorePrep = Just Opt_D_dump_prep
coreDumpFlag CoreDoPrintCore = Nothing
coreDumpFlag (CoreDoRuleCheck {}) = Nothing
coreDumpFlag CoreDoNothing = Nothing
coreDumpFlag CoreDoGlomBinds = Nothing
coreDumpFlag (CoreDoPasses {}) = Nothing
instance Outputable CoreToDo where
......@@ -282,7 +280,6 @@ instance Outputable CoreToDo where
ppr CorePrep = ptext (sLit "CorePrep")
ppr CoreDoPrintCore = ptext (sLit "Print core")
ppr (CoreDoRuleCheck {}) = ptext (sLit "Rule check")
ppr CoreDoGlomBinds = ptext (sLit "Glom binds")
ppr CoreDoNothing = ptext (sLit "CoreDoNothing")
ppr (CoreDoPasses {}) = ptext (sLit "CoreDoPasses")
......
......@@ -247,7 +247,6 @@ getCoreToDo dflags
runWhen strictness (CoreDoPasses [
CoreDoStrictness,
CoreDoWorkerWrapper,
CoreDoGlomBinds,
simpl_phase 0 ["post-worker-wrapper"] max_iter
]),
......@@ -391,7 +390,6 @@ doCorePass CoreDoSpecConstr = {-# SCC "SpecConstr" #-}
doCorePass CoreDoVectorisation = {-# SCC "Vectorise" #-}
vectorise
doCorePass CoreDoGlomBinds = doPassDM glomBinds
doCorePass CoreDoPrintCore = observe printCore
doCorePass (CoreDoRuleCheck phase pat) = ruleCheckPass phase pat
doCorePass CoreDoNothing = return
......@@ -513,48 +511,6 @@ simplExprGently env expr = do
\end{code}
%************************************************************************
%* *
\subsection{Glomming}
%* *
%************************************************************************
\begin{code}
glomBinds :: DynFlags -> [CoreBind] -> IO [CoreBind]
-- Glom all binds together in one Rec, in case any
-- transformations have introduced any new dependencies
--
-- NB: the global invariant is this:
-- *** the top level bindings are never cloned, and are always unique ***
--
-- We sort them into dependency order, but applying transformation rules may
-- make something at the top refer to something at the bottom:
-- f = \x -> p (q x)
-- h = \y -> 3
--
-- RULE: p (q x) = h x
--
-- Applying this rule makes f refer to h,
-- although it doesn't appear to in the source program.
-- This pass lets us control where it happens.
--
-- NOTICE that this cannot happen for rules whose head is a locally-defined
-- function. It only happens for rules whose head is an imported function
-- (p in the example above). So, for example, the rule had been
-- RULE: f (p x) = h x
-- then the rule for f would be attached to f itself (in its IdInfo)
-- by prepareLocalRuleBase and h would be regarded by the occurrency
-- analyser as free in f.
glomBinds dflags binds
= do { Err.showPass dflags "GlomBinds" ;
let { recd_binds = [Rec (flattenBinds binds)] } ;
return recd_binds }
-- Not much point in printing the result...
-- just consumes output bandwidth
\end{code}
%************************************************************************
%* *
\subsection{The driver for the simplifier}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment