summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToCmm
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-01-30 08:45:49 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-02-01 12:29:26 -0500
commit88fba8a4b3c22e953a634b81dd0b67ec66eb5e72 (patch)
tree75a46332ad32cfeaf4f4d52b3b60fd452f2493b6 /compiler/GHC/StgToCmm
parent06185102bb06d6d56e00d40172a6a473fc228501 (diff)
downloadhaskell-88fba8a4b3c22e953a634b81dd0b67ec66eb5e72.tar.gz
Fix a few Note inconsistencies
Diffstat (limited to 'compiler/GHC/StgToCmm')
-rw-r--r--compiler/GHC/StgToCmm/Bind.hs7
-rw-r--r--compiler/GHC/StgToCmm/Foreign.hs2
-rw-r--r--compiler/GHC/StgToCmm/Heap.hs2
-rw-r--r--compiler/GHC/StgToCmm/Layout.hs6
-rw-r--r--compiler/GHC/StgToCmm/Monad.hs2
-rw-r--r--compiler/GHC/StgToCmm/Prim.hs3
6 files changed, 10 insertions, 12 deletions
diff --git a/compiler/GHC/StgToCmm/Bind.hs b/compiler/GHC/StgToCmm/Bind.hs
index 3f935c848d..435f55106b 100644
--- a/compiler/GHC/StgToCmm/Bind.hs
+++ b/compiler/GHC/StgToCmm/Bind.hs
@@ -149,7 +149,7 @@ cgBind (StgRec pairs)
; emit (catAGraphs inits <*> body) }
{- Note [cgBind rec]
-
+ ~~~~~~~~~~~~~~~~~
Recursive let-bindings are tricky.
Consider the following pseudocode:
@@ -268,7 +268,7 @@ for semi-obvious reasons.
-}
----------- Note [Selectors] ------------------
+---------- See Note [Selectors] ------------------
mkRhsClosure profile bndr _cc
[NonVoid the_fv] -- Just one free var
upd_flag -- Updatable thunk
@@ -301,7 +301,7 @@ mkRhsClosure profile bndr _cc
let lf_info = mkSelectorLFInfo bndr offset_into_int (isUpdatable upd_flag)
in cgRhsStdThunk bndr lf_info [StgVarArg the_fv]
----------- Note [Ap thunks] ------------------
+---------- See Note [Ap thunks] ------------------
mkRhsClosure profile bndr _cc
fvs
upd_flag
@@ -526,7 +526,6 @@ closureCodeBody top_lvl bndr cl_info cc args@(arg0:_) body fv_details
-- Note [NodeReg clobbered with loopification]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-- Previously we used to pass nodeReg (aka R1) here. With profiling, upon
-- entering a closure, enterFunCCS was called with R1 passed to it. But since R1
-- may get clobbered inside the body of a closure, and since a self-recursive
diff --git a/compiler/GHC/StgToCmm/Foreign.hs b/compiler/GHC/StgToCmm/Foreign.hs
index 4c414df9e9..a1ee175bad 100644
--- a/compiler/GHC/StgToCmm/Foreign.hs
+++ b/compiler/GHC/StgToCmm/Foreign.hs
@@ -127,7 +127,7 @@ cgForeignCall (CCall (CCallSpec target cconv safety)) typ stg_args res_ty
}
{- Note [safe foreign call convention]
-
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The simple thing to do for a safe foreign call would be the same as an
unsafe one: just
diff --git a/compiler/GHC/StgToCmm/Heap.hs b/compiler/GHC/StgToCmm/Heap.hs
index 39a7812b70..ec61ef2406 100644
--- a/compiler/GHC/StgToCmm/Heap.hs
+++ b/compiler/GHC/StgToCmm/Heap.hs
@@ -491,6 +491,7 @@ cannedGCEntryPoint platform regs
_otherwise -> Nothing
-- Note [stg_gc arguments]
+-- ~~~~~~~~~~~~~~~~~~~~~~~
-- It might seem that we could avoid passing the arguments to the
-- stg_gc function, because they are already in the right registers.
-- While this is usually the case, it isn't always. Sometimes the
@@ -670,7 +671,6 @@ do_checks mb_stk_hwm checkYield mb_alloc_lit do_gc = do
-- Note [Self-recursive loop header]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
-- Self-recursive loop header is required by loopification optimization (See
-- Note [Self-recursive tail calls] in GHC.StgToCmm.Expr). We emit it if:
--
diff --git a/compiler/GHC/StgToCmm/Layout.hs b/compiler/GHC/StgToCmm/Layout.hs
index 9e14d1e766..5664be908e 100644
--- a/compiler/GHC/StgToCmm/Layout.hs
+++ b/compiler/GHC/StgToCmm/Layout.hs
@@ -212,7 +212,7 @@ slowCall fun stg_args
" with pat " ++ unpackFS rts_fun)
return r
- -- Note [avoid intermediate PAPs]
+ -- See Note [avoid intermediate PAPs]
let n_args = length stg_args
if n_args > arity && fast_pap
then do
@@ -261,7 +261,7 @@ slowCall fun stg_args
-- Note [avoid intermediate PAPs]
---
+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- A slow call which needs multiple generic apply patterns will be
-- almost guaranteed to create one or more intermediate PAPs when
-- applied to a function that takes the correct number of arguments.
@@ -339,7 +339,7 @@ nonVArgs ((_,Just arg) : args) = arg : nonVArgs args
{-
Note [over-saturated calls]
-
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
The natural thing to do for an over-saturated call would be to call
the function with the correct number of arguments, and then apply the
remaining arguments to the value returned, e.g.
diff --git a/compiler/GHC/StgToCmm/Monad.hs b/compiler/GHC/StgToCmm/Monad.hs
index d8d6600268..5ab12a4634 100644
--- a/compiler/GHC/StgToCmm/Monad.hs
+++ b/compiler/GHC/StgToCmm/Monad.hs
@@ -203,7 +203,7 @@ data ReturnKind
| ReturnedTo BlockId ByteOff
-- Note [sharing continuations]
---
+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ReturnKind says how the expression being compiled returned its
-- results: either by assigning directly to the registers specified
-- by the Sequel, or by returning to a continuation that does the
diff --git a/compiler/GHC/StgToCmm/Prim.hs b/compiler/GHC/StgToCmm/Prim.hs
index 766a6e8a9c..b980c0aacd 100644
--- a/compiler/GHC/StgToCmm/Prim.hs
+++ b/compiler/GHC/StgToCmm/Prim.hs
@@ -74,7 +74,7 @@ cgOpApp :: StgOp -- The op
-- Foreign calls
cgOpApp (StgFCallOp fcall ty) stg_args res_ty
= cgForeignCall fcall ty stg_args res_ty
- -- Note [Foreign call results]
+ -- See Note [Foreign call results]
cgOpApp (StgPrimOp primop) args res_ty = do
cfg <- getStgToCmmConfig
@@ -1716,7 +1716,6 @@ emitPrimOp cfg primop =
alwaysExternal = \_ -> PrimopCmmEmit_External
-- Note [QuotRem optimization]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- --
-- `quot` and `rem` with constant divisor can be implemented with fast bit-ops
-- (shift, .&.).
--