summaryrefslogtreecommitdiff
path: root/compiler/GHC/Stg
diff options
context:
space:
mode:
authorTakenobu Tani <takenobu.hs@gmail.com>2020-06-06 12:07:42 +0900
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-25 03:54:44 -0400
commitc7dd6da7e066872a949be7c914cc700182307cd2 (patch)
treeceae3a095d12be2c44e6e9794277d3e3a5329fc9 /compiler/GHC/Stg
parent90f438724dbc1ef9e4b371034d44170738fe3224 (diff)
downloadhaskell-c7dd6da7e066872a949be7c914cc700182307cd2.tar.gz
Clean up haddock hyperlinks of GHC.* (part1)
This updates haddock comments only. This patch focuses to update for hyperlinks in GHC API's haddock comments, because broken links especially discourage newcomers. This includes the following hierarchies: - GHC.Hs.* - GHC.Core.* - GHC.Stg.* - GHC.Cmm.* - GHC.Types.* - GHC.Data.* - GHC.Builtin.* - GHC.Parser.* - GHC.Driver.* - GHC top
Diffstat (limited to 'compiler/GHC/Stg')
-rw-r--r--compiler/GHC/Stg/CSE.hs4
-rw-r--r--compiler/GHC/Stg/Lift/Monad.hs10
-rw-r--r--compiler/GHC/Stg/Unarise.hs2
3 files changed, 10 insertions, 6 deletions
diff --git a/compiler/GHC/Stg/CSE.hs b/compiler/GHC/Stg/CSE.hs
index d7b0176b71..abe0b6e482 100644
--- a/compiler/GHC/Stg/CSE.hs
+++ b/compiler/GHC/Stg/CSE.hs
@@ -3,6 +3,7 @@
{-|
Note [CSE for Stg]
~~~~~~~~~~~~~~~~~~
+
This module implements a simple common subexpression elimination pass for STG.
This is useful because there are expressions that we want to common up (because
they are operationally equivalent), but that we cannot common up in Core, because
@@ -16,6 +17,7 @@ note [Case 2: CSEing case binders] below.
Note [Case 1: CSEing allocated closures]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
The first kind of CSE opportunity we aim for is generated by this Haskell code:
bar :: a -> (Either Int a, Either Bool a)
@@ -43,6 +45,7 @@ instead.
Note [Case 2: CSEing case binders]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
The second kind of CSE opportunity we aim for is more interesting, and
came up in #9291 and #5344: The Haskell code
@@ -70,6 +73,7 @@ and nothing stops us from transforming that to
Note [StgCse after unarisation]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
Consider two unboxed sum terms:
(# 1 | #) :: (# Int | Int# #)
diff --git a/compiler/GHC/Stg/Lift/Monad.hs b/compiler/GHC/Stg/Lift/Monad.hs
index dcfa0ce644..04a3cbd470 100644
--- a/compiler/GHC/Stg/Lift/Monad.hs
+++ b/compiler/GHC/Stg/Lift/Monad.hs
@@ -156,7 +156,7 @@ instance Outputable FloatLang where
where
(rec, pairs) = decomposeStgBinding bind
--- | Flattens an expression in @['FloatLang']@ into an STG program, see #floats.
+-- | Flattens an expression in @['FloatLang']@ into an STG program, see "GHC.Stg.Lift.Monad#floats".
-- Important pre-conditions: The nesting of opening 'StartBindinGroup's and
-- closing 'EndBindinGroup's is balanced. Also, it is crucial that every binding
-- group has at least one recursive binding inside. Otherwise there's no point
@@ -232,16 +232,16 @@ runLiftM dflags us (LiftM m) = collectFloats (fromOL floats)
addTopStringLit :: OutId -> ByteString -> LiftM ()
addTopStringLit id = LiftM . RWS.tell . unitOL . PlainTopBinding . StgTopStringLit id
--- | Starts a recursive binding group. See #floats# and 'collectFloats'.
+-- | Starts a recursive binding group. See "GHC.Stg.Lift.Monad#floats" and 'collectFloats'.
startBindingGroup :: LiftM ()
startBindingGroup = LiftM $ RWS.tell $ unitOL $ StartBindingGroup
--- | Ends a recursive binding group. See #floats# and 'collectFloats'.
+-- | Ends a recursive binding group. See "GHC.Stg.Lift.Monad#floats" and 'collectFloats'.
endBindingGroup :: LiftM ()
endBindingGroup = LiftM $ RWS.tell $ unitOL $ EndBindingGroup
-- | Lifts a binding to top-level. Depending on whether it's declared inside
--- a recursive RHS (see #floats# and 'collectFloats'), this might be added to
+-- a recursive RHS (see "GHC.Stg.Lift.Monad#floats" and 'collectFloats'), this might be added to
-- an existing recursive top-level binding group.
addLiftedBinding :: OutStgBinding -> LiftM ()
addLiftedBinding = LiftM . RWS.tell . unitOL . LiftedBinding
@@ -289,7 +289,7 @@ withLiftedBndrs :: Traversable f => DIdSet -> f Id -> (f Id -> LiftM a) -> LiftM
withLiftedBndrs abs_ids = runContT . traverse (ContT . withLiftedBndr abs_ids)
-- | Substitutes a binder /occurrence/, which was brought in scope earlier by
--- 'withSubstBndr'\/'withLiftedBndr'.
+-- 'withSubstBndr' \/ 'withLiftedBndr'.
substOcc :: Id -> LiftM Id
substOcc id = LiftM (RWS.asks (lookupIdSubst id . e_subst))
diff --git a/compiler/GHC/Stg/Unarise.hs b/compiler/GHC/Stg/Unarise.hs
index 1cce87248b..aafd28d73b 100644
--- a/compiler/GHC/Stg/Unarise.hs
+++ b/compiler/GHC/Stg/Unarise.hs
@@ -588,7 +588,7 @@ mkUbxSum dc ty_args args0
-- * Literals: 0 or 0.0
-- * Pointers: `ghc-prim:GHC.Prim.Panic.absentSumFieldError`
--
--- See Note [aBSENT_SUM_FIELD_ERROR_ID] in GHC.Core.Make
+-- See Note [aBSENT_SUM_FIELD_ERROR_ID] in "GHC.Core.Make"
--
ubxSumRubbishArg :: SlotTy -> StgArg
ubxSumRubbishArg PtrSlot = StgVarArg aBSENT_SUM_FIELD_ERROR_ID