-- Reason: less confusing, and easier to generate IfaceSyn
dcEqSpec :: [(TyVar,Type)], -- Equalities derived from the result type,
- -- /as written by the programmer/
+ -- _as written by the programmer_
-- This field allows us to move conveniently between the two ways
-- of representing a GADT constructor's type:
-- MkT :: forall a b. (a :=: [b]) => b -> T a
-- that is H*E. The N term of the complexity is from the initial call
-- when 'update' will be passed 'Nothing'.
fixedpoint ::
- (node -> [node]) -- ^ map from nodes to those who's
+ (node -> [node]) -- map from nodes to those who's
-- value depend on the argument node
-> (node -> Maybe node -> s -> Maybe s)
- -- ^ Given the node which needs to be
+ -- Given the node which needs to be
-- updated, and which node caused that node
-- to need to be updated, update the state.
--
-- Must return 'Nothing' if no change,
-- otherwise returrn 'Just' of the new state.
- -> [node] -- ^ Nodes that should initially be updated
+ -> [node] -- Nodes that should initially be updated
- -> s -- ^ Initial state
+ -> s -- Initial state
-- (usually a map from node to
-- the value for that node)
- -> s -- ^ Final state
+ -> s -- Final state
fixedpoint dependants update nodes state =
foldr (fixedpoint' Nothing) state nodes where
-- Use a depth first traversal of nodes based on the update graph.
Handle any irrefutable (or ``twiddle'') @LazyPats@.
\end{itemize}
\item
-Now {\em unmix} the equations into {\em blocks} [w/ local function
+Now {\em unmix} the equations into {\em blocks} [w\/ local function
@unmix_eqns@], in which the equations in a block all have variable
patterns in column~1, or they all have constructor patterns in ...
(see ``the mixture rule'' in SLPJ).
corresponds roughly to @matchVarCon@.
\begin{code}
-match :: [Id] -- Variables rep'ing the exprs we're matching with
+match :: [Id] -- Variables rep\'ing the exprs we\'re matching with
-> Type -- Type of the case expression
-> [EquationInfo] -- Info about patterns, etc. (type synonym below)
-> DsM MatchResult -- Desugared result!
-- | list a section of a source file around a particular SrcSpan.
-- If the highlight flag is True, also highlight the span using
--- start_bold/end_bold.
+-- start_bold\/end_bold.
listAround :: SrcSpan -> Bool -> IO ()
listAround span do_highlight = do
contents <- BS.readFile (unpackFS file)
import Data.Maybe
import Control.Monad
--- | The maximum number of build/spill cycles we'll allow.
+-- | The maximum number of build\/spill cycles we'll allow.
-- We should only need 3 or 4 cycles tops.
-- If we run for any longer than this we're probably in an infinite loop,
-- It's probably better just to bail out and report a bug at this stage.
joinToTargets block_live (block : new_blocks) instr' dests
--- | Construct a graph of register/spill movements.
+-- | Construct a graph of register\/spill movements.
--
-- We cut some corners by
-- a) not handling cyclic components
, raGraphColored :: Color.Graph Reg RegClass Reg -- ^ the coalesced and colored graph
, raCoalesced :: UniqFM Reg -- ^ the regs that were coaleced
, raPatched :: [LiveCmmTop] -- ^ code with vregs replaced by hregs
- , raSpillClean :: [LiveCmmTop] -- ^ code with unneeded spill/reloads cleaned out
+ , raSpillClean :: [LiveCmmTop] -- ^ code with unneeded spill\/reloads cleaned out
, raFinal :: [NatCmmTop] -- ^ final code
- , raSRMs :: (Int, Int, Int) } -- ^ spill/reload/reg-reg moves present in this code
+ , raSRMs :: (Int, Int, Int) } -- ^ spill\/reload\/reg-reg moves present in this code
instance Outputable RegAllocStats where
in vcat [outSpills, outLife, outConflict, outScatter]
--- | Dump a table of how many spill loads / stores were inserted for each vreg.
+-- | Dump a table of how many spill loads \/ stores were inserted for each vreg.
pprStatsSpills
:: [RegAllocStats] -> SDoc
= let
finals = [ s | s@RegAllocStatsColored{} <- stats]
- -- sum up how many stores/loads/reg-reg-moves were left in the code
+ -- sum up how many stores\/loads\/reg-reg-moves were left in the code
total = foldl' addSRM (0, 0, 0)
$ map raSRMs finals
, moves) lis
--- | For spill/reloads
+-- | For spill\/reloads
--
-- SPILL v1, slot1
-- ...
-- RELOAD slot1, v2
--
-- If we can arrange that v1 and v2 are allocated to the same hreg it's more likely
--- the spill/reload instrs can be cleaned and replaced by a nop reg-reg move.
+-- the spill\/reload instrs can be cleaned and replaced by a nop reg-reg move.
--
--
slurpReloadCoalesce :: LiveCmmTop -> Bag (Reg, Reg)
{-# OPTIONS -fno-warn-missing-signatures #-}
--- | Clean out unneeded spill/reload instrs
+-- | Clean out unneeded spill\/reload instrs
--
-- * Handling of join points
--
-- What we really care about here is that on the entry to B3, %r1 will always
-- have the same value that is in SLOT(0) (ie, %r1 is _valid_)
--
--- This also works if the reloads in B1/B2 were spills instead, because
+-- This also works if the reloads in B1\/B2 were spills instead, because
-- spilling %r1 to a slot makes that slot have the same value as %r1.
--
type Slot = Int
--- | Clean out unneeded spill/reloads from this top level thing.
+-- | Clean out unneeded spill\/reloads from this top level thing.
cleanSpills :: LiveCmmTop -> LiveCmmTop
cleanSpills cmm
= evalState (cleanSpin 0 cmm) initCleanS
cleanSpin spinCount code
= do
- -- init count of cleaned spills/reloads
+ -- init count of cleaned spills\/reloads
modify $ \s -> s
{ sCleanedSpillsAcc = 0
, sCleanedReloadsAcc = 0
-- safe to erase reloads after join points for the next pass.
collateJoinPoints
- -- remember how many spills/reloads we cleaned in this pass
+ -- remember how many spills\/reloads we cleaned in this pass
spills <- gets sCleanedSpillsAcc
reloads <- gets sCleanedReloadsAcc
modify $ \s -> s
-- reloaded from on this path.
, sReloadedBy :: UniqFM [BlockId]
- -- spills/reloads cleaned each pass (latest at front)
+ -- spills\/reloads cleaned each pass (latest at front)
, sCleanedCount :: [(Int, Int)]
- -- spills/reloads that have been cleaned in this pass so far.
+ -- spills\/reloads that have been cleaned in this pass so far.
, sCleanedSpillsAcc :: Int
, sCleanedReloadsAcc :: Int }
Notes about wired in things
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-* Wired-in things are Ids/TyCons that are completely known to the compiler.
+* Wired-in things are Ids\/TyCons that are completely known to the compiler.
They are global values in GHC, (e.g. listTyCon :: TyCon).
* A wired in Name contains the thing itself inside the Name:
let left = filter keep ns in
if null left then rest else AvailTC tc left : rest
--- | Given an import/export spec, construct the appropriate 'GlobalRdrElt's.
+-- | Given an import\/export spec, construct the appropriate 'GlobalRdrElt's.
gresFromIE :: ImpDeclSpec -> (LIE Name, AvailInfo) -> [GlobalRdrElt]
gresFromIE decl_spec (L loc ie, avail)
= gresFromAvail prov_fn avail
%
% (c) The GRASP/AQUA Project, Glasgow University, 1993-1998
%
-\section[WwLib]{A library for the ``worker/wrapper'' back-end to the strictness analyser}
+\section[WwLib]{A library for the ``worker\/wrapper'' back-end to the strictness analyser}
\begin{code}
module WwLib ( mkWwBodies, mkWWstr, mkWorkerArgs ) where
\begin{verbatim}
g :: forall a . Int -> [a] -> a
-g = /\ a -> \ x ys ->
+g = \/\ a -> \ x ys ->
case x of
0 -> head ys
_ -> head (tail ys)
-- wrapper (an unfolding)
g :: forall a . Int -> [a] -> a
-g = /\ a -> \ x ys ->
+g = \/\ a -> \ x ys ->
case x of
I# x# -> $wg a x# ys
-- call the worker; don't forget the type args!
-- worker
$wg :: forall a . Int# -> [a] -> a
-$wg = /\ a -> \ x# ys ->
+$wg = \/\ a -> \ x# ys ->
let
x = I# x#
in
%* *
%************************************************************************
-@mkWwBodies@ is called when doing the worker/wrapper split inside a module.
+@mkWwBodies@ is called when doing the worker\/wrapper split inside a module.
\begin{code}
mkWwBodies :: Type -- Type of original function
\item
$alpha$ is the class variable
\item
-$LIE_cop' = LIE_cop [X gammas_bar / alpha, fresh betas_bar]$
+$LIE_cop' = LIE_cop [X gammas_bar \/ alpha, fresh betas_bar]$
\item
-$tau_cop' = tau_cop [X gammas_bar / alpha, fresh betas_bar]$
+$tau_cop' = tau_cop [X gammas_bar \/ alpha, fresh betas_bar]$
\end{enumerate}
ToDo: Update the list above with names actually in the code.
\begin{enumerate}
\item
First, make the LIEs for the class and instance contexts, which means
-instantiate $thetaC [X inst_tyvars / alpha ]$, yielding LIElistC' and LIEC',
+instantiate $thetaC [X inst_tyvars \/ alpha ]$, yielding LIElistC' and LIEC',
and make LIElistI and LIEI.
\item
Then process each method in turn.
* Now abstract over the 'a', but float out the Num (C d a) constraint
because it does not 'really' mention a. (see exactTyVarsOfType)
The arg to foo becomes
- /\a -> \t -> t+t
+ \/\a -> \t -> t+t
* So we get a dict binding for Num (C d a), which is zonked to give
a = ()
quantification, so the floated dict will still have type (C d a).
Which renders this whole note moot; happily!]
-* Then the /\a abstraction has a zonked 'a' in it.
+* Then the \/\a abstraction has a zonked 'a' in it.
All very silly. I think its harmless to ignore the problem. We'll end up with
-a /\a in the final result but all the occurrences of a will be zonked to ()
+a \/\a in the final result but all the occurrences of a will be zonked to ()
Note [Zonking to Skolem]
~~~~~~~~~~~~~~~~~~~~~~~~
pairs -> coalesceGraph' aggressive triv graph' (reverse pairs ++ kkPairsAcc)
--- | Coalesce this pair of nodes unconditionally / agressively.
+-- | Coalesce this pair of nodes unconditionally \/ agressively.
-- The resulting node is the one with the least key.
--
-- returns: Just the pair of keys if the nodes were coalesced
-- classes.. this is just a heuristic, after all.
--
-- IDEA: freezing a node might free it up for Simplify.. would be good to check for triv
--- right here, and add it to a worklist if known triv/non-move nodes.
+-- right here, and add it to a worklist if known triv\/non-move nodes.
--
freezeOneInGraph
:: (Uniquable k, Outputable k)