[Git][ghc/ghc][master] testsuite: fix testsuite run for +ipe again
by Marge Bot (@marge-bot) 09 Apr '26
by Marge Bot (@marge-bot) 09 Apr '26
09 Apr '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
da7e82f4 by Cheng Shao at 2026-04-08T20:54:49-04:00
testsuite: fix testsuite run for +ipe again
This patch makes the +ipe flavour transformer pass the entire
testsuite again by dropping stdout/stderr checks of certain tests that
are sensitive to stack layout changes with `+ipe`. Related: #26799.
- - - - -
2 changed files:
- libraries/ghc-experimental/tests/backtraces/all.T
- libraries/ghc-internal/tests/stack-annotation/all.T
Changes:
=====================================
libraries/ghc-experimental/tests/backtraces/all.T
=====================================
@@ -1,4 +1,4 @@
-stack_annotation_backtrace_opts = [ when(have_profiling(), extra_ways(['prof'])) , when(js_arch(), skip) , exit_code(1) ]
+stack_annotation_backtrace_opts = [ when(have_profiling(), extra_ways(['prof'])), when(ghc_with_ipe(), ignore_stderr), when(js_arch(), skip) , exit_code(1) ]
test('T26806a', stack_annotation_backtrace_opts, compile_and_run, [''])
test('T26806b', stack_annotation_backtrace_opts, compile_and_run, [''])
=====================================
libraries/ghc-internal/tests/stack-annotation/all.T
=====================================
@@ -2,6 +2,7 @@
# and test with profiling way if available (#26507)
ann_frame_opts = [ when(js_arch(), skip)
, when(have_profiling(), extra_ways(['prof']))
+ , when(ghc_with_ipe(), ignore_stdout)
, extra_files(['TestUtils.hs'])]
test('ann_frame001', ann_frame_opts, compile_and_run, [''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/da7e82f466807f86f083b4d1fa4d7a2…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/da7e82f466807f86f083b4d1fa4d7a2…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
09 Apr '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
59391132 by Simon Jakobi at 2026-04-08T20:54:08-04:00
Use upsert for non-deleting map updates
Some compiler functions were using `alter`, despite never removing
any entries: they only update an existing entry or insert a new one.
These functions are converted to using `upsert`:
alter :: (Maybe a -> Maybe a) -> Key -> Map a -> Map a
upsert :: (Maybe a -> a) -> Key -> Map a -> Map a
`upsert` variants are also added to APIs of the various Word64Map
wrapper types.
The precedent for this `upsert` operation is in the containers library:
see https://github.com/haskell/containers/pull/1145
Metrics: compile_time/bytes allocated
-------------------------------------
geo. mean: -0.1%
minimum: -0.5%
maximum: +0.0%
Resolves #27140.
- - - - -
20 changed files:
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/Dataflow/Graph.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/RoughMap.hs
- compiler/GHC/Core/TyCon/Env.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Data/FastString/Env.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Lazy.hs
- compiler/GHC/Data/Word64Map/Strict.hs
- compiler/GHC/Data/Word64Map/Strict/Internal.hs
- compiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Types/Name/Env.hs
- compiler/GHC/Types/Name/Occurrence.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Var/Env.hs
- compiler/GHC/Wasm/ControlFlow/FromCmm.hs
Changes:
=====================================
compiler/GHC/Cmm/CommonBlockElim.hs
=====================================
@@ -307,6 +307,6 @@ groupByInt :: (a -> Int) -> [a] -> [[a]]
groupByInt f xs = nonDetEltsUFM $ List.foldl' go emptyUFM xs
-- See Note [Unique Determinism and code generation]
where
- go m x = alterUFM addEntry m (f x)
+ go m x = strictUpsertUFM addEntry m (f x)
where
- addEntry xs = Just $! maybe [x] (x:) xs
+ addEntry = maybe [x] (x:)
=====================================
compiler/GHC/Cmm/Dataflow/Graph.hs
=====================================
@@ -56,10 +56,10 @@ bodyToBlockList body = mapElems body
addBlock
:: (NonLocal block, HasDebugCallStack)
=> block C C -> LabelMap (block C C) -> LabelMap (block C C)
-addBlock block body = mapAlter add lbl body
+addBlock block body = mapUpsert add lbl body
where
lbl = entryLabel block
- add Nothing = Just block
+ add Nothing = block
add _ = error $ "duplicate label " ++ show lbl ++ " in graph"
=====================================
compiler/GHC/Cmm/Dataflow/Label.hs
=====================================
@@ -38,6 +38,7 @@ module GHC.Cmm.Dataflow.Label
, mapInsertWith
, mapDelete
, mapAlter
+ , mapUpsert
, mapAdjust
, mapUnion
, mapUnions
@@ -207,6 +208,9 @@ mapDelete (Label k) (LM m) = LM (M.delete k m)
mapAlter :: (Maybe v -> Maybe v) -> Label -> LabelMap v -> LabelMap v
mapAlter f (Label k) (LM m) = LM (M.alter f k m)
+mapUpsert :: (Maybe v -> v) -> Label -> LabelMap v -> LabelMap v
+mapUpsert f (Label k) (LM m) = LM (M.upsert f k m)
+
mapAdjust :: (v -> v) -> Label -> LabelMap v -> LabelMap v
mapAdjust f (Label k) (LM m) = LM (M.adjust f k m)
=====================================
compiler/GHC/CmmToAsm/CFG.hs
=====================================
@@ -357,15 +357,14 @@ addImmediateSuccessor weights node follower cfg
-- | Adds a new edge, overwrites existing edges if present
addEdge :: BlockId -> BlockId -> EdgeInfo -> CFG -> CFG
addEdge from to info cfg =
- mapAlter addFromToEdge from $
- mapAlter addDestNode to cfg
+ mapUpsert addFromToEdge from $
+ mapUpsert addDestNode to cfg
where
-- Simply insert the edge into the edge list.
- addFromToEdge Nothing = Just $ mapSingleton to info
- addFromToEdge (Just wm) = Just $ mapInsert to info wm
+ addFromToEdge Nothing = mapSingleton to info
+ addFromToEdge (Just wm) = mapInsert to info wm
-- We must add the destination node explicitly
- addDestNode Nothing = Just $ mapEmpty
- addDestNode n@(Just _) = n
+ addDestNode = fromMaybe mapEmpty
-- | Adds a edge with the given weight to the cfg
@@ -610,11 +609,11 @@ getCfg platform weights graph =
edgelessCfg = mapFromList $ zip (map G.entryLabel blocks) (repeat mapEmpty)
insertEdge :: CFG -> ((BlockId,BlockId),EdgeInfo) -> CFG
insertEdge m ((from,to),weight) =
- mapAlter f from m
+ mapUpsert f from m
where
- f :: Maybe (LabelMap EdgeInfo) -> Maybe (LabelMap EdgeInfo)
- f Nothing = Just $ mapSingleton to weight
- f (Just destMap) = Just $ mapInsert to weight destMap
+ f :: Maybe (LabelMap EdgeInfo) -> LabelMap EdgeInfo
+ f Nothing = mapSingleton to weight
+ f (Just destMap) = mapInsert to weight destMap
getBlockEdges :: CmmBlock -> [((BlockId,BlockId),EdgeInfo)]
getBlockEdges block =
case branch of
=====================================
compiler/GHC/Core/Opt/Simplify/Iteration.hs
=====================================
@@ -4297,7 +4297,7 @@ unconditional-inlining for join points.
postInlineUnconditionally is primarily to push allocation into cold
branches; but a join point doesn't allocate, so that's a non-motivation.
-(DJ2) In mkDupableAlt and mkDupableStrictBind, generate an alterative for /all/
+(DJ2) In mkDupableAlt and mkDupableStrictBind, generate an alternative for /all/
alternatives, /except/ for ones that will definitely inline unconditionally
straight away. (In that case it's silly to make a join point in the first
place; it just takes an extra Simplifier iteration to undo.) This choice is
=====================================
compiler/GHC/Core/RoughMap.hs
=====================================
@@ -39,6 +39,7 @@ import GHC.Types.Name.Env
import Control.Monad (join)
import Data.Data (Data)
+import Data.Maybe (fromMaybe)
import GHC.Utils.Panic
{-
@@ -449,10 +450,9 @@ insertRM [] v rm@(RM {}) =
rm { rm_empty = v `consBag` rm_empty rm }
insertRM (RM_KnownTc k : ks) v rm@(RM {}) =
- rm { rm_known = alterDNameEnv f (rm_known rm) k }
+ rm { rm_known = upsertDNameEnv f (rm_known rm) k }
where
- f Nothing = Just $ (insertRM ks v emptyRM)
- f (Just m) = Just $ (insertRM ks v m)
+ f = insertRM ks v . fromMaybe emptyRM
insertRM (RM_WildCard : ks) v rm@(RM {}) =
rm { rm_wild = insertRM ks v (rm_wild rm) }
=====================================
compiler/GHC/Core/TyCon/Env.hs
=====================================
@@ -19,7 +19,7 @@ module GHC.Core.TyCon.Env (
extendTyConEnv_C, extendTyConEnv_Acc, extendTyConEnv,
extendTyConEnvList, extendTyConEnvList_C,
filterTyConEnv, anyTyConEnv,
- plusTyConEnv, plusTyConEnv_C, plusTyConEnv_CD, plusTyConEnv_CD2, alterTyConEnv,
+ plusTyConEnv, plusTyConEnv_C, plusTyConEnv_CD, plusTyConEnv_CD2, upsertTyConEnv, alterTyConEnv,
lookupTyConEnv, lookupTyConEnv_NF, delFromTyConEnv, delListFromTyConEnv,
elemTyConEnv, mapTyConEnv, disjointTyConEnv,
@@ -29,7 +29,7 @@ module GHC.Core.TyCon.Env (
lookupDTyConEnv,
delFromDTyConEnv, filterDTyConEnv,
mapDTyConEnv, mapMaybeDTyConEnv,
- adjustDTyConEnv, alterDTyConEnv, extendDTyConEnv, foldDTyConEnv
+ adjustDTyConEnv, upsertDTyConEnv, alterDTyConEnv, extendDTyConEnv, foldDTyConEnv
) where
import GHC.Prelude
@@ -57,6 +57,7 @@ mkTyConEnv :: [(TyCon,a)] -> TyConEnv a
mkTyConEnvWith :: (a -> TyCon) -> [a] -> TyConEnv a
nonDetTyConEnvElts :: TyConEnv a -> [a]
alterTyConEnv :: (Maybe a-> Maybe a) -> TyConEnv a -> TyCon -> TyConEnv a
+upsertTyConEnv :: (Maybe a -> a) -> TyConEnv a -> TyCon -> TyConEnv a
extendTyConEnv_C :: (a->a->a) -> TyConEnv a -> TyCon -> a -> TyConEnv a
extendTyConEnv_Acc :: (a->b->b) -> (a->b) -> TyConEnv b -> TyCon -> a -> TyConEnv b
extendTyConEnv :: TyConEnv a -> TyCon -> a -> TyConEnv a
@@ -85,6 +86,7 @@ extendTyConEnv x y z = addToUFM x y z
extendTyConEnvList x l = addListToUFM x l
lookupTyConEnv x y = lookupUFM x y
alterTyConEnv = alterUFM
+upsertTyConEnv = upsertUFM
mkTyConEnv l = listToUFM l
mkTyConEnvWith f = mkTyConEnv . map (\a -> (f a, a))
elemTyConEnv x y = elemUFM x y
@@ -137,6 +139,9 @@ adjustDTyConEnv = adjustUDFM
alterDTyConEnv :: (Maybe a -> Maybe a) -> DTyConEnv a -> TyCon -> DTyConEnv a
alterDTyConEnv = alterUDFM
+upsertDTyConEnv :: (Maybe a -> a) -> DTyConEnv a -> TyCon -> DTyConEnv a
+upsertDTyConEnv = upsertUDFM
+
extendDTyConEnv :: DTyConEnv a -> TyCon -> a -> DTyConEnv a
extendDTyConEnv = addToUDFM
=====================================
compiler/GHC/Core/Unify.hs
=====================================
@@ -2208,10 +2208,10 @@ extendFamEnv tc tys ty = UM $ \state ->
Unifiable (state { um_fam_env = extend (um_fam_env state) tc }, ())
where
extend :: FamSubstEnv -> TyCon -> FamSubstEnv
- extend = alterTyConEnv alter_tm
+ extend = upsertTyConEnv alter_tm
- alter_tm :: Maybe (ListMap TypeMap Type) -> Maybe (ListMap TypeMap Type)
- alter_tm m_elt = Just (alterTM tys (\_ -> Just ty) (m_elt `orElse` emptyTM))
+ alter_tm :: Maybe (ListMap TypeMap Type) -> ListMap TypeMap Type
+ alter_tm m_elt = alterTM tys (\_ -> Just ty) (m_elt `orElse` emptyTM)
umRnBndr2 :: UMEnv -> TyCoVar -> TyCoVar -> UMEnv
umRnBndr2 env v1 v2
=====================================
compiler/GHC/Data/FastString/Env.hs
=====================================
@@ -16,7 +16,7 @@ module GHC.Data.FastString.Env (
extendFsEnv_C, extendFsEnv_Acc, extendFsEnv,
extendFsEnvList, extendFsEnvList_C,
filterFsEnv,
- plusFsEnv, plusFsEnv_C, alterFsEnv,
+ plusFsEnv, plusFsEnv_C, alterFsEnv, upsertFsEnv,
lookupFsEnv, lookupFsEnv_NF, delFromFsEnv, delListFromFsEnv,
elemFsEnv, mapFsEnv, strictMapFsEnv, mapMaybeFsEnv,
nonDetFoldFsEnv,
@@ -46,6 +46,7 @@ type FastStringEnv a = UniqFM FastString a -- Domain is FastString
emptyFsEnv :: FastStringEnv a
mkFsEnv :: [(FastString,a)] -> FastStringEnv a
alterFsEnv :: (Maybe a-> Maybe a) -> FastStringEnv a -> FastString -> FastStringEnv a
+upsertFsEnv :: (Maybe a -> a) -> FastStringEnv a -> FastString -> FastStringEnv a
extendFsEnv_C :: (a->a->a) -> FastStringEnv a -> FastString -> a -> FastStringEnv a
extendFsEnv_Acc :: (a->b->b) -> (a->b) -> FastStringEnv b -> FastString -> a -> FastStringEnv b
extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a
@@ -69,6 +70,7 @@ extendFsEnv x y z = addToUFM x y z
extendFsEnvList x l = addListToUFM x l
lookupFsEnv x y = lookupUFM x y
alterFsEnv = alterUFM
+upsertFsEnv = upsertUFM
mkFsEnv l = listToUFM l
elemFsEnv x y = elemUFM x y
plusFsEnv x y = plusUFM x y
=====================================
compiler/GHC/Data/Word64Map/Internal.hs
=====================================
@@ -98,6 +98,7 @@ module GHC.Data.Word64Map.Internal (
, adjustWithKey
, update
, updateWithKey
+ , upsert
, updateLookupWithKey
, alter
, alterLookup
@@ -941,6 +942,24 @@ updateWithKey f k t@(Tip ky y)
| otherwise = t
updateWithKey _ _ Nil = Nil
+-- | \(O(\min(n,W))\). Update the value at a key or insert a value if the key is
+-- not in the map.
+--
+-- @
+-- let inc = maybe 1 (+1)
+-- upsert inc 100 (fromList [(100,1),(300,2)]) == fromList [(100,2),(300,2)]
+-- upsert inc 200 (fromList [(100,1),(300,2)]) == fromList [(100,1),(200,1),(300,2)]
+-- @
+upsert :: (Maybe a -> a) -> Key -> Word64Map a -> Word64Map a
+upsert f !k t@(Bin p m l r)
+ | nomatch k p m = link k (Tip k (f Nothing)) p t
+ | zero k m = Bin p m (upsert f k l) r
+ | otherwise = Bin p m l (upsert f k r)
+upsert f !k t@(Tip ky y)
+ | k == ky = Tip ky (f (Just y))
+ | otherwise = link k (Tip k (f Nothing)) ky t
+upsert f !k Nil = Tip k (f Nothing)
+
-- | \(O(\min(n,W))\). Lookup and update.
-- The function returns original value, if it is updated.
-- This is different behavior than 'Data.Map.updateLookupWithKey'.
=====================================
compiler/GHC/Data/Word64Map/Lazy.hs
=====================================
@@ -91,6 +91,7 @@ module GHC.Data.Word64Map.Lazy (
, adjustWithKey
, update
, updateWithKey
+ , upsert
, updateLookupWithKey
, alter
, alterLookup
=====================================
compiler/GHC/Data/Word64Map/Strict.hs
=====================================
@@ -109,6 +109,7 @@ module GHC.Data.Word64Map.Strict (
, adjustWithKey
, update
, updateWithKey
+ , upsert
, updateLookupWithKey
, alter
, alterF
=====================================
compiler/GHC/Data/Word64Map/Strict/Internal.hs
=====================================
@@ -111,6 +111,7 @@ module GHC.Data.Word64Map.Strict.Internal (
, adjustWithKey
, update
, updateWithKey
+ , upsert
, updateLookupWithKey
, alter
, alterF
@@ -536,6 +537,24 @@ updateWithKey f !k t =
| otherwise -> t
Nil -> Nil
+-- | \(O(\min(n,W))\). Update the value at a key or insert a value if the key is
+-- not in the map.
+--
+-- @
+-- let inc = maybe 1 (+1)
+-- upsert inc 100 (fromList [(100,1),(300,2)]) == fromList [(100,2),(300,2)]
+-- upsert inc 200 (fromList [(100,1),(300,2)]) == fromList [(100,1),(200,1),(300,2)]
+-- @
+upsert :: (Maybe a -> a) -> Key -> Word64Map a -> Word64Map a
+upsert f !k t@(Bin p m l r)
+ | nomatch k p m = link k (Tip k $! f Nothing) p t
+ | zero k m = Bin p m (upsert f k l) r
+ | otherwise = Bin p m l (upsert f k r)
+upsert f !k t@(Tip ky y)
+ | k == ky = Tip ky $! f (Just y)
+ | otherwise = link k (Tip k (f Nothing)) ky t
+upsert f !k Nil = Tip k $! f Nothing
+
-- | \(O(\min(n,W))\). Lookup and update.
-- The function returns original value, if it is updated.
-- This is different behavior than 'Data.Map.updateLookupWithKey'.
=====================================
compiler/GHC/Tc/Solver/Types.hs
=====================================
@@ -89,15 +89,15 @@ delTcApp :: TcAppMap a -> TyCon -> [Type] -> TcAppMap a
delTcApp m tc tys = adjustDTyConEnv (deleteTM tys) m tc
insertTcApp :: TcAppMap a -> TyCon -> [Type] -> a -> TcAppMap a
-insertTcApp m tc tys ct = alterDTyConEnv alter_tm m tc
+insertTcApp m tc tys ct = upsertDTyConEnv alter_tm m tc
where
- alter_tm mb_tm = Just (insertTM tys ct (mb_tm `orElse` emptyTM))
+ alter_tm mb_tm = insertTM tys ct (mb_tm `orElse` emptyTM)
alterTcApp :: forall a. TcAppMap a -> TyCon -> [Type] -> XT a -> TcAppMap a
-alterTcApp m tc tys upd = alterDTyConEnv alter_tm m tc
+alterTcApp m tc tys upd = upsertDTyConEnv alter_tm m tc
where
- alter_tm :: Maybe (ListMap LooseTypeMap a) -> Maybe (ListMap LooseTypeMap a)
- alter_tm m_elt = Just (alterTM tys upd (m_elt `orElse` emptyTM))
+ alter_tm :: Maybe (ListMap LooseTypeMap a) -> ListMap LooseTypeMap a
+ alter_tm m_elt = alterTM tys upd (m_elt `orElse` emptyTM)
filterTcAppMap :: forall a. (a -> Bool) -> TcAppMap a -> TcAppMap a
filterTcAppMap f m = mapMaybeDTyConEnv one_tycon m
=====================================
compiler/GHC/Types/Name/Env.hs
=====================================
@@ -19,7 +19,7 @@ module GHC.Types.Name.Env (
filterNameEnv, anyNameEnv,
mapMaybeNameEnv,
extendNameEnvListWith,
- plusNameEnv, plusNameEnv_C, plusNameEnv_CD, plusNameEnv_CD2, alterNameEnv,
+ plusNameEnv, plusNameEnv_C, plusNameEnv_CD, plusNameEnv_CD2, alterNameEnv, upsertNameEnv,
plusNameEnvList, plusNameEnvListWith,
lookupNameEnv, lookupNameEnv_NF, delFromNameEnv, delListFromNameEnv,
elemNameEnv, mapNameEnv, disjointNameEnv,
@@ -32,7 +32,10 @@ module GHC.Types.Name.Env (
lookupDNameEnv,
delFromDNameEnv, filterDNameEnv,
mapDNameEnv,
- adjustDNameEnv, alterDNameEnv, extendDNameEnv,
+ adjustDNameEnv,
+ upsertDNameEnv,
+ alterDNameEnv,
+ extendDNameEnv,
eltsDNameEnv, extendDNameEnv_C,
plusDNameEnv_C,
foldDNameEnv,
@@ -107,6 +110,7 @@ mkNameEnvWith :: (a -> Name) -> [a] -> NameEnv a
fromUniqMap :: UniqMap Name a -> NameEnv a
nonDetNameEnvElts :: NameEnv a -> [a]
alterNameEnv :: (Maybe a-> Maybe a) -> NameEnv a -> Name -> NameEnv a
+upsertNameEnv :: (Maybe a -> a) -> NameEnv a -> Name -> NameEnv a
extendNameEnv_C :: (a->a->a) -> NameEnv a -> Name -> a -> NameEnv a
extendNameEnv_Acc :: (a->b->b) -> (a->b) -> NameEnv b -> Name -> a -> NameEnv b
extendNameEnv :: NameEnv a -> Name -> a -> NameEnv a
@@ -141,6 +145,7 @@ extendNameEnvList x l = addListToUFM x l
extendNameEnvListWith f x l = addListToUFM x (map (\a -> (f a, a)) l)
lookupNameEnv x y = lookupUFM x y
alterNameEnv = alterUFM
+upsertNameEnv = upsertUFM
mkNameEnv l = listToUFM l
mkNameEnvWith f = mkNameEnv . map (\a -> (f a, a))
fromUniqMap = mapUFM snd . getUniqMap
@@ -198,6 +203,9 @@ adjustDNameEnv = adjustUDFM
alterDNameEnv :: (Maybe a -> Maybe a) -> DNameEnv a -> Name -> DNameEnv a
alterDNameEnv = alterUDFM
+upsertDNameEnv :: (Maybe a -> a) -> DNameEnv a -> Name -> DNameEnv a
+upsertDNameEnv = upsertUDFM
+
extendDNameEnv :: DNameEnv a -> Name -> a -> DNameEnv a
extendDNameEnv = addToUDFM
=====================================
compiler/GHC/Types/Name/Occurrence.hs
=====================================
@@ -732,7 +732,7 @@ extendOccEnv_Acc f g (MkOccEnv env) (OccName ns s) =
MkOccEnv . extendFsEnv_Acc f' g' env s
where
f' :: a -> UniqFM NameSpace b -> UniqFM NameSpace b
- f' a bs = alterUFM (Just . \ case { Nothing -> g a ; Just b -> f a b }) bs ns
+ f' a bs = upsertUFM (\ case { Nothing -> g a ; Just b -> f a b }) bs ns
g' a = unitUFM ns (g a)
-- | Delete one element from an 'OccEnv'.
=====================================
compiler/GHC/Types/Unique/DFM.hs
=====================================
@@ -32,6 +32,7 @@ module GHC.Types.Unique.DFM (
delListFromUDFM,
adjustUDFM,
adjustUDFM_Directly,
+ upsertUDFM,
alterUDFM,
alterUDFM_L,
mapUDFM,
@@ -451,6 +452,23 @@ alterUDFM f (UDFM m i) k =
inject Nothing = Nothing
inject (Just v) = Just $ TaggedVal v i
+-- | The expression (@'upsertUDFM' f map k@) updates the value at @k@ or inserts
+-- a new value if @k@ is absent.
+--
+-- Like 'alterUDFM', updating an existing entry assigns it the current tag, so it
+-- becomes the newest element in deterministic iteration order.
+upsertUDFM
+ :: Uniquable key
+ => (Maybe elt -> elt) -- ^ How to adjust the element
+ -> UniqDFM key elt -- ^ Old 'UniqDFM'
+ -> key -- ^ @key@ of the element to adjust
+ -> UniqDFM key elt -- ^ New element at @key@ and modified 'UniqDFM'
+upsertUDFM f (UDFM m i) k =
+ UDFM (MS.upsert upsertf (getKey $ getUnique k) m) (i + 1)
+ where
+ upsertf Nothing = TaggedVal (f Nothing) i
+ upsertf (Just (TaggedVal v _)) = TaggedVal (f (Just v)) i
+
-- | The expression (@'alterUDFM_L' f map k@) alters value @x@ at @k@, or absence
-- thereof and returns the new element at @k@ if there is any.
-- 'alterUDFM_L' can be used to insert, delete, or update a value in
=====================================
compiler/GHC/Types/Unique/FM.hs
=====================================
@@ -42,8 +42,9 @@ module GHC.Types.Unique.FM (
addListToUFM,addListToUFM_C,
addToUFM_Directly,
addListToUFM_Directly,
- adjustUFM, alterUFM, alterUFM_L, alterUFM_Directly,
- adjustUFM_Directly,
+ adjustUFM, adjustUFM_Directly,
+ upsertUFM, strictUpsertUFM,
+ alterUFM, alterUFM_L, alterUFM_Directly,
delFromUFM,
delFromUFM_Directly,
delListFromUFM,
@@ -226,6 +227,22 @@ alterUFM
-> UniqFM key elt -- ^ result
alterUFM f (UFM m) k = UFM (M.alter f (getKey $ getUnique k) m)
+upsertUFM
+ :: Uniquable key
+ => (Maybe elt -> elt) -- ^ How to adjust
+ -> UniqFM key elt -- ^ old
+ -> key -- ^ new
+ -> UniqFM key elt -- ^ result
+upsertUFM f (UFM m) k = UFM (M.upsert f (getKey $ getUnique k) m)
+
+strictUpsertUFM
+ :: Uniquable key
+ => (Maybe elt -> elt) -- ^ How to adjust
+ -> UniqFM key elt -- ^ old
+ -> key -- ^ new
+ -> UniqFM key elt -- ^ result
+strictUpsertUFM f (UFM m) k = UFM (MS.upsert f (getKey $ getUnique k) m)
+
alterUFM_L
:: Uniquable key
=> (Maybe elt -> Maybe elt) -- ^ How to adjust
=====================================
compiler/GHC/Types/Var/Env.hs
=====================================
@@ -15,7 +15,7 @@ module GHC.Types.Var.Env (
strictPlusVarEnv, plusVarEnv, plusVarEnv_C,
strictPlusVarEnv_C, strictPlusVarEnv_C_Directly,
plusVarEnv_CD, plusMaybeVarEnv_C,
- plusVarEnvList, alterVarEnv,
+ plusVarEnvList, alterVarEnv, upsertVarEnv,
delVarEnvList, delVarEnv,
minusVarEnv,
lookupVarEnv, lookupVarEnv_NF, lookupWithDefaultVarEnv,
@@ -40,7 +40,7 @@ module GHC.Types.Var.Env (
isEmptyDVarEnv, foldDVarEnv, nonDetStrictFoldDVarEnv,
mapDVarEnv, filterDVarEnv,
modifyDVarEnv,
- alterDVarEnv,
+ alterDVarEnv, upsertDVarEnv,
plusDVarEnv, plusDVarEnv_C,
unitDVarEnv,
delDVarEnv,
@@ -509,6 +509,7 @@ mkVarEnv_Directly :: [(Unique, a)] -> VarEnv a
zipVarEnv :: [Var] -> [a] -> VarEnv a
unitVarEnv :: Var -> a -> VarEnv a
alterVarEnv :: (Maybe a -> Maybe a) -> VarEnv a -> Var -> VarEnv a
+upsertVarEnv :: (Maybe a -> a) -> VarEnv a -> Var -> VarEnv a
extendVarEnv :: VarEnv a -> Var -> a -> VarEnv a
extendVarEnv_C :: (a->a->a) -> VarEnv a -> Var -> a -> VarEnv a
extendVarEnv_Acc :: (a->b->b) -> (a->b) -> VarEnv b -> Var -> a -> VarEnv b
@@ -548,6 +549,7 @@ elemVarEnv = elemUFM
elemVarEnvByKey = elemUFM_Directly
disjointVarEnv = disjointUFM
alterVarEnv = alterUFM
+upsertVarEnv = upsertUFM
extendVarEnv = addToUFM
extendVarEnv_C = addToUFM_C
extendVarEnv_Acc = addToUFM_Acc
@@ -671,6 +673,9 @@ mapMaybeDVarEnv f = mapMaybeUDFM f
alterDVarEnv :: (Maybe a -> Maybe a) -> DVarEnv a -> Var -> DVarEnv a
alterDVarEnv = alterUDFM
+upsertDVarEnv :: (Maybe a -> a) -> DVarEnv a -> Var -> DVarEnv a
+upsertDVarEnv = upsertUDFM
+
plusDVarEnv :: DVarEnv a -> DVarEnv a -> DVarEnv a
plusDVarEnv = plusUDFM
=====================================
compiler/GHC/Wasm/ControlFlow/FromCmm.hs
=====================================
@@ -330,9 +330,9 @@ smartPlus platform e k =
where width = cmmExprWidth platform e
addToList :: ([a] -> [a]) -> Label -> LabelMap [a] -> LabelMap [a]
-addToList consx = mapAlter add
- where add Nothing = Just (consx [])
- add (Just xs) = Just (consx xs)
+addToList consx = mapUpsert add
+ where add Nothing = consx []
+ add (Just xs) = consx xs
------------------------------------------------------------------
--- everything below here is for diagnostics in case of panic
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/59391132fe00a767c42e2a79c1be541…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/59391132fe00a767c42e2a79c1be541…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] Documentation fixes for demand signature notation
by Marge Bot (@marge-bot) 09 Apr '26
by Marge Bot (@marge-bot) 09 Apr '26
09 Apr '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
b7a084cc by Simon Jakobi at 2026-04-08T20:53:27-04:00
Documentation fixes for demand signature notation
Fixes #27115.
- - - - -
3 changed files:
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Types/Demand.hs
- docs/users_guide/using-optimisation.rst
Changes:
=====================================
compiler/GHC/Core/Opt/DmdAnal.hs
=====================================
@@ -1448,7 +1448,7 @@ because it has seen two lambdas, \x and \y. Since the length of the argument
demands in a DmdSig gives the "threshold" for applying the signature
(see Note [DmdSig: demand signatures, and demand-sig arity] in GHC.Types.Demand)
we must trim that DmdType to just
- DmdSig (DmdTypte fvs [x-dmd])
+ DmdSig (DmdType fvs [x-dmd])
when making that DmdType into the DmdSig for f. This trimming is the job of
`mkDmdSigForArity`.
=====================================
compiler/GHC/Types/Demand.hs
=====================================
@@ -510,7 +510,7 @@ type CardNonOnce = Card
-- | Absent, {0}. Pretty-printed as A.
pattern C_00 :: Card
pattern C_00 = Card 0b001
--- | Bottom, {}. Pretty-printed as A.
+-- | Bottom, {}. Pretty-printed as B.
pattern C_10 :: Card
pattern C_10 = Card 0b000
-- | Strict and used once, {1}. Pretty-printed as 1.
@@ -2046,7 +2046,7 @@ gets reached. For example, we don't want to be strict in the strict free
variables of 'rhs'.
So we have the simple definition
- deferAfterPreciseException = lubDmdType (DmdType emptyDmdEnv [] exnDiv)
+ deferAfterPreciseException = lubDmdType (DmdType (DE emptyVarEnv exnDiv) [])
Historically, when we had `lubBoxity = _unboxedWins` (see Note [unboxedWins]),
we had a more complicated definition for deferAfterPreciseException to make sure
@@ -2054,7 +2054,7 @@ it preserved boxity in its argument. That was needed for code like
case <I/O operation> of
(# s', r) -> f x
-which uses `x` *boxed*. If we `lub`bed it with `(DmdType emptyDmdEnv [] exnDiv)`
+which uses `x` *boxed*. If we `lub`bed it with `(DmdType (DE emptyVarEnv exnDiv) [])`
we'd get an *unboxed* demand on `x` (because we let Unboxed win),
which led to #20746. Nowadays with `lubBoxity = boxedWins` we don't need
the complicated definition.
@@ -2191,8 +2191,8 @@ transformer, namely
a single DmdType
(Nevertheless we dignify DmdSig as a distinct type.)
-The DmdSig for an Id is a semantic thing. Suppose a function `f` has a DmdSig of
- DmdSig (DmdType (fv_dmds,res) [d1..dn])
+The DmdSig for an Id is a semantic thing. Suppose a function `f` has a DmdSig of
+ DmdSig (DmdType (DE fv_dmds div) [d1..dn])
Here `n` is called the "demand-sig arity" of the DmdSig. The signature means:
* If you apply `f` to n arguments (the demand-sig-arity)
* then you can unleash demands d1..dn on the arguments
@@ -2206,10 +2206,10 @@ demand, used for signature inference. Therefore we place a top demand on all
arguments.
For example, the demand transformer described by the demand signature
- DmdSig (DmdType {x -> <1L>} <A><1P(L,L)>)
+ <A><1P(L,L)>{x->1L}
says that when the function is applied to two arguments, it
-unleashes demand 1L on the free var x, A on the first arg,
-and 1P(L,L) on the second.
+unleashes demand A on the first arg, 1P(L,L) on the second,
+and 1L on the free var x.
If this same function is applied to one arg, all we can say is that it
uses x with 1L, and its arg with demand 1P(L,L).
@@ -2229,10 +2229,10 @@ was evaluated. Here's an example:
The abstract transformer (let's call it F_e) of the if expression (let's
call it e) would transform an incoming (undersaturated!) head sub-demand A
-into a demand type like {x-><1L>,y-><L>}<L>. In pictures:
+into a demand type like <L>{x->1L,y->L}. In pictures:
SubDemand ---F_e---> DmdType
- <A> {x-><1L>,y-><L>}<L>
+ <A> <L>{x->1L,y->L}
Let's assume that the demand transformers we compute for an expression are
correct wrt. to some concrete semantics for Core. How do demand signatures fit
@@ -2240,7 +2240,7 @@ in? They are strange beasts, given that they come with strict rules when to
it's sound to unleash them.
Fortunately, we can formalise the rules with Galois connections. Consider
-f's strictness signature, {}<1L><L>. It's a single-point approximation of
+f's strictness signature, <1L><L>. It's a single-point approximation of
the actual abstract transformer of f's RHS for arity 2. So, what happens is that
we abstract *once more* from the abstract domain we already are in, replacing
the incoming Demand by a simple lattice with two elements denoting incoming
@@ -2260,8 +2260,8 @@ With
and F_f being the abstract transformer of f's RHS and f_f being the abstracted
abstract transformer computable from our demand signature simply by
- f_f(>=2) = {}<1L><L>
- f_f(<2) = multDmdType C_0N {}<1L><L>
+ f_f(>=2) = <1L><L>
+ f_f(<2) = multDmdType C_0N <1L><L>
where multDmdType makes a proper top element out of the given demand type.
@@ -2283,9 +2283,9 @@ yields a more precise demand type:
incoming sub-demand | demand type
--------------------------------
- P(A) | <L><L>{}
- C(1,C(1,P(L))) | <1P(L)><L>{}
- C(1,C(1,1P(1P(L),A))) | <1P(A)><A>{}
+ P(A) | <L><L>
+ C(1,C(1,P(L))) | <1P(L)><L>
+ C(1,C(1,1P(1P(L),A))) | <1P(A)><A>
Note that in the first example, the depth of the demand type was *higher* than
the arity of the incoming call demand due to the anonymous lambda.
@@ -2743,15 +2743,15 @@ This is the syntax for demand signatures:
| x exnDiv
| b botDiv
- sig ::= {x->dx,y->dy,z->dz...}<d1><d2><d3>...<dn>div
- ^ ^ ^ ^ ^ ^
- | | | | | |
- | \---+---+------/ |
- | | |
- demand on free demand on divergence
- variables arguments information
- (omitted if empty) (omitted if
- no information)
+ sig ::= <d1><d2><d3>...<dn>div{x->dx,y->dy,z->dz...}
+ ^ ^ ^ ^ ^ ^
+ | | | | | |
+ \---+---+------/ | |
+ | | |
+ demand on divergence demand on
+ arguments information free variables
+ (omitted if (omitted if empty)
+ no information)
Note [Demand examples]
~~~~~~~~~~~~~~~~~~~~~~
=====================================
docs/users_guide/using-optimisation.rst
=====================================
@@ -1614,7 +1614,7 @@ as such you shouldn't need to set any of them explicitly. A flag
a polymorphic sub-demand of the same letter: E.g. ``L`` is equivalent to
``LL`` by expansion of the single letter demand, which is equivalent to
``LP(LP(..))``, so ``L``\s all the way down. It is always clear from
- context whether we talk about about a cardinality, sub-demand or demand.
+ context whether we talk about a cardinality, sub-demand or demand.
**Demand signatures**
@@ -1623,15 +1623,15 @@ as such you shouldn't need to set any of them explicitly. A flag
.. code-block:: none
- {x->dx,y->dy,z->dz...}<d1><d2><d3>...<dn>div
- ^ ^ ^ ^ ^ ^
- | | | | | |
- | \---+---+------/ |
- | | |
- demand on free demand on divergence
- variables arguments information
- (omitted if empty) (omitted if
- no information)
+ <d1><d2><d3>...<dn>div{x->dx,y->dy,z->dz...}
+ ^ ^ ^ ^ ^ ^
+ | | | | | |
+ \---+---+------/ | |
+ | | |
+ demand on divergence demand on
+ arguments information free variables
+ (omitted if (omitted if empty)
+ no information)
We summarise ``fst``'s demand properties in its *demand signature*
``<1P(1L,A)>``, which just says "If ``fst`` is applied to one argument,
@@ -1653,11 +1653,14 @@ as such you shouldn't need to set any of them explicitly. A flag
maybe n _ Nothing = n
maybe _ s (Just a) = s a
- We give it demand signature ``<L><MC(M,L)><1L>``. The ``C(M,L)`` is a *call
- sub-demand* that says "Called at most once, where the result is used
- according to ``L``". The expression ``f `seq` f 1`` puts ``f`` under
- demand ``SC(1,L)`` and serves as an example where the upper bound on
- evaluation cardinality doesn't coincide with that of the call cardinality.
+ We give it demand signature ``<ML><MC(1,L)><1L>``. For the second
+ argument, the outer cardinality ``M`` says that it is used at most once
+ overall. If it is used, the *call sub-demand* ``C(1,L)`` says that it is
+ called exactly once and its result is used according to ``L``.
+
+ By contrast, the expression ``f `seq` f 1`` puts ``f`` under demand
+ ``SC(1,L)`` and serves as an example where the upper bound on evaluation
+ cardinality doesn't coincide with that of the call cardinality.
Cardinality is always relative to the enclosing call cardinality, so
``g 1 2 + g 3 4`` puts ``g`` under demand ``SC(S,C(1,L))``, which says
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b7a084ccfbfb5ca8607430f90ef725c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b7a084ccfbfb5ca8607430f90ef725c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] Fix -dsuppress-uniques for free variables in demand signatures
by Marge Bot (@marge-bot) 09 Apr '26
by Marge Bot (@marge-bot) 09 Apr '26
09 Apr '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
5b82080a by Simon Jakobi at 2026-04-08T20:52:44-04:00
Fix -dsuppress-uniques for free variables in demand signatures
Before: Str=b{sXyZ->S}
With this patch: Str=b{S}
T13143.stderr is updated accordingly.
Fixes #27106.
- - - - -
5 changed files:
- compiler/GHC/Types/Demand.hs
- testsuite/tests/dmdanal/should_compile/T13143.stderr
- + testsuite/tests/dmdanal/should_compile/T27106.hs
- + testsuite/tests/dmdanal/should_compile/T27106.stderr
- testsuite/tests/dmdanal/should_compile/all.T
Changes:
=====================================
compiler/GHC/Types/Demand.hs
=====================================
@@ -2830,7 +2830,10 @@ instance Outputable DmdEnv where
= ppr div <> if null fv_elts then empty
else braces (fsep (map pp_elt fv_elts))
where
- pp_elt (uniq, dmd) = ppr uniq <> text "->" <> ppr dmd
+ pp_elt (uniq, dmd) =
+ sdocOption sdocSuppressUniques $ \case
+ True -> ppr dmd
+ False -> ppr uniq <> text "->" <> ppr dmd
fv_elts = nonDetUFMToList fvs
-- It's OK to use nonDetUFMToList here because we only do it for
-- pretty printing
=====================================
testsuite/tests/dmdanal/should_compile/T13143.stderr
=====================================
@@ -1,13 +1,13 @@
==================== Tidy Core ====================
Result size of Tidy Core
- = {terms: 71, types: 40, coercions: 0, joins: 0/0}
+ = {terms: 59, types: 31, coercions: 0, joins: 0/0}
Rec {
-- RHS size: {terms: 4, types: 3, coercions: 0, joins: 0/0}
T13143.$wf [InlPrag=NOINLINE, Occ=LoopBreaker]
:: forall a. (# #) -> a
-[GblId, Arity=1, Str=<B>b{sBX->S}, Cpr=b, Unf=OtherCon []]
+[GblId, Arity=1, Str=<B>b{S}, Cpr=b, Unf=OtherCon []]
T13143.$wf
= \ (@a) _ [Occ=Dead] -> T13143.$wf @a GHC.Internal.Types.(##)
end Rec }
@@ -16,7 +16,7 @@ end Rec }
f [InlPrag=NOINLINE[final]] :: forall a. Int -> a
[GblId,
Arity=1,
- Str=<B>b{sBX->S},
+ Str=<B>b{S},
Cpr=b,
Unf=Unf{Src=StableSystem, TopLvl=True,
Value=True, ConLike=True, WorkFree=True, Expandable=True,
@@ -26,100 +26,58 @@ f [InlPrag=NOINLINE[final]] :: forall a. Int -> a
f = \ (@a) _ [Occ=Dead] -> T13143.$wf @a GHC.Internal.Types.(##)
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
-T13143.$trModule4 :: GHC.Internal.Prim.Addr#
-[GblId,
- Unf=Unf{Src=<vanilla>, TopLvl=True,
- Value=True, ConLike=True, WorkFree=True, Expandable=True,
- Guidance=IF_ARGS [] 20 0}]
-T13143.$trModule4 = "main"#
+$trModule1 :: GHC.Internal.Prim.Addr#
+[GblId, Unf=OtherCon []]
+$trModule1 = "main"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-T13143.$trModule3 :: GHC.Internal.Types.TrName
-[GblId,
- Unf=Unf{Src=<vanilla>, TopLvl=True,
- Value=True, ConLike=True, WorkFree=True, Expandable=True,
- Guidance=IF_ARGS [] 10 10}]
-T13143.$trModule3 = GHC.Internal.Types.TrNameS T13143.$trModule4
+$trModule2 :: GHC.Internal.Types.TrName
+[GblId, Unf=OtherCon []]
+$trModule2 = GHC.Internal.Types.TrNameS $trModule1
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
-T13143.$trModule2 :: GHC.Internal.Prim.Addr#
-[GblId,
- Unf=Unf{Src=<vanilla>, TopLvl=True,
- Value=True, ConLike=True, WorkFree=True, Expandable=True,
- Guidance=IF_ARGS [] 30 0}]
-T13143.$trModule2 = "T13143"#
+$trModule3 :: GHC.Internal.Prim.Addr#
+[GblId, Unf=OtherCon []]
+$trModule3 = "T13143"#
-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
-T13143.$trModule1 :: GHC.Internal.Types.TrName
-[GblId,
- Unf=Unf{Src=<vanilla>, TopLvl=True,
- Value=True, ConLike=True, WorkFree=True, Expandable=True,
- Guidance=IF_ARGS [] 10 10}]
-T13143.$trModule1 = GHC.Internal.Types.TrNameS T13143.$trModule2
+$trModule4 :: GHC.Internal.Types.TrName
+[GblId, Unf=OtherCon []]
+$trModule4 = GHC.Internal.Types.TrNameS $trModule3
-- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0}
-T13143.$trModule :: GHC.Internal.Types.Module
-[GblId,
- Unf=Unf{Src=<vanilla>, TopLvl=True,
- Value=True, ConLike=True, WorkFree=True, Expandable=True,
- Guidance=IF_ARGS [] 10 10}]
-T13143.$trModule
- = GHC.Internal.Types.Module T13143.$trModule3 T13143.$trModule1
+T13143.$trModule [InlPrag=[~]] :: GHC.Internal.Types.Module
+[GblId, Unf=OtherCon []]
+T13143.$trModule = GHC.Internal.Types.Module $trModule2 $trModule4
--- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0}
lvl :: Int
-[GblId, Str=b{sBX->S}, Cpr=b]
-lvl = T13143.$wf @Int GHC.Internal.Types.(##)
+[GblId, Unf=OtherCon []]
+lvl = GHC.Internal.Types.I# 1#
+
+-- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
+lvl1 :: Int
+[GblId, Str=b{S}, Cpr=b]
+lvl1 = T13143.$wf @Int GHC.Internal.Types.(##)
Rec {
-- RHS size: {terms: 28, types: 7, coercions: 0, joins: 0/0}
-T13143.$wg [InlPrag=[2], Occ=LoopBreaker]
- :: Bool -> Bool -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int#
-[GblId[StrictWorker([!, !])],
- Arity=3,
- Str=<1L><1L><L>,
- Unf=OtherCon []]
-T13143.$wg
- = \ (ds :: Bool) (ds1 :: Bool) (ww :: GHC.Internal.Prim.Int#) ->
+g [Occ=LoopBreaker] :: Bool -> Bool -> Int -> Int
+[GblId, Arity=3, Str=<1L><1L><L>, Unf=OtherCon []]
+g = \ (ds :: Bool) (ds1 :: Bool) (p :: Int) ->
case ds of {
False ->
case ds1 of {
- False ->
- T13143.$wg GHC.Internal.Types.False GHC.Internal.Types.True ww;
- True -> GHC.Internal.Prim.+# ww 1#
+ False -> g GHC.Internal.Types.False GHC.Internal.Types.True p;
+ True -> + @Int GHC.Internal.Num.$fNumInt p lvl
};
True ->
case ds1 of {
- False ->
- T13143.$wg GHC.Internal.Types.True GHC.Internal.Types.True ww;
- True -> case lvl of {}
+ False -> g GHC.Internal.Types.True GHC.Internal.Types.True p;
+ True -> lvl1
}
}
end Rec }
--- RHS size: {terms: 14, types: 6, coercions: 0, joins: 0/0}
-g [InlPrag=[2]] :: Bool -> Bool -> Int -> Int
-[GblId,
- Arity=3,
- Str=<1L><1L><1!P(L)>,
- Cpr=1,
- Unf=Unf{Src=StableSystem, TopLvl=True,
- Value=True, ConLike=True, WorkFree=True, Expandable=True,
- Guidance=ALWAYS_IF(arity=3,unsat_ok=True,boring_ok=False)
- Tmpl= \ (ds [Occ=Once1] :: Bool)
- (ds1 [Occ=Once1] :: Bool)
- (p [Occ=Once1!] :: Int) ->
- case p of { GHC.Internal.Types.I# ww [Occ=Once1] ->
- case T13143.$wg ds ds1 ww of ww1 [Occ=Once1] { __DEFAULT ->
- GHC.Internal.Types.I# ww1
- }
- }}]
-g = \ (ds :: Bool) (ds1 :: Bool) (p :: Int) ->
- case p of { GHC.Internal.Types.I# ww ->
- case T13143.$wg ds ds1 ww of ww1 { __DEFAULT ->
- GHC.Internal.Types.I# ww1
- }
- }
-
=====================================
testsuite/tests/dmdanal/should_compile/T27106.hs
=====================================
@@ -0,0 +1,5 @@
+module T27106 where
+
+{-# NOINLINE weird #-}
+weird :: Int -> a
+weird x = weird x
=====================================
testsuite/tests/dmdanal/should_compile/T27106.stderr
=====================================
@@ -0,0 +1,4 @@
+weird [InlPrag=NOINLINE[final]] :: forall a. Int -> a
+[GblId,
+ Arity=1,
+ Str=<B>b{S},
=====================================
testsuite/tests/dmdanal/should_compile/all.T
=====================================
@@ -45,6 +45,13 @@ test('T13077a', normal, compile, [''])
# T13143: WW for NOINLINE function f
test('T13143', [ grep_errmsg(r'^T13143\.\$wf') ], compile, ['-ddump-simpl -dsuppress-uniques'])
+# Uniques in the free variable part of a demand signature should be
+# suppressed by -dsuppress-uniques.
+test('T27106', normal, multimod_compile_filter,
+ ['T27106',
+ '-v0 -O -ddump-simpl -dsuppress-uniques',
+ r"sed -n '/^weird /,/.* Str=/p'"])
+
# T15627
# Absent bindings of unlifted types should be WW'ed away.
# The idea is to check that both $wmutVar and $warray
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5b82080a3f3dd476e198130218d4da7…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5b82080a3f3dd476e198130218d4da7…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] 2 commits: doc: improve eventlog-flush-interval flag documentation
by Marge Bot (@marge-bot) 09 Apr '26
by Marge Bot (@marge-bot) 09 Apr '26
09 Apr '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
e841931c by Teo Camarasu at 2026-04-08T20:52:00-04:00
doc: improve eventlog-flush-interval flag documentation
We mention the performance cost and how this flag can be turned off.
Resolves #27056
- - - - -
e332db25 by Teo Camarasu at 2026-04-08T20:52:01-04:00
docs/user_guide: fix typo
- - - - -
1 changed file:
- docs/users_guide/runtime_control.rst
Changes:
=====================================
docs/users_guide/runtime_control.rst
=====================================
@@ -1331,7 +1331,7 @@ When the program is linked with the :ghc-flag:`-eventlog` option
package.
Each event is associated with a timestamp which is the number of
- nanoseconds since the start of executation of the running program.
+ nanoseconds since the start of execution of the running program.
This is the elapsed time, not the CPU time.
.. rts-flag:: -ol⟨filename⟩
@@ -1352,6 +1352,12 @@ When the program is linked with the :ghc-flag:`-eventlog` option
This can be useful in live-monitoring situations where the
eventlog is consumed in real-time by another process.
+ Flushing the eventlog requires synchronising all capabilities,
+ which can be lead to performance regressions in highly parallel
+ applications.
+
+ To disable this flag set ⟨seconds⟩ to 0.
+
.. rts-flag:: -v [⟨flags⟩]
Log events as text to standard output, instead of to the
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0a83b95b436c5a47deb07e96c45f6c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0a83b95b436c5a47deb07e96c45f6c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] testsuite: Allow multiple ways to be run by setting multiple command-line options
by Marge Bot (@marge-bot) 09 Apr '26
by Marge Bot (@marge-bot) 09 Apr '26
09 Apr '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
0a83b95b by ARATA Mizuki at 2026-04-08T20:51:18-04:00
testsuite: Allow multiple ways to be run by setting multiple command-line options
This patch allows multiple `--test-way`s to take effect, like:
$ hadrian/build test --test-way=normal --test-way=llvm
Previously, only one way was run if the test speed was 'normal' or 'fast'.
Closes #26926
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
- - - - -
1 changed file:
- testsuite/driver/testlib.py
Changes:
=====================================
testsuite/driver/testlib.py
=====================================
@@ -1619,14 +1619,28 @@ async def test_common_work(name: TestName, opts,
# Which ways we are asked to skip
do_ways = list(filter (ok_way,all_ways))
- # Only run all ways in slow mode.
- # See Note [validate and testsuite speed] in `validate`
if config.accept:
- # Only ever run one way
- do_ways = do_ways[:1]
+ # For --accept, run the normal way and in each way that has a
+ # way-specific expected output file (e.g. T20696.stderr-ext-interp).
+ def has_way_specific_output(way: WayName) -> bool:
+ for ext in ['stdout', 'stderr']:
+ path = in_srcdir(name + '.' + ext + '-' + way)
+ if path.exists():
+ return True
+ return False
+ way_specific_ways = list(filter(has_way_specific_output, do_ways))
+ do_ways = do_ways[:1] + [w for w in way_specific_ways if w not in do_ways[:1]]
+
+ # If speed=SLOW, we run all ways.
+ # If speed=NORMAL or FAST and at least one command-line way is given,
+ # we run all the command-line ways.
+ elif config.cmdline_ways:
+ pass
+
+ # Otherwise, we trim it down to:
+ # - a single default way (typically 'normal')
+ # - and, additionally, the test's extra ways.
elif config.speed > 0:
- # However, if we EXPLICITLY asked for a way (with extra_ways)
- # please test it!
explicit_ways = list(filter(lambda way: way in opts.extra_ways, do_ways))
other_ways = list(filter(lambda way: way not in opts.extra_ways, do_ways))
do_ways = other_ways[:1] + explicit_ways
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0a83b95b436c5a47deb07e96c45f6c2…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0a83b95b436c5a47deb07e96c45f6c2…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] hadrian: Don't include the package hash in the haddock directory
by Marge Bot (@marge-bot) 09 Apr '26
by Marge Bot (@marge-bot) 09 Apr '26
09 Apr '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
07267f79 by Zubin Duggal at 2026-04-08T20:50:25-04:00
hadrian: Don't include the package hash in the haddock directory
Since GHC 9.8 and hash_unit_ids, haddock urls have looked like`ghc-9.10.3/doc/html/libraries/base-4.20.2.0-39f9/**/*.html`
The inclusion of the hash makes it hard for downstream non-boot packages to properly link to these files, as the hash is not
part of a standard cabal substitution.
Since we only build one version of each package, we don't need the hash to disambiguate anything, we can just remove it.
Fixes #26635
- - - - -
4 changed files:
- hadrian/bindist/Makefile
- hadrian/src/CommandLine.hs
- hadrian/src/Context.hs
- hadrian/src/Settings/Builders/Cabal.hs
Changes:
=====================================
hadrian/bindist/Makefile
=====================================
@@ -205,7 +205,7 @@ update_package_db: install_bin install_lib
$(INSTALL_DATA) mk/system-cxx-std-lib-1.0.conf "$(DESTDIR)$(ActualLibsDir)/package.conf.d"
@echo "Updating the package DB"
$(foreach p, $(PKG_CONFS),\
- $(call patchpackageconf,$(shell echo $(notdir $p) | sed 's/-[0-9.]*-[0-9a-zA-Z]*\.conf//g'),$(shell echo "$p" | sed 's:\0xxx\0: :g'),$(docdir),$(shell mk/relpath.sh "$(ActualLibsDir)" "$(docdir)"),$(shell echo $(notdir $p) | sed 's/.conf//g')))
+ $(call patchpackageconf,$(shell echo $(notdir $p) | sed 's/-[0-9.]*-[0-9a-zA-Z]*\.conf//g'),$(shell echo "$p" | sed 's:\0xxx\0: :g'),$(docdir),$(shell mk/relpath.sh "$(ActualLibsDir)" "$(docdir)"),$(shell echo $(notdir $p) | sed 's/-[0-9a-zA-Z]*\.conf$$//')))
'$(DESTDIR)$(ActualBinsDir)/$(CrossCompilePrefix)ghc-pkg' --global-package-db "$(DESTDIR)$(ActualLibsDir)/package.conf.d" recache
.PHONY: install_mingw
=====================================
hadrian/src/CommandLine.hs
=====================================
@@ -115,7 +115,7 @@ data DocArgs = DocArgs
} deriving (Eq, Show)
defaultDocArgs :: DocArgs
-defaultDocArgs = DocArgs { docsBaseUrl = "../%pkgid%" }
+defaultDocArgs = DocArgs { docsBaseUrl = "../%pkg%" }
readConfigure :: Either String (CommandLineArgs -> CommandLineArgs)
readConfigure = Left "hadrian --configure has been deprecated (see #20167). Please run ./boot; ./configure manually"
=====================================
hadrian/src/Context.hs
=====================================
@@ -120,7 +120,9 @@ pkgSetupConfigFile context = pkgSetupConfigDir context <&> (-/- "setup-config")
pkgHaddockFile :: Context -> Action FilePath
pkgHaddockFile Context {..} = do
root <- buildRoot
- version <- pkgUnitId stage package
+ -- We don't want to use the hash in the html documentation because it
+ -- makes it harder for non-boot packages to link to boot packages, see #26635
+ version <- pkgSimpleIdentifier package
return $ root -/- "doc/html/libraries" -/- version -/- pkgName package <.> "haddock"
-- | Path to the registered ghc-pkg library file of a given 'Context', e.g.:
=====================================
hadrian/src/Settings/Builders/Cabal.hs
=====================================
@@ -83,6 +83,9 @@ commonCabalArgs :: Stage -> Args
commonCabalArgs stage = do
pkg <- getPackage
package_id <- expr $ pkgUnitId stage pkg
+ -- We don't want to use the hash in the html documentation because it
+ -- makes it harder for non-boot packages to link to boot packages, see #26635
+ package_simple_id <- expr $ pkgSimpleIdentifier pkg
let prefix = "${pkgroot}" ++ (if windowsHost then "" else "/..")
mconcat [ -- Don't strip libraries when cross compiling.
-- TODO: We need to set @--with-strip=(stripCmdPath :: Action FilePath)@,
@@ -110,7 +113,7 @@ commonCabalArgs stage = do
--
-- This doesn't hold if we move the @doc@ folder anywhere else.
, arg "--htmldir"
- , arg $ "${pkgroot}/../../doc/html/libraries/" ++ package_id
+ , arg $ "${pkgroot}/../../doc/html/libraries/" ++ package_simple_id
-- These trigger a need on each dependency, so every important to need
-- them in parallel or it linearises the build of Ghc and GhcPkg
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/07267f79d91169f474cacc8bcd38d76…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/07267f79d91169f474cacc8bcd38d76…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
4a122bb6 by Phil Hazelden at 2026-04-08T20:49:42-04:00
Implement modifiers syntax.
The `%m` syntax of linear types is now accepted in more places, to allow
use by future extensions, though so far linear types is still the only
consumer.
This may break existing code where it
* Uses -XLinearTypes.
* Has code of the form `a %m -> b`, where `m` can't be inferred to be
kind Multiplicity.
The code can be fixed either by adding a kind annotation, or by setting
`-XLinearTypes -XNoModifiers`.
Proposal:
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0370-m…
- - - - -
165 changed files:
- compiler/GHC/Core/Multiplicity.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Decls/Foreign.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/Language/Haskell/Syntax/Type.hs
- docs/users_guide/9.16.1-notes.rst
- docs/users_guide/exts/linear_types.rst
- + docs/users_guide/exts/modifiers.rst
- docs/users_guide/exts/syntax.rst
- docs/users_guide/using-warnings.rst
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- testsuite/tests/driver/T4437.hs
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.hs
- testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.stderr
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/linear/should_compile/Linear1Rule.hs
- testsuite/tests/linear/should_compile/MultConstructor.hs
- testsuite/tests/linear/should_compile/NonLinearRecord.hs
- testsuite/tests/linear/should_compile/OldList.hs
- testsuite/tests/linear/should_compile/T19400.hs
- testsuite/tests/linear/should_compile/T22546.hs
- testsuite/tests/linear/should_compile/T23025.hs
- testsuite/tests/linear/should_compile/T26332.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.stderr
- testsuite/tests/linear/should_fail/LinearLet10.hs
- testsuite/tests/linear/should_fail/LinearLet10.stderr
- testsuite/tests/linear/should_fail/LinearPartialSig.hs
- testsuite/tests/linear/should_fail/LinearPartialSig.stderr
- testsuite/tests/linear/should_fail/LinearRole.hs
- + testsuite/tests/linear/should_fail/LinearUnknownModifierKind.hs
- + testsuite/tests/linear/should_fail/LinearUnknownModifierKind.stderr
- testsuite/tests/linear/should_fail/LinearVar.hs
- testsuite/tests/linear/should_fail/LinearVar.stderr
- testsuite/tests/linear/should_fail/T18888_datakinds.hs
- testsuite/tests/linear/should_fail/T18888_datakinds.stderr
- testsuite/tests/linear/should_fail/T19361.hs
- testsuite/tests/linear/should_fail/T19361.stderr
- testsuite/tests/linear/should_fail/T20083.hs
- testsuite/tests/linear/should_fail/T20083.stderr
- testsuite/tests/linear/should_fail/T21278.hs
- testsuite/tests/linear/should_fail/T21278.stderr
- + testsuite/tests/linear/should_fail/TooManyMultiplicities.hs
- + testsuite/tests/linear/should_fail/TooManyMultiplicities.stderr
- + testsuite/tests/linear/should_fail/TooManyMultiplicitiesU.hs
- + testsuite/tests/linear/should_fail/TooManyMultiplicitiesU.stderr
- testsuite/tests/linear/should_fail/all.T
- + testsuite/tests/modifiers/Makefile
- + testsuite/tests/modifiers/should_compile/LinearNoModifiers.hs
- + testsuite/tests/modifiers/should_compile/Makefile
- + testsuite/tests/modifiers/should_compile/Modifier1Linear.hs
- + testsuite/tests/modifiers/should_compile/Modifier1Linear.stderr
- + testsuite/tests/modifiers/should_compile/Modifiers.hs
- + testsuite/tests/modifiers/should_compile/Modifiers.stderr
- + testsuite/tests/modifiers/should_compile/ModifiersSuggestLinear.hs
- + testsuite/tests/modifiers/should_compile/ModifiersSuggestLinear.stderr
- + testsuite/tests/modifiers/should_compile/all.T
- + testsuite/tests/modifiers/should_fail/Makefile
- + testsuite/tests/modifiers/should_fail/ModifiersExprUnexpectedInQuote.hs
- + testsuite/tests/modifiers/should_fail/ModifiersExprUnexpectedInQuote.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersForbiddenHere.hs
- + testsuite/tests/modifiers/should_fail/ModifiersForbiddenHere.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersNoExt.hs
- + testsuite/tests/modifiers/should_fail/ModifiersNoExt.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersUnexpectedInQuote.hs
- + testsuite/tests/modifiers/should_fail/ModifiersUnexpectedInQuote.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersUnknownKind.hs
- + testsuite/tests/modifiers/should_fail/ModifiersUnknownKind.stderr
- + testsuite/tests/modifiers/should_fail/all.T
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T18834a.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/parser/should_fail/T19928.stderr
- testsuite/tests/printer/Makefile
- + testsuite/tests/printer/PprModifiers.hs
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20315.hs
- testsuite/tests/printer/Test20315.stderr
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/printer/all.T
- testsuite/tests/rename/should_compile/T22478a.hs
- testsuite/tests/typecheck/no_skolem_info/T20232.hs
- testsuite/tests/typecheck/no_skolem_info/T20232.stderr
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Interface/RenameType.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- utils/haddock/html-test/src/LinearTypes.hs
- utils/haddock/latex-test/src/LinearTypes/LinearTypes.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4a122bb68f515af580b4fa07217a085…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4a122bb68f515af580b4fa07217a085…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
08 Apr '26
Simon Peyton Jones pushed to branch wip/spj-reinstallable-base at Glasgow Haskell Compiler / GHC
Commits:
0a2dbd93 by Simon Peyton Jones at 2026-04-09T00:18:12+01:00
More
- - - - -
16 changed files:
- compiler/GHC/Builtin/KnownKeys.hs
- compiler/GHC/Builtin/KnownOccs.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- libraries/base/src/GHC/KnownKeyNames.hs
- libraries/ghc-internal/src/GHC/Internal/IO.hs
- libraries/ghc-internal/src/GHC/Internal/Read.hs
- libraries/ghc-internal/src/GHC/Internal/Real.hs
- libraries/ghc-internal/src/GHC/Internal/Types.hs
Changes:
=====================================
compiler/GHC/Builtin/KnownKeys.hs
=====================================
@@ -177,7 +177,7 @@ wired in ones are defined in GHC.Builtin.Types etc.
basicKnownKeyTable :: [(OccName, KnownKey)]
basicKnownKeyTable
- = [ (rationalTyConOcc, rationalTyConKey)
+ = [ (mkTcOcc "Read", readClassKey)
, (mkTcOcc "Show", showClassKey)
, (mkTcOcc "Foldable", foldableClassKey)
, (mkTcOcc "Traversable", traversableClassKey)
@@ -213,15 +213,22 @@ basicKnownKeyTable
, (mkTcOcc "Real", realClassKey)
, (mkTcOcc "Fractional", fractionalClassKey)
, (mkTcOcc "RealFloat", realFloatClassKey)
--- , (mkTcOcc "RealFrac", realFracClassKey)
+ , (mkTcOcc "RealFrac", realFracClassKey)
, (mkVarOcc "-", minusClassOpKey)
, (mkVarOcc "negate", negateClassOpKey)
, (mkVarOcc "fromInteger", fromIntegerClassOpKey)
+ , (mkVarOcc "divInt#", divIntIdKey)
+ , (mkVarOcc "modInt#", modIntIdKey)
+
+ , (mkTcOcc "Ratio", ratioTyConKey)
+ , (mkDataOcc ":%", ratioDataConKey)
+ , (mkVarOcc "fromIntegral", fromIntegralIdKey)
, (mkVarOcc "fromRational", fromRationalClassOpKey)
+ , (mkVarOcc "toInteger", toIntegerClassOpKey)
+ , (mkVarOcc "toRational", toRationalClassOpKey)
+ , (mkVarOcc "realToFrac", realToFracIdKey)
, (mkVarOcc "mkRationalBase2", mkRationalBase2IdKey)
, (mkVarOcc "mkRationalBase10", mkRationalBase10IdKey)
- , (mkVarOcc "divInt#", divIntIdKey)
- , (mkVarOcc "modInt#", modIntIdKey)
-- Class Functor
, (mkTcOcc "Functor", functorClassKey)
@@ -297,19 +304,23 @@ basicKnownKeyTable
, (mkVarOcc "fromStaticPtr", fromStaticPtrClassOpKey)
, (mkVarOcc "makeStatic", makeStaticKey)
+ -- WithDict
+ , (mkTcOcc "WithDict", withDictClassKey)
+
-- Unsatisfiable class
, (mkTcOcc "Unsatisfiable", unsatisfiableClassKey)
, (mkVarOcc "unsatisfiable", unsatisfiableIdKey)
+
-- Known-key names that have BuiltinRules in ConstantFold
, (mkVarOcc "unpackFoldrCString#", unpackCStringFoldrIdKey)
, (mkVarOcc "unpackFoldrCStringUtf8#", unpackCStringFoldrUtf8IdKey)
, (mkVarOcc "unpackAppendCString#", unpackCStringAppendIdKey)
, (mkVarOcc "unpackAppendCStringUtf8#", unpackCStringAppendUtf8IdKey)
, (mkVarOcc "cstringLength#", cstringLengthIdKey)
-
, (mkVarOcc "eqString", eqStringIdKey)
, (mkVarOcc "inline", inlineIdKey)
+ , (mkVarOcc "seq#", seqHashKey)
-- Unsafe equality proofs
, (mkVarOcc "unsafeEqualityProof", unsafeEqualityProofIdKey)
@@ -387,60 +398,19 @@ basicKnownKeyNames
runMainIOName,
runRWName,
- -- Type representation types
- trModuleTyConName, trModuleDataConName,
- trNameSDataConName,
- trTyConTyConName, trTyConDataConName,
-
- -- Typeable
- someTypeRepTyConName, -- known-occ
- someTypeRepDataConName, -- ditto
- kindRepTyConName,
- kindRepTyConAppDataConName,
- kindRepVarDataConName,
- kindRepAppDataConName,
- kindRepFunDataConName,
- kindRepTYPEDataConName,
- kindRepTypeLitSDataConName,
- typeLitSymbolDataConName,
- typeLitNatDataConName,
- typeLitCharDataConName,
- typeRepIdName,
- mkTrConName,
- mkTrAppCheckedName,
- mkTrFunName,
- typeSymbolTypeRepName, typeNatTypeRepName, typeCharTypeRepName,
- trGhcPrimModuleName,
-
-- KindReps for common cases
+ trGhcPrimModuleName,
starKindRepName,
starArrStarKindRepName,
starArrStarArrStarKindRepName,
constraintKindRepName,
- -- WithDict
- withDictClassName,
-
- -- seq#
- seqHashName,
-
- -- Dynamic
- toDynName,
-
- -- Conversion functions
- ratioTyConName, ratioDataConName,
- toIntegerName, toRationalName,
- fromIntegralName, realToFracName,
-
-- String stuff
fromStringName,
-- Monad stuff
bindMName,
- -- Read stuff
- readClassName,
-
-- Stable pointers
newStablePtrName,
@@ -871,17 +841,6 @@ bniVarQual str key = varQual gHC_INTERNAL_NUM_INTEGER (fsLit str) key
---------------------------------
-- GHC.Internal.Real types and classes
-ratioTyConName, ratioDataConName,
- fromRationalName, toIntegerName, toRationalName, fromIntegralName,
- realToFracName :: Name
-ratioTyConName = tcQual gHC_INTERNAL_REAL (fsLit "Ratio") ratioTyConKey
-ratioDataConName = dcQual gHC_INTERNAL_REAL (fsLit ":%") ratioDataConKey
-fromRationalName = varQual gHC_INTERNAL_REAL (fsLit "fromRational") fromRationalClassOpKey
-toIntegerName = varQual gHC_INTERNAL_REAL (fsLit "toInteger") toIntegerClassOpKey
-toRationalName = varQual gHC_INTERNAL_REAL (fsLit "toRational") toRationalClassOpKey
-fromIntegralName = varQual gHC_INTERNAL_REAL (fsLit "fromIntegral")fromIntegralIdKey
-realToFracName = varQual gHC_INTERNAL_REAL (fsLit "realToFrac") realToFracIdKey
-
-- other GHC.Internal.Float functions
integerToFloatName, integerToDoubleName,
rationalToFloatName, rationalToDoubleName :: Name
@@ -890,71 +849,12 @@ integerToDoubleName = varQual gHC_INTERNAL_FLOAT (fsLit "integerToDouble#") int
rationalToFloatName = varQual gHC_INTERNAL_FLOAT (fsLit "rationalToFloat#") rationalToFloatIdKey
rationalToDoubleName = varQual gHC_INTERNAL_FLOAT (fsLit "rationalToDouble#") rationalToDoubleIdKey
--- Typeable representation types
-trModuleTyConName
- , trModuleDataConName
- , trNameSDataConName
- , trTyConTyConName
- , trTyConDataConName
- :: Name
-trModuleTyConName = tcQual gHC_TYPES (fsLit "Module") trModuleTyConKey
-trModuleDataConName = dcQual gHC_TYPES (fsLit "Module") trModuleDataConKey
-trNameSDataConName = dcQual gHC_TYPES (fsLit "TrNameS") trNameSDataConKey
-trTyConTyConName = tcQual gHC_TYPES (fsLit "TyCon") trTyConTyConKey
-trTyConDataConName = dcQual gHC_TYPES (fsLit "TyCon") trTyConDataConKey
-
-kindRepTyConName
- , kindRepTyConAppDataConName
- , kindRepVarDataConName
- , kindRepAppDataConName
- , kindRepFunDataConName
- , kindRepTYPEDataConName
- , kindRepTypeLitSDataConName
- :: Name
-kindRepTyConName = tcQual gHC_TYPES (fsLit "KindRep") kindRepTyConKey
-kindRepTyConAppDataConName = dcQual gHC_TYPES (fsLit "KindRepTyConApp") kindRepTyConAppDataConKey
-kindRepVarDataConName = dcQual gHC_TYPES (fsLit "KindRepVar") kindRepVarDataConKey
-kindRepAppDataConName = dcQual gHC_TYPES (fsLit "KindRepApp") kindRepAppDataConKey
-kindRepFunDataConName = dcQual gHC_TYPES (fsLit "KindRepFun") kindRepFunDataConKey
-kindRepTYPEDataConName = dcQual gHC_TYPES (fsLit "KindRepTYPE") kindRepTYPEDataConKey
-kindRepTypeLitSDataConName = dcQual gHC_TYPES (fsLit "KindRepTypeLitS") kindRepTypeLitSDataConKey
-
-typeLitSymbolDataConName
- , typeLitNatDataConName
- , typeLitCharDataConName
- :: Name
-typeLitSymbolDataConName = dcQual gHC_TYPES (fsLit "TypeLitSymbol") typeLitSymbolDataConKey
-typeLitNatDataConName = dcQual gHC_TYPES (fsLit "TypeLitNat") typeLitNatDataConKey
-typeLitCharDataConName = dcQual gHC_TYPES (fsLit "TypeLitChar") typeLitCharDataConKey
-
-- Class Typeable, and functions for constructing `Typeable` dictionaries
-someTypeRepTyConName
- , someTypeRepDataConName
- , mkTrConName
- , mkTrAppCheckedName
- , mkTrFunName
- , typeRepIdName
- , typeNatTypeRepName
- , typeSymbolTypeRepName
- , typeCharTypeRepName
- , trGhcPrimModuleName
- :: Name
-someTypeRepTyConName = tcQual gHC_INTERNAL_TYPEABLE_INTERNAL (fsLit "SomeTypeRep") someTypeRepTyConKey
-someTypeRepDataConName = dcQual gHC_INTERNAL_TYPEABLE_INTERNAL (fsLit "SomeTypeRep") someTypeRepDataConKey
-typeRepIdName = varQual gHC_INTERNAL_TYPEABLE_INTERNAL (fsLit "typeRep#") typeRepIdKey
-mkTrConName = varQual gHC_INTERNAL_TYPEABLE_INTERNAL (fsLit "mkTrCon") mkTrConKey
-mkTrAppCheckedName = varQual gHC_INTERNAL_TYPEABLE_INTERNAL (fsLit "mkTrAppChecked") mkTrAppCheckedKey
-mkTrFunName = varQual gHC_INTERNAL_TYPEABLE_INTERNAL (fsLit "mkTrFun") mkTrFunKey
-typeNatTypeRepName = varQual gHC_INTERNAL_TYPEABLE_INTERNAL (fsLit "typeNatTypeRep") typeNatTypeRepKey
-typeSymbolTypeRepName = varQual gHC_INTERNAL_TYPEABLE_INTERNAL (fsLit "typeSymbolTypeRep") typeSymbolTypeRepKey
-typeCharTypeRepName = varQual gHC_INTERNAL_TYPEABLE_INTERNAL (fsLit "typeCharTypeRep") typeCharTypeRepKey
--- this is the Typeable 'Module' for GHC.Prim (which has no code, so we place in GHC.Types)
+trGhcPrimModuleName, starKindRepName, starArrStarKindRepName,
+ starArrStarArrStarKindRepName, constraintKindRepName :: Name
+-- This is the Typeable 'Module' for GHC.Prim (which has no code, so we place in GHC.Types)
-- See Note [Grand plan for Typeable] in GHC.Tc.Instance.Typeable.
trGhcPrimModuleName = varQual gHC_TYPES (fsLit "tr$ModuleGHCPrim") trGhcPrimModuleKey
-
--- Typeable KindReps for some common cases
-starKindRepName, starArrStarKindRepName,
- starArrStarArrStarKindRepName, constraintKindRepName :: Name
starKindRepName = varQual gHC_TYPES (fsLit "krep$*") starKindRepKey
starArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*Arr*") starArrStarKindRepKey
starArrStarArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*->*->*") starArrStarArrStarKindRepKey
@@ -967,10 +867,6 @@ withDictClassName = clsQual gHC_MAGIC_DICT (fsLit "WithDict") withDictClassKey
nonEmptyTyConName :: Name
nonEmptyTyConName = tcQual gHC_INTERNAL_BASE (fsLit "NonEmpty") nonEmptyTyConKey
--- seq#
-seqHashName :: Name
-seqHashName = varQual gHC_INTERNAL_IO (fsLit "seq#") seqHashKey
-
-- Custom type errors
errorMessageTypeErrorFamName
, typeErrorTextDataConName
@@ -998,10 +894,6 @@ typeErrorShowTypeDataConName =
unsafeCoercePrimName:: Name
unsafeCoercePrimName = varQual gHC_INTERNAL_UNSAFE_COERCE (fsLit "unsafeCoerce#") unsafeCoercePrimIdKey
--- Dynamic
-toDynName :: Name
-toDynName = varQual gHC_INTERNAL_DYNAMIC (fsLit "toDyn") toDynIdKey
-
-- Error module
assertErrorName :: Name
assertErrorName = varQual gHC_INTERNAL_IO_Exception (fsLit "assertError") assertErrorIdKey
@@ -1010,10 +902,6 @@ assertErrorName = varQual gHC_INTERNAL_IO_Exception (fsLit "assertError") asse
traceName :: Name
traceName = varQual gHC_INTERNAL_DEBUG_TRACE (fsLit "trace") traceKey
--- Class Read
-readClassName :: Name
-readClassName = clsQual gHC_INTERNAL_READ (fsLit "Read") readClassKey
-
genericClassKeys :: [KnownKey]
genericClassKeys = [genClassKey, gen1ClassKey]
@@ -1157,9 +1045,6 @@ dcQual modu str unique = mk_known_key_name dataName modu str unique
* *
********************************************************************* -}
-rationalTyConOcc :: KnownOcc
-rationalTyConOcc = mkTcOcc "Rational"
-
sappendClassOpOcc, pureAClassOpOcc, thenAClassOpOcc,
returnMClassOpOcc, thenMClassOpOcc, mappendClassOpOcc :: KnownOcc
sappendClassOpOcc = mkVarOcc "<>"
=====================================
compiler/GHC/Builtin/KnownOccs.hs
=====================================
@@ -21,6 +21,8 @@ import GHC.Builtin.PrimOps.Ids (primOpId)
import GHC.Builtin.TH( unsafeCodeCoerceName, liftTypedName )
import GHC.Builtin.KnownKeys
+import GHC.Types.Name( KnownOcc )
+import GHC.Types.Name.Occurrence
import GHC.Types.Name.Reader( RdrName, mkVarUnqual, getRdrName
, nameRdrName )
import GHC.Types.Id.Make( coerceName ) -- `coerce` is wired-in
@@ -48,6 +50,85 @@ mechanisms:
-}
+{- *********************************************************************
+* *
+ Known-occ OccNames
+* *
+********************************************************************* -}
+
+rationalTyConOcc :: KnownOcc
+rationalTyConOcc = mkTcOcc "Rational"
+
+-- Class Typeable, and functions for constructing `Typeable` dictionaries
+someTypeRepTyConOcc
+ , someTypeRepDataConOcc
+ , mkTrConOcc
+ , mkTrAppCheckedOcc
+ , mkTrFunOcc
+ , typeRepIdOcc
+ , typeNatTypeRepOcc
+ , typeSymbolTypeRepOcc
+ , typeCharTypeRepOcc
+ :: KnownOcc
+someTypeRepTyConOcc = mkTcOcc "SomeTypeRep"
+someTypeRepDataConOcc = mkDataOcc "SomeTypeRep"
+typeRepIdOcc = mkVarOcc "typeRep#"
+mkTrConOcc = mkVarOcc "mkTrCon"
+mkTrAppCheckedOcc = mkVarOcc "mkTrAppChecked"
+mkTrFunOcc = mkVarOcc "mkTrFun"
+typeNatTypeRepOcc = mkVarOcc "typeNatTypeRep"
+typeSymbolTypeRepOcc = mkVarOcc "typeSymbolTypeRep"
+typeCharTypeRepOcc = mkVarOcc "typeCharTypeRep"
+
+typeLitSymbolDataConOcc
+ , typeLitNatDataConOcc
+ , typeLitCharDataConOcc
+ :: KnownOcc
+typeLitSymbolDataConOcc = mkDataOcc "TypeLitSymbol"
+typeLitNatDataConOcc = mkDataOcc "TypeLitNat"
+typeLitCharDataConOcc = mkDataOcc "TypeLitChar"
+
+
+trModuleTyConOcc
+ , trModuleDataConOcc
+ , trNameSDataConOcc
+ , trTyConTyConOcc
+ , trTyConDataConOcc
+ :: KnownOcc
+trModuleTyConOcc = mkTcOcc "Module"
+trModuleDataConOcc = mkDataOcc "Module"
+trNameSDataConOcc = mkDataOcc "TrNameS"
+trTyConTyConOcc = mkTcOcc "TyCon"
+trTyConDataConOcc = mkDataOcc "TyCon"
+
+-- Typeable representation types
+kindRepTyConOcc
+ , kindRepTyConAppDataConOcc
+ , kindRepVarDataConOcc
+ , kindRepAppDataConOcc
+ , kindRepFunDataConOcc
+ , kindRepTYPEDataConOcc
+ , kindRepTypeLitSDataConOcc
+ :: KnownOcc
+kindRepTyConOcc = mkTcOcc "KindRep"
+kindRepTyConAppDataConOcc = mkDataOcc "KindRepTyConApp"
+kindRepVarDataConOcc = mkDataOcc "KindRepVar"
+kindRepAppDataConOcc = mkDataOcc "KindRepApp"
+kindRepFunDataConOcc = mkDataOcc "KindRepFun"
+kindRepTYPEDataConOcc = mkDataOcc "KindRepTYPE"
+kindRepTypeLitSDataConOcc = mkDataOcc "KindRepTypeLitS"
+
+
+{- *********************************************************************
+* *
+ Misc global RdrNames
+* *
+********************************************************************* -}
+
+toDyn_RDR :: RdrName
+toDyn_RDR = knownVarOccRdrName "toDyn"
+
+
{- *********************************************************************
* *
Global RdrNames used by derived instances
=====================================
compiler/GHC/HsToCore/Binds.hs
=====================================
@@ -58,7 +58,8 @@ import GHC.Core.Rules
import GHC.Core.Ppr( pprCoreBinders )
import GHC.Core.TyCo.Compare( eqType )
-import GHC.Builtin.KnownKeys
+import GHC.Builtin.KnownKeys( typeableClassKey )
+import GHC.Builtin.KnownOccs
import GHC.Builtin.Types ( naturalTy, typeSymbolKind, charTy )
import GHC.Tc.Types.Evidence
@@ -1761,10 +1762,10 @@ type TypeRepExpr = CoreExpr
-- | Returns a @CoreExpr :: TypeRep ty@
ds_ev_typeable :: Type -> EvTypeable -> DsM CoreExpr
ds_ev_typeable ty (EvTypeableTyCon tc kind_ev)
- = do { mkTrCon <- dsLookupGlobalId mkTrConName
+ = do { mkTrCon <- dsLookupKnownOccId mkTrConOcc
-- mkTrCon :: forall k (a :: k). TyCon -> TypeRep k -> TypeRep a
- ; someTypeRepTyCon <- dsLookupTyCon someTypeRepTyConName
- ; someTypeRepDataCon <- dsLookupDataCon someTypeRepDataConName
+ ; someTypeRepTyCon <- dsLookupKnownOccTyCon someTypeRepTyConOcc
+ ; someTypeRepDataCon <- dsLookupKnownOccDataCon someTypeRepDataConOcc
-- SomeTypeRep :: forall k (a :: k). TypeRep a -> SomeTypeRep
; tc_rep <- tyConRep tc -- :: TyCon
@@ -1793,7 +1794,7 @@ ds_ev_typeable ty (EvTypeableTyApp ev1 ev2)
| Just (t1,t2) <- splitAppTy_maybe ty
= do { e1 <- getRep ev1 t1
; e2 <- getRep ev2 t2
- ; mkTrAppChecked <- dsLookupGlobalId mkTrAppCheckedName
+ ; mkTrAppChecked <- dsLookupKnownOccId mkTrAppCheckedOcc
-- mkTrAppChecked :: forall k1 k2 (a :: k1 -> k2) (b :: k1).
-- TypeRep a -> TypeRep b -> TypeRep (a b)
; let (_, k1, k2) = splitFunTy (typeKind t1) -- drop the multiplicity,
@@ -1809,7 +1810,7 @@ ds_ev_typeable ty (EvTypeableTrFun evm ev1 ev2)
= do { e1 <- getRep ev1 t1
; e2 <- getRep ev2 t2
; em <- getRep evm m
- ; mkTrFun <- dsLookupGlobalId mkTrFunName
+ ; mkTrFun <- dsLookupKnownOccId mkTrFunOcc
-- mkTrFun :: forall (m :: Multiplicity) r1 r2 (a :: TYPE r1) (b :: TYPE r2).
-- TypeRep m -> TypeRep a -> TypeRep b -> TypeRep (a % m -> b)
; let r1 = getRuntimeRep t1
@@ -1820,7 +1821,7 @@ ds_ev_typeable ty (EvTypeableTrFun evm ev1 ev2)
ds_ev_typeable ty (EvTypeableTyLit ev)
= -- See Note [Typeable for Nat and Symbol] in GHC.Tc.Instance.Class
- do { fun <- dsLookupGlobalId tr_fun
+ do { fun <- dsLookupKnownOccId tr_fun
; dict <- dsEvTerm ev -- Of type KnownNat/KnownSymbol
; return (mkApps (mkTyApps (Var fun) [ty]) [ dict ]) }
where
@@ -1829,9 +1830,9 @@ ds_ev_typeable ty (EvTypeableTyLit ev)
-- tr_fun is the Name of
-- typeNatTypeRep :: KnownNat a => TypeRep a
-- of typeSymbolTypeRep :: KnownSymbol a => TypeRep a
- tr_fun | ty_kind `eqType` naturalTy = typeNatTypeRepName
- | ty_kind `eqType` typeSymbolKind = typeSymbolTypeRepName
- | ty_kind `eqType` charTy = typeCharTypeRepName
+ tr_fun | ty_kind `eqType` naturalTy = typeNatTypeRepOcc
+ | ty_kind `eqType` typeSymbolKind = typeSymbolTypeRepOcc
+ | ty_kind `eqType` charTy = typeCharTypeRepOcc
| otherwise = panic "dsEvTypeable: unknown type lit kind"
ds_ev_typeable ty ev
@@ -1845,7 +1846,7 @@ getRep :: EvTerm -- ^ EvTerm for @Typeable ty@
-- typeRep# :: forall k (a::k). Typeable k a -> TypeRep a
getRep ev ty
= do { typeable_expr <- dsEvTerm ev
- ; typeRepId <- dsLookupGlobalId typeRepIdName
+ ; typeRepId <- dsLookupKnownOccId typeRepIdOcc
; let ty_args = [typeKind ty, ty]
; return (mkApps (mkTyApps (Var typeRepId) ty_args) [ typeable_expr ]) }
=====================================
compiler/GHC/HsToCore/Match/Literal.hs
=====================================
@@ -238,7 +238,7 @@ dsFractionalLitToRational fl@FL{ fl_signi = signi, fl_exp = exp, fl_exp_base = b
dsRational :: Rational -> DsM CoreExpr
dsRational (n :% d) = do
platform <- targetPlatform <$> getDynFlags
- dcn <- dsLookupDataCon ratioDataConName
+ dcn <- dsLookupKnownKeyDataCon ratioDataConKey
let cn = mkIntegerExpr platform n
let dn = mkIntegerExpr platform d
return $ mkCoreConApps dcn [Type integerTy, cn, dn]
=====================================
compiler/GHC/HsToCore/Monad.hs
=====================================
@@ -27,9 +27,9 @@ module GHC.HsToCore.Monad (
-- Looking up in the environment
dsLookupGlobal, dsLookupGlobalId, dsLookupTyCon,
dsLookupDataCon, dsLookupConLike,
- dsLookupKnownKeyTyCon, dsLookupKnownKeyId,
+ dsLookupKnownKeyTyCon, dsLookupKnownKeyDataCon, dsLookupKnownKeyId,
dsLookupKnownKeyName,
- dsLookupKnownOccId, dsLookupKnownOccTyCon,
+ dsLookupKnownOccId, dsLookupKnownOccTyCon, dsLookupKnownOccDataCon,
DsMetaEnv, DsMetaVal(..), dsGetMetaEnv, dsLookupMetaEnv, dsExtendMetaEnv,
@@ -597,6 +597,9 @@ dsLookupKnownOccThing occ
dsLookupKnownOccTyCon :: KnownOcc -> DsM TyCon
dsLookupKnownOccTyCon uniq = tyThingTyCon <$> dsLookupKnownOccThing uniq
+dsLookupKnownOccDataCon :: KnownOcc -> DsM DataCon
+dsLookupKnownOccDataCon uniq = tyThingDataCon <$> dsLookupKnownOccThing uniq
+
dsLookupKnownOccId :: KnownOcc -> DsM Id
dsLookupKnownOccId uniq = tyThingId <$> dsLookupKnownOccThing uniq
@@ -624,6 +627,9 @@ dsLookupKnownKeyThing uniq
dsLookupKnownKeyTyCon :: KnownKey -> DsM TyCon
dsLookupKnownKeyTyCon uniq = tyThingTyCon <$> dsLookupKnownKeyThing uniq
+dsLookupKnownKeyDataCon :: KnownKey -> DsM DataCon
+dsLookupKnownKeyDataCon uniq = tyThingDataCon <$> dsLookupKnownKeyThing uniq
+
dsLookupKnownKeyId :: KnownKey -> DsM Id
dsLookupKnownKeyId uniq = tyThingId <$> dsLookupKnownKeyThing uniq
=====================================
compiler/GHC/HsToCore/Pmc/Desugar.hs
=====================================
@@ -21,7 +21,8 @@ import GHC.Types.Id
import GHC.Core.ConLike
import GHC.Types.Name
import GHC.Builtin.Types
-import GHC.Builtin.KnownKeys (rationalTyConKey, toListClassOpKey)
+import GHC.Builtin.KnownKeys ( toListClassOpKey )
+import GHC.Builtin.KnownOccs ( rationalTyConOcc )
import GHC.Types.SrcLoc
import GHC.Utils.Outputable
import GHC.Utils.Panic
@@ -253,7 +254,7 @@ desugarPat x pat = case pat of
, (HsFractional f) <- val
, negates <- if fl_neg f then 1 else 0
-> do
- rat_tc <- dsLookupKnownKeyTyCon rationalTyConKey
+ rat_tc <- dsLookupKnownOccTyCon rationalTyConOcc
let rat_ty = mkTyConTy rat_tc
return $ Just $ PmLit rat_ty (PmLitOverRat negates f)
| otherwise
=====================================
compiler/GHC/Runtime/Eval.hs
=====================================
@@ -83,7 +83,7 @@ import GHC.Tc.Utils.TcType
import GHC.Tc.Types.Constraint
import GHC.Tc.Types.Origin
-import GHC.Builtin.KnownKeys ( toDynName )
+import GHC.Builtin.KnownOccs ( toDyn_RDR )
import GHC.Builtin.Types ( pretendNameIsInScope )
import GHC.Data.Maybe
@@ -1290,7 +1290,7 @@ dynCompileExpr expr = do
parsed_expr <- parseExpr expr
-- > Data.Dynamic.toDyn expr
let loc = getLoc parsed_expr
- to_dyn_expr = mkHsApp (L loc . mkHsVar . L (l2l loc) $ getRdrName toDynName)
+ to_dyn_expr = mkHsApp (L loc . mkHsVar . L (l2l loc) toDyn_RDR)
parsed_expr
hval <- compileParsedExpr to_dyn_expr
return (unsafeCoerce hval :: Dynamic)
=====================================
compiler/GHC/Tc/Instance/Class.hs
=====================================
@@ -443,7 +443,7 @@ matchWithDict [cls_ty, mty]
, [inst_meth_ty] <- dataConInstArgTys dict_dc dict_args
= do { sv <- mkSysLocalM (fsLit "withDict_s") ManyTy mty
; k <- mkSysLocalM (fsLit "withDict_k") ManyTy (mkInvisFunTy cls_ty openAlphaTy)
- ; wd_cls <- tcLookupClass withDictClassName
+ ; wd_cls <- tcLookupKnownKeyClass withDictClassKey
-- Given ev_expr : mty ~N# inst_meth_ty, construct the method of
-- the WithDict dictionary:
=====================================
compiler/GHC/Tc/Instance/Typeable.hs
=====================================
@@ -12,32 +12,41 @@ module GHC.Tc.Instance.Typeable(mkTypeableBinds, tyConIsTypeable) where
import GHC.Prelude
import GHC.Platform
-import GHC.Types.Basic ( TypeOrConstraint(..) )
-import GHC.Types.InlinePragma ( neverInlinePragma )
-import GHC.Types.SourceText ( SourceText(..) )
-import GHC.Iface.Env( newGlobalBinder )
-import GHC.Core.TyCo.Rep( Type(..), TyLit(..) )
+import GHC.Hs
+
import GHC.Tc.Utils.Env
import GHC.Tc.Types.Evidence ( mkWpTyApps )
import GHC.Tc.Utils.Monad
import GHC.Tc.Utils.TcType
-import GHC.Types.TyThing ( lookupId )
+
+import GHC.Iface.Env( newGlobalBinder )
+
import GHC.Builtin.KnownKeys
+import GHC.Builtin.KnownOccs
import GHC.Builtin.Types.Prim ( primTyCons )
import GHC.Builtin.Types
( runtimeRepTyCon
, levityTyCon, vecCountTyCon, vecElemTyCon
, nilDataCon, consDataCon )
+
+import GHC.Types.TyThing ( lookupId )
+import GHC.Types.Basic ( TypeOrConstraint(..) )
+import GHC.Types.InlinePragma ( neverInlinePragma )
+import GHC.Types.SourceText ( SourceText(..) )
import GHC.Types.Name
import GHC.Types.Id
+import GHC.Types.Var ( VarBndr(..) )
+
+import GHC.Core.TyCo.Rep( Type(..), TyLit(..) )
import GHC.Core.Type
import GHC.Core.TyCon
import GHC.Core.DataCon
+import GHC.Core.Map.Type
+
import GHC.Unit.Module
-import GHC.Hs
+
import GHC.Driver.DynFlags
-import GHC.Types.Var ( VarBndr(..) )
-import GHC.Core.Map.Type
+
import GHC.Utils.Fingerprint(Fingerprint(..), fingerprintString, fingerprintFingerprints)
import GHC.Utils.Outputable
import GHC.Utils.Panic
@@ -342,7 +351,7 @@ mkModIdBindings
= do { mod <- getModule
; loc <- getSrcSpanM
; mod_nm <- newGlobalBinder mod (mkVarOccFS (fsLit "$trModule")) Nothing loc
- ; trModuleTyCon <- tcLookupTyCon trModuleTyConName
+ ; trModuleTyCon <- tcLookupKnownOccTyCon trModuleTyConOcc
; let mod_id = mkExportedVanillaId mod_nm (mkTyConApp trModuleTyCon [])
`setInlinePragma` neverInlinePragma
-- See Note [NOINLINE on generated Typeable bindings]
@@ -354,7 +363,7 @@ mkModIdBindings
mkModIdRHS :: Module -> TcM (LHsExpr GhcTc)
mkModIdRHS mod
- = do { trModuleDataCon <- tcLookupDataCon trModuleDataConName
+ = do { trModuleDataCon <- tcLookupKnownOccDataCon trModuleDataConOcc
; trNameLit <- mkTrNameLit
; return $ nlHsDataCon trModuleDataCon
`nlHsApp` trNameLit (unitFS (moduleUnit mod))
@@ -393,7 +402,7 @@ data TyConTodo
todoForTyCons :: Module -> Id -> [TyCon] -> TcM TypeRepTodo
todoForTyCons mod mod_id tycons = do
- trTyConTy <- mkTyConTy <$> tcLookupTyCon trTyConTyConName
+ trTyConTy <- mkTyConTy <$> tcLookupKnownOccTyCon trTyConTyConOcc
let mk_rep_id :: TyConRepName -> Id
mk_rep_id rep_name = mkExportedVanillaId rep_name trTyConTy
`setInlinePragma` neverInlinePragma
@@ -426,7 +435,7 @@ todoForTyCons mod mod_id tycons = do
todoForExportedKindReps :: [(Kind, Name)] -> TcM TypeRepTodo
todoForExportedKindReps kinds = do
- trKindRepTy <- mkTyConTy <$> tcLookupTyCon kindRepTyConName
+ trKindRepTy <- mkTyConTy <$> tcLookupKnownOccTyCon kindRepTyConOcc
let mkId (k, name) = (k, mkExportedVanillaId name trKindRepTy)
return $ ExportedKindRepsTodo $ map mkId kinds
@@ -472,7 +481,7 @@ mkPrimTypeableTodos
= do { mod <- getModule
; if mod == gHC_TYPES
then do { -- Build Module binding for GHC.Prim
- trModuleTyCon <- tcLookupTyCon trModuleTyConName
+ trModuleTyCon <- tcLookupKnownOccTyCon trModuleTyConOcc
; let ghc_prim_module_id =
mkExportedVanillaId trGhcPrimModuleName
(mkTyConTy trModuleTyCon)
@@ -547,17 +556,17 @@ data TypeableStuff
collect_stuff :: TcM TypeableStuff
collect_stuff = do
platform <- targetPlatform <$> getDynFlags
- trTyConDataCon <- tcLookupDataCon trTyConDataConName
- kindRepTyCon <- tcLookupTyCon kindRepTyConName
- kindRepTyConAppDataCon <- tcLookupDataCon kindRepTyConAppDataConName
- kindRepVarDataCon <- tcLookupDataCon kindRepVarDataConName
- kindRepAppDataCon <- tcLookupDataCon kindRepAppDataConName
- kindRepFunDataCon <- tcLookupDataCon kindRepFunDataConName
- kindRepTYPEDataCon <- tcLookupDataCon kindRepTYPEDataConName
- kindRepTypeLitSDataCon <- tcLookupDataCon kindRepTypeLitSDataConName
- typeLitSymbolDataCon <- tcLookupDataCon typeLitSymbolDataConName
- typeLitNatDataCon <- tcLookupDataCon typeLitNatDataConName
- typeLitCharDataCon <- tcLookupDataCon typeLitCharDataConName
+ trTyConDataCon <- tcLookupKnownOccDataCon trTyConDataConOcc
+ kindRepTyCon <- tcLookupKnownOccTyCon kindRepTyConOcc
+ kindRepTyConAppDataCon <- tcLookupKnownOccDataCon kindRepTyConAppDataConOcc
+ kindRepVarDataCon <- tcLookupKnownOccDataCon kindRepVarDataConOcc
+ kindRepAppDataCon <- tcLookupKnownOccDataCon kindRepAppDataConOcc
+ kindRepFunDataCon <- tcLookupKnownOccDataCon kindRepFunDataConOcc
+ kindRepTYPEDataCon <- tcLookupKnownOccDataCon kindRepTYPEDataConOcc
+ kindRepTypeLitSDataCon <- tcLookupKnownOccDataCon kindRepTypeLitSDataConOcc
+ typeLitSymbolDataCon <- tcLookupKnownOccDataCon typeLitSymbolDataConOcc
+ typeLitNatDataCon <- tcLookupKnownOccDataCon typeLitNatDataConOcc
+ typeLitCharDataCon <- tcLookupKnownOccDataCon typeLitCharDataConOcc
trNameLit <- mkTrNameLit
return Stuff {..}
@@ -566,7 +575,7 @@ collect_stuff = do
-- representations.
mkTrNameLit :: TcM (FastString -> LHsExpr GhcTc)
mkTrNameLit = do
- trNameSDataCon <- tcLookupDataCon trNameSDataConName
+ trNameSDataCon <- tcLookupKnownOccDataCon trNameSDataConOcc
let trNameLit :: FastString -> LHsExpr GhcTc
trNameLit fs = nlHsPar $ nlHsDataCon trNameSDataCon
`nlHsApp` nlHsLit (mkHsStringPrimLit fs)
=====================================
compiler/GHC/Tc/Utils/Env.hs
=====================================
@@ -31,7 +31,7 @@ module GHC.Tc.Utils.Env(
tcLookupKnownKeyGlobal, tcLookupKnownKeyTyCon,
tcLookupKnownKeyClass, tcLookupKnownKeyId,
- tcLookupKnownOccTyCon, tcLookupKnownOccId,
+ tcLookupKnownOccTyCon, tcLookupKnownOccDataCon, tcLookupKnownOccId,
rnLookupKnownKeyName, rnLookupKnownKeyRdr, getKnownKeySource,
-- Local environment
@@ -304,11 +304,7 @@ tcLookupGlobalOnly name
Nothing -> pprPanic "tcLookupGlobalOnly" (ppr name) }
tcLookupDataCon :: Name -> TcM DataCon
-tcLookupDataCon name = do
- thing <- tcLookupGlobal name
- case thing of
- AConLike (RealDataCon con) -> return con
- _ -> wrongThingErr WrongThingDataCon (AGlobal thing) name
+tcLookupDataCon = get_datacon . tcLookupGlobal
tcLookupPatSyn :: Name -> TcM PatSyn
tcLookupPatSyn name = do
@@ -337,18 +333,10 @@ tcLookupRecSelParent (RnRecUpdParent { rnRecUpdCons = cons })
-- Any constructor will give the same result here.
tcLookupClass :: Name -> TcM Class
-tcLookupClass name = do
- thing <- tcLookupGlobal name
- case thing of
- ATyCon tc | Just cls <- tyConClass_maybe tc -> return cls
- _ -> wrongThingErr WrongThingClass (AGlobal thing) name
+tcLookupClass = get_class . tcLookupGlobal
tcLookupTyCon :: Name -> TcM TyCon
-tcLookupTyCon name = do
- thing <- tcLookupGlobal name
- case thing of
- ATyCon tc -> return tc
- _ -> wrongThingErr WrongThingTyCon (AGlobal thing) name
+tcLookupTyCon = get_tycon . tcLookupGlobal
tcLookupAxiom :: Name -> TcM (CoAxiom Branched)
tcLookupAxiom name = do
@@ -573,6 +561,9 @@ tcLookupKnownOccGlobal = tcrn_wrapper . lookupKnownOccThing
tcLookupKnownOccTyCon :: HasDebugCallStack => KnownOcc -> TcM TyCon
tcLookupKnownOccTyCon = get_tycon . tcLookupKnownOccGlobal
+tcLookupKnownOccDataCon :: HasDebugCallStack => KnownOcc -> TcM DataCon
+tcLookupKnownOccDataCon = get_datacon . tcLookupKnownOccGlobal
+
tcLookupKnownOccId :: HasDebugCallStack => KnownOcc -> TcM Id
tcLookupKnownOccId = get_id . tcLookupKnownOccGlobal
@@ -592,6 +583,13 @@ get_tycon do_the_lookup
ATyCon tc -> return tc
_ -> wrongThingErr WrongThingClass (AGlobal thing) (getName thing) }
+get_datacon :: TcRn TyThing -> TcRn DataCon
+get_datacon do_the_lookup
+ = do { thing <- do_the_lookup
+ ; case thing of
+ AConLike (RealDataCon con) -> return con
+ _ -> wrongThingErr WrongThingClass (AGlobal thing) (getName thing) }
+
get_id :: TcRn TyThing -> TcRn Id
get_id do_the_lookup
= do { thing <- do_the_lookup
=====================================
compiler/GHC/Tc/Utils/Instantiate.hs
=====================================
@@ -40,7 +40,7 @@ import GHC.Prelude
import GHC.Driver.Session
import GHC.Driver.Env
-import GHC.Builtin.KnownKeys( rationalTyConOcc )
+import GHC.Builtin.KnownOccs( rationalTyConOcc )
import GHC.Builtin.Types( integerTy )
import GHC.Hs
=====================================
libraries/base/src/GHC/KnownKeyNames.hs
=====================================
@@ -11,8 +11,7 @@
--
module GHC.KnownKeyNames
- ( Rational
- , Eq(..), Ord(..) -- With their methods
+ ( Eq(..), Ord(..) -- With their methods
, Show, Read
, Foldable, Traversable
, Functor, fmap
@@ -21,6 +20,7 @@ module GHC.KnownKeyNames
-- Misc
, (.), (&&), not, map, foldr, build
+ , seq#
-- Applicative
, Applicative, pure, mzip, (<*>), (*>)
@@ -61,10 +61,14 @@ module GHC.KnownKeyNames
-- Numbers
, Num, Integral, Real, Fractional, RealFloat
, (+), (-), (*), negate, fromInteger
- , fromRational
- , mkRationalBase2, mkRationalBase10
, divInt#, modInt#
+ , Ratio( (:%) ), Rational
+ , mkRationalBase2, mkRationalBase10
+ , toInteger, toRational
+ , fromIntegral, fromRational
+ , realToFrac
+
-- Strings
, IsString
, fromString
@@ -82,6 +86,9 @@ module GHC.KnownKeyNames
-- IO
, IO, thenIO, bindIO, returnIO, print
+ -- WithDict
+ , WithDict
+
-- Unsatisfiable
, Unsatisfiable, unsatisfiable
@@ -95,6 +102,15 @@ module GHC.KnownKeyNames
, UnsafeEquality( UnsafeRefl ), unsafeEqualityProof
+ -- Typeable and type representations
+ , SomeTypeRep( SomeTypeRep ), Module( Module )
+ , TyCon( TyCon ), TrName( TrNameS )
+ , KindRep( KindRepTyConApp, KindRepVar, KindRepApp, KindREpFun, KindRepTYPE, KindREpTypeLitS )
+ , typeLitSort( TypeLitSymbol, TypeLitNat, TypeLitChar )
+ , typeRep#
+ , mkTrCon, mkTrAppChecked, mkTrFun
+ , typeNatTypeRep, typeSymbolTypeRep, typeCharTypeRep
+
-- Bignums
, bigNatEq#, bigNatCompare, bigNatCompareWord#
, naturalToWord#, naturalPopCount#, naturalShiftR#, naturalShiftL#
@@ -153,13 +169,15 @@ import Data.String( IsString )
import GHC.Internal.Base
import GHC.Internal.Ix
import GHC.Internal.Magic( inline )
+import GHC.Internal.Magic.Dict( WithDict )
import GHC.Internal.Enum
+import GHC.Internal.Dynamic( toDyn )
import GHC.Internal.Data.Data
import GHC.Internal.Data.String( fromString )
import GHC.Internal.Data.Foldable( Foldable )
import GHC.Internal.Data.Traversable( Traversable )
import GHC.Internal.Float( RealFloat )
-import GHC.Internal.Real( mkRationalBase2, mkRationalBase10 )
+import GHC.Internal.Real
import GHC.Internal.Control.Monad( fail, guard )
import GHC.Internal.Control.Monad.Fix( mfix, loop )
import GHC.Internal.Control.Monad.Zip( mzip )
@@ -177,6 +195,7 @@ import GHC.Internal.StaticPtr( IsStatic(..) )
import GHC.Internal.StaticPtr.Internal( makeStatic )
import GHC.Internal.Data.Typeable( Typeable, gcast1, gcast2 )
+import GHC.Internal.Data.Typeable.Internal
import GHC.Internal.Generics
import GHC.Internal.Bignum.BigNat
=====================================
libraries/ghc-internal/src/GHC/Internal/IO.hs
=====================================
@@ -6,6 +6,10 @@
, ScopedTypeVariables
, UnboxedTuples
#-}
+
+{-# OPTIONS_GHC -fdefines-known-key-names #-}
+ -- Defines seq#
+
{-# OPTIONS_GHC -funbox-strict-fields #-}
{-# OPTIONS_HADDOCK not-home #-}
=====================================
libraries/ghc-internal/src/GHC/Internal/Read.hs
=====================================
@@ -1,5 +1,9 @@
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude, StandaloneDeriving, ScopedTypeVariables #-}
+
+{-# OPTIONS_GHC -fdefines-known-key-names #-}
+ -- Defines Read
+
{-# OPTIONS_HADDOCK not-home #-}
-----------------------------------------------------------------------------
=====================================
libraries/ghc-internal/src/GHC/Internal/Real.hs
=====================================
@@ -2,7 +2,7 @@
{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples, BangPatterns #-}
{-# OPTIONS_GHC -fdefines-known-key-names #-}
- -- Defines Real, Integral etc, etc, etc
+ -- Defines Real, Integral, Ratio etc, etc, etc
{-# OPTIONS_GHC -Wno-orphans #-}
=====================================
libraries/ghc-internal/src/GHC/Internal/Types.hs
=====================================
@@ -4,7 +4,9 @@
TypeApplications, StandaloneKindSignatures, GADTs,
FlexibleInstances, UndecidableInstances, UnboxedSums #-}
-- NegativeLiterals: see Note [Fixity of (->)]
+
{-# OPTIONS_HADDOCK print-explicit-runtime-reps #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Internal.Types
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0a2dbd93fbd9d850b15d079f70ac021…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0a2dbd93fbd9d850b15d079f70ac021…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 9 commits: Implement modifiers syntax.
by Marge Bot (@marge-bot) 08 Apr '26
by Marge Bot (@marge-bot) 08 Apr '26
08 Apr '26
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
b9272bdf by Phil Hazelden at 2026-04-08T16:18:44-04:00
Implement modifiers syntax.
The `%m` syntax of linear types is now accepted in more places, to allow
use by future extensions, though so far linear types is still the only
consumer.
This may break existing code where it
* Uses -XLinearTypes.
* Has code of the form `a %m -> b`, where `m` can't be inferred to be
kind Multiplicity.
The code can be fixed either by adding a kind annotation, or by setting
`-XLinearTypes -XNoModifiers`.
Proposal:
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0370-m…
- - - - -
960a3365 by Zubin Duggal at 2026-04-08T16:18:46-04:00
hadrian: Don't include the package hash in the haddock directory
Since GHC 9.8 and hash_unit_ids, haddock urls have looked like`ghc-9.10.3/doc/html/libraries/base-4.20.2.0-39f9/**/*.html`
The inclusion of the hash makes it hard for downstream non-boot packages to properly link to these files, as the hash is not
part of a standard cabal substitution.
Since we only build one version of each package, we don't need the hash to disambiguate anything, we can just remove it.
Fixes #26635
- - - - -
3748f8c7 by ARATA Mizuki at 2026-04-08T16:18:59-04:00
testsuite: Allow multiple ways to be run by setting multiple command-line options
This patch allows multiple `--test-way`s to take effect, like:
$ hadrian/build test --test-way=normal --test-way=llvm
Previously, only one way was run if the test speed was 'normal' or 'fast'.
Closes #26926
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
- - - - -
e2573a9d by Teo Camarasu at 2026-04-08T16:19:02-04:00
doc: improve eventlog-flush-interval flag documentation
We mention the performance cost and how this flag can be turned off.
Resolves #27056
- - - - -
f1102ca5 by Teo Camarasu at 2026-04-08T16:19:02-04:00
docs/user_guide: fix typo
- - - - -
74d77701 by Simon Jakobi at 2026-04-08T16:19:04-04:00
Fix -dsuppress-uniques for free variables in demand signatures
Before: Str=b{sXyZ->S}
With this patch: Str=b{S}
T13143.stderr is updated accordingly.
Fixes #27106.
- - - - -
7a25b9d8 by Simon Jakobi at 2026-04-08T16:19:05-04:00
Documentation fixes for demand signature notation
Fixes #27115.
- - - - -
9eccb354 by Simon Jakobi at 2026-04-08T16:19:06-04:00
Use upsert for non-deleting map updates
Some compiler functions were using `alter`, despite never removing
any entries: they only update an existing entry or insert a new one.
These functions are converted to using `upsert`:
alter :: (Maybe a -> Maybe a) -> Key -> Map a -> Map a
upsert :: (Maybe a -> a) -> Key -> Map a -> Map a
`upsert` variants are also added to APIs of the various Word64Map
wrapper types.
The precedent for this `upsert` operation is in the containers library:
see https://github.com/haskell/containers/pull/1145
Metrics: compile_time/bytes allocated
-------------------------------------
geo. mean: -0.1%
minimum: -0.5%
maximum: +0.0%
Resolves #27140.
- - - - -
4754b1cb by Cheng Shao at 2026-04-08T16:19:07-04:00
testsuite: fix testsuite run for +ipe again
This patch makes the +ipe flavour transformer pass the entire
testsuite again by dropping stdout/stderr checks of certain tests that
are sensitive to stack layout changes with `+ipe`. Related: #26799.
- - - - -
200 changed files:
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/Dataflow/Graph.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/Core/Multiplicity.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/RoughMap.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCon/Env.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Data/FastString/Env.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Lazy.hs
- compiler/GHC/Data/Word64Map/Strict.hs
- compiler/GHC/Data/Word64Map/Strict/Internal.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Name/Env.hs
- compiler/GHC/Types/Name/Occurrence.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Var/Env.hs
- compiler/GHC/Wasm/ControlFlow/FromCmm.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Decls/Foreign.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/Language/Haskell/Syntax/Type.hs
- docs/users_guide/9.16.1-notes.rst
- docs/users_guide/exts/linear_types.rst
- + docs/users_guide/exts/modifiers.rst
- docs/users_guide/exts/syntax.rst
- docs/users_guide/runtime_control.rst
- docs/users_guide/using-optimisation.rst
- docs/users_guide/using-warnings.rst
- hadrian/bindist/Makefile
- hadrian/src/CommandLine.hs
- hadrian/src/Context.hs
- hadrian/src/Settings/Builders/Cabal.hs
- libraries/ghc-experimental/tests/backtraces/all.T
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- libraries/ghc-internal/tests/stack-annotation/all.T
- testsuite/driver/testlib.py
- testsuite/tests/dmdanal/should_compile/T13143.stderr
- + testsuite/tests/dmdanal/should_compile/T27106.hs
- + testsuite/tests/dmdanal/should_compile/T27106.stderr
- testsuite/tests/dmdanal/should_compile/all.T
- testsuite/tests/driver/T4437.hs
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.hs
- testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.stderr
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/linear/should_compile/Linear1Rule.hs
- testsuite/tests/linear/should_compile/MultConstructor.hs
- testsuite/tests/linear/should_compile/NonLinearRecord.hs
- testsuite/tests/linear/should_compile/OldList.hs
- testsuite/tests/linear/should_compile/T19400.hs
- testsuite/tests/linear/should_compile/T22546.hs
- testsuite/tests/linear/should_compile/T23025.hs
- testsuite/tests/linear/should_compile/T26332.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.stderr
- testsuite/tests/linear/should_fail/LinearLet10.hs
- testsuite/tests/linear/should_fail/LinearLet10.stderr
- testsuite/tests/linear/should_fail/LinearPartialSig.hs
- testsuite/tests/linear/should_fail/LinearPartialSig.stderr
- testsuite/tests/linear/should_fail/LinearRole.hs
- + testsuite/tests/linear/should_fail/LinearUnknownModifierKind.hs
- + testsuite/tests/linear/should_fail/LinearUnknownModifierKind.stderr
- testsuite/tests/linear/should_fail/LinearVar.hs
- testsuite/tests/linear/should_fail/LinearVar.stderr
- testsuite/tests/linear/should_fail/T18888_datakinds.hs
- testsuite/tests/linear/should_fail/T18888_datakinds.stderr
- testsuite/tests/linear/should_fail/T19361.hs
- testsuite/tests/linear/should_fail/T19361.stderr
- testsuite/tests/linear/should_fail/T20083.hs
- testsuite/tests/linear/should_fail/T20083.stderr
- testsuite/tests/linear/should_fail/T21278.hs
- testsuite/tests/linear/should_fail/T21278.stderr
- + testsuite/tests/linear/should_fail/TooManyMultiplicities.hs
- + testsuite/tests/linear/should_fail/TooManyMultiplicities.stderr
- + testsuite/tests/linear/should_fail/TooManyMultiplicitiesU.hs
- + testsuite/tests/linear/should_fail/TooManyMultiplicitiesU.stderr
- testsuite/tests/linear/should_fail/all.T
- + testsuite/tests/modifiers/Makefile
- + testsuite/tests/modifiers/should_compile/LinearNoModifiers.hs
- + testsuite/tests/modifiers/should_compile/Makefile
- + testsuite/tests/modifiers/should_compile/Modifier1Linear.hs
- + testsuite/tests/modifiers/should_compile/Modifier1Linear.stderr
- + testsuite/tests/modifiers/should_compile/Modifiers.hs
- + testsuite/tests/modifiers/should_compile/Modifiers.stderr
- + testsuite/tests/modifiers/should_compile/ModifiersSuggestLinear.hs
- + testsuite/tests/modifiers/should_compile/ModifiersSuggestLinear.stderr
- + testsuite/tests/modifiers/should_compile/all.T
- + testsuite/tests/modifiers/should_fail/Makefile
- + testsuite/tests/modifiers/should_fail/ModifiersExprUnexpectedInQuote.hs
- + testsuite/tests/modifiers/should_fail/ModifiersExprUnexpectedInQuote.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersForbiddenHere.hs
- + testsuite/tests/modifiers/should_fail/ModifiersForbiddenHere.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersNoExt.hs
- + testsuite/tests/modifiers/should_fail/ModifiersNoExt.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersUnexpectedInQuote.hs
- + testsuite/tests/modifiers/should_fail/ModifiersUnexpectedInQuote.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersUnknownKind.hs
- + testsuite/tests/modifiers/should_fail/ModifiersUnknownKind.stderr
- + testsuite/tests/modifiers/should_fail/all.T
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T18834a.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/parser/should_fail/T19928.stderr
- testsuite/tests/printer/Makefile
- + testsuite/tests/printer/PprModifiers.hs
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20315.hs
- testsuite/tests/printer/Test20315.stderr
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/printer/all.T
- testsuite/tests/rename/should_compile/T22478a.hs
- testsuite/tests/typecheck/no_skolem_info/T20232.hs
- testsuite/tests/typecheck/no_skolem_info/T20232.stderr
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Interface/RenameType.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- utils/haddock/html-test/src/LinearTypes.hs
- utils/haddock/latex-test/src/LinearTypes/LinearTypes.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5207fe461fec323217bcef90e321fd…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5207fe461fec323217bcef90e321fd…
You're receiving this email because of your account on gitlab.haskell.org.
1
0