[Git][ghc/ghc][wip/T26834] 2 commits: Delete unecessary GHC.Internal.Data.Ix
by Teo Camarasu (@teo) 26 Jan '26
by Teo Camarasu (@teo) 26 Jan '26
26 Jan '26
Teo Camarasu pushed to branch wip/T26834 at Glasgow Haskell Compiler / GHC
Commits:
ffdda2af by Teo Camarasu at 2026-01-26T22:06:19+00:00
Delete unecessary GHC.Internal.Data.Ix
- - - - -
2a1f0bdc by Teo Camarasu at 2026-01-26T22:22:43+00:00
ghc-internal: refine List imports
- - - - -
17 changed files:
- libraries/base/src/Data/Ix.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/Zip.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Data.hs
- − libraries/ghc-internal/src/GHC/Internal/Data/Ix.hs
- libraries/ghc-internal/src/GHC/Internal/Data/List/NonEmpty.hs
- libraries/ghc-internal/src/GHC/Internal/Data/String.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Version.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc
- libraries/ghc-internal/src/GHC/Internal/ExecutionStack/Internal.hsc
- libraries/ghc-internal/src/GHC/Internal/IO/Encoding/CodePage.hs
- libraries/ghc-internal/src/GHC/Internal/ResponseFile.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
- libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
- libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
Changes:
=====================================
libraries/base/src/Data/Ix.hs
=====================================
@@ -1,4 +1,4 @@
-{-# LANGUAGE Safe #-}
+{-# LANGUAGE Trustworthy #-}
-- |
--
@@ -42,4 +42,4 @@ module Data.Ix
-- <https://www.haskell.org/onlinereport/haskell2010/haskellch19.html>.
) where
-import GHC.Internal.Data.Ix
+import GHC.Internal.Ix
=====================================
libraries/ghc-internal/ghc-internal.cabal.in
=====================================
@@ -153,7 +153,6 @@ Library
GHC.Internal.Data.Functor.Identity
GHC.Internal.Data.Functor.Utils
GHC.Internal.Data.IORef
- GHC.Internal.Data.Ix
GHC.Internal.Data.List
GHC.Internal.Data.List.NonEmpty
GHC.Internal.Data.Maybe
=====================================
libraries/ghc-internal/src/GHC/Internal/Control/Monad/Zip.hs
=====================================
@@ -28,7 +28,7 @@ import GHC.Internal.Data.Proxy
--import qualified Data.List.NonEmpty as NE
import GHC.Internal.Generics
import qualified GHC.Internal.Data.List.NonEmpty as NE
-import qualified GHC.Internal.Data.List as List
+import qualified GHC.Internal.List as List
import GHC.Internal.Data.Maybe
import GHC.Internal.Data.Tuple
--import Prelude
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Data.hs
=====================================
@@ -117,7 +117,7 @@ import GHC.Internal.Data.Maybe
import GHC.Internal.Data.Monoid
import GHC.Internal.Data.NonEmpty ( NonEmpty(..) )
import GHC.Internal.Data.Ord
-import GHC.Internal.Data.List (findIndex)
+import GHC.Internal.Data.OldList (findIndex)
import GHC.Internal.Data.Typeable
import GHC.Internal.Data.Version( Version(..) )
import GHC.Internal.Base hiding (Any, IntRep, FloatRep, NonEmpty(..))
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Ix.hs deleted
=====================================
@@ -1,64 +0,0 @@
-{-# LANGUAGE Trustworthy #-}
-
------------------------------------------------------------------------------
--- |
--- Module : GHC.Internal.Data.Ix
--- Copyright : (c) The University of Glasgow 2001
--- License : BSD-style (see the file libraries/base/LICENSE)
---
--- Maintainer : libraries(a)haskell.org
--- Stability : stable
--- Portability : portable
---
--- The 'Ix' class is used to map a contiguous subrange of values in
--- type onto integers. It is used primarily for array indexing
--- (see the array package). 'Ix' uses row-major order.
---
------------------------------------------------------------------------------
-
-module GHC.Internal.Data.Ix
- (
- -- * The 'Ix' class
- Ix
- ( range
- , index
- , inRange
- , rangeSize
- )
- -- Ix instances:
- --
- -- Ix Char
- -- Ix Int
- -- Ix Integer
- -- Ix Bool
- -- Ix Ordering
- -- Ix ()
- -- (Ix a, Ix b) => Ix (a, b)
- -- ...
-
- -- * Deriving Instances of 'Ix'
- -- | Derived instance declarations for the class 'Ix' are only possible
- -- for enumerations (i.e. datatypes having only nullary constructors)
- -- and single-constructor datatypes, including arbitrarily large tuples,
- -- whose constituent types are instances of 'Ix'.
- --
- -- * For an enumeration, the nullary constructors are assumed to be
- -- numbered left-to-right with the indices being 0 to n-1 inclusive. This
- -- is the same numbering defined by the 'Enum' class. For example, given
- -- the datatype:
- --
- -- > data Colour = Red | Orange | Yellow | Green | Blue | Indigo | Violet
- --
- -- we would have:
- --
- -- > range (Yellow,Blue) == [Yellow,Green,Blue]
- -- > index (Yellow,Blue) Green == 1
- -- > inRange (Yellow,Blue) Red == False
- --
- -- * For single-constructor datatypes, the derived instance declarations
- -- are as shown for tuples in chapter 19, section 2 of the Haskell 2010 report:
- -- <https://www.haskell.org/onlinereport/haskell2010/haskellch19.html>.
-
- ) where
-
-import GHC.Internal.Ix
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/List/NonEmpty.hs
=====================================
@@ -8,7 +8,7 @@ module GHC.Internal.Data.List.NonEmpty
) where
import GHC.Internal.Data.NonEmpty (NonEmpty (..), map)
-import qualified GHC.Internal.Data.List as List
+import qualified GHC.Internal.List as List
-- | The 'zip' function takes two streams and returns a stream of
-- corresponding pairs.
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/String.hs
=====================================
@@ -35,7 +35,7 @@ module GHC.Internal.Data.String (
import GHC.Internal.Base
import GHC.Internal.Data.Functor.Const (Const (Const))
import GHC.Internal.Data.Functor.Identity (Identity (Identity))
-import GHC.Internal.Data.List (lines, words, unlines, unwords)
+import GHC.Internal.Data.OldList (lines, words, unlines, unwords)
-- | `IsString` is used in combination with the @-XOverloadedStrings@
-- language extension to convert the literals to different string types.
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Version.hs
=====================================
@@ -40,7 +40,7 @@ import GHC.Internal.Data.Functor ( Functor(..) )
import GHC.Internal.Data.Bool ( (&&) )
import GHC.Internal.Data.Eq
import GHC.Internal.Int ( Int )
-import GHC.Internal.Data.List ( map, sort, concat, concatMap, intersperse, (++) )
+import GHC.Internal.Data.OldList ( map, sort, concat, concatMap, intersperse, (++) )
import GHC.Internal.Data.Ord
import GHC.Internal.Data.String ( String )
import GHC.Internal.Base ( Applicative(..) )
=====================================
libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc
=====================================
@@ -103,7 +103,7 @@ import GHC.Internal.IORef
import GHC.Internal.Maybe
import GHC.Internal.Ptr
import GHC.Internal.Word
-import GHC.Internal.Data.OldList (deleteBy)
+import GHC.Internal.List (deleteBy)
import qualified GHC.Internal.Event.Array as A
import GHC.Internal.Base
import GHC.Internal.Conc.Bound
=====================================
libraries/ghc-internal/src/GHC/Internal/ExecutionStack/Internal.hsc
=====================================
@@ -39,7 +39,7 @@ module GHC.Internal.ExecutionStack.Internal (
import GHC.Internal.Data.Functor
import GHC.Internal.Data.Maybe
-import GHC.Internal.Data.List (reverse, null)
+import GHC.Internal.List (reverse, null)
import GHC.Internal.Word
import GHC.Internal.Foreign.C.Types
import GHC.Internal.Foreign.C.String (peekCString, CString)
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Encoding/CodePage.hs
=====================================
@@ -30,7 +30,7 @@ import GHC.Internal.IO.Encoding.Types
import GHC.Internal.IO.Buffer
import GHC.Internal.Data.Bits
import GHC.Internal.Data.Maybe
-import GHC.Internal.Data.OldList (lookup)
+import GHC.Internal.List (lookup)
import qualified GHC.Internal.IO.Encoding.CodePage.API as API
import GHC.Internal.IO.Encoding.CodePage.Table
=====================================
libraries/ghc-internal/src/GHC/Internal/ResponseFile.hs
=====================================
@@ -28,7 +28,7 @@ import GHC.Internal.Control.Exception
import GHC.Internal.Data.Foldable (Foldable(..))
import GHC.Internal.Base
import GHC.Internal.Unicode (isSpace)
-import GHC.Internal.Data.List (filter, unlines, concat, reverse)
+import GHC.Internal.Data.OldList (filter, unlines, concat, reverse)
import GHC.Internal.Text.Show (show)
import GHC.Internal.System.Environment (getArgs)
import GHC.Internal.System.Exit (exitFailure)
=====================================
libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
=====================================
@@ -36,7 +36,7 @@ import GHC.Internal.Num
import GHC.Internal.Data.Bits
import GHC.Internal.Data.Functor
import GHC.Internal.Data.Maybe (catMaybes)
-import GHC.Internal.Data.List
+import GHC.Internal.List
import GHC.Internal.Data.Tuple
import GHC.Internal.Foreign.Ptr
import GHC.Internal.Foreign.Storable
=====================================
libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
=====================================
@@ -40,14 +40,14 @@ module GHC.Internal.System.Environment.Blank
) where
import GHC.Internal.Data.Functor
-import GHC.Internal.Data.List (elem, null, takeWhile)
+import GHC.Internal.List (elem, null, takeWhile)
import GHC.Internal.Foreign.C.String
import GHC.Internal.Base
#if defined(mingw32_HOST_OS)
import GHC.Internal.Foreign.Ptr
import GHC.Internal.Windows
import GHC.Internal.Control.Monad
-import GHC.Internal.Data.List (lookup)
+import GHC.Internal.List (lookup)
#else
import GHC.Internal.Foreign.C.Error
import GHC.Internal.Foreign.C.Types
=====================================
libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
=====================================
@@ -53,7 +53,7 @@ import GHC.Internal.System.IO.Error (isDoesNotExistError)
import GHC.Internal.System.Posix.Internals
#elif defined(linux_HOST_OS) || defined(gnu_HOST_OS)
import GHC.Internal.Data.Functor
-import GHC.Internal.Data.List (isSuffixOf)
+import GHC.Internal.Data.OldList (isSuffixOf)
import GHC.Internal.Foreign.C.Types
import GHC.Internal.Foreign.C.Error
import GHC.Internal.Foreign.C.String
@@ -85,7 +85,7 @@ import GHC.Internal.System.Posix.Internals
import GHC.Internal.Control.Exception
import GHC.Internal.Control.Monad.Fail
import GHC.Internal.Data.Functor
-import GHC.Internal.Data.List (isPrefixOf, drop)
+import GHC.Internal.OldList (isPrefixOf, drop)
import GHC.Internal.Word
import GHC.Internal.Foreign.C.String
import GHC.Internal.Foreign.Marshal.Array
=====================================
libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
=====================================
@@ -70,7 +70,7 @@ import GHC.Internal.Foreign.Storable
import qualified GHC.Internal.Foreign.C.String.Encoding as GHC
#else
import GHC.Internal.Int
-import GHC.Internal.Data.OldList (elem)
+import GHC.Internal.List (elem)
#endif
-- ---------------------------------------------------------------------------
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -80,7 +80,7 @@ module GHC.Internal.Windows (
import GHC.Internal.Data.Bits (finiteBitSize, shiftL, shiftR, (.|.), (.&.))
import GHC.Internal.Unicode (isSpace)
-import GHC.Internal.Data.OldList
+import GHC.Internal.List
import GHC.Internal.Data.Maybe
import GHC.Internal.Word
import GHC.Internal.Int
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/966bd642640e2ccd17bbe43f2f5145…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/966bd642640e2ccd17bbe43f2f5145…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
sheaf pushed to branch wip/andreask/ticked_joins at Glasgow Haskell Compiler / GHC
Commits:
a3ef7ffc by sheaf at 2026-01-26T23:12:26+01:00
WIP try harder
- - - - -
5 changed files:
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Monad.hs
- compiler/GHC/Types/Id/Info.hs
Changes:
=====================================
compiler/GHC/Core/Lint.hs
=====================================
@@ -915,7 +915,7 @@ lintCoreExpr (Lit lit)
; return (literalType lit, zeroUE) }
lintCoreExpr (Cast expr co)
- = do { (expr_ty, ue) <- markAllJoinsBad (lintCoreExpr expr)
+ = do { (expr_ty, ue) <- lintCoreExpr expr -- SLD TODO markAllJoinsBad (lintCoreExpr expr)
-- markAllJoinsBad: see Note [Join points and casts]
; lintCoercion co
@@ -1146,7 +1146,7 @@ checkDeadIdOcc id
------------------
lintJoinBndrType :: OutType -- Type of the body
-> OutId -- Possibly a join Id
- -> LintM ()
+ -> LintM ()
-- Checks that the return type of a join Id matches the body
-- E.g. join j x = rhs in body
-- The type of 'rhs' must be the same as the type of 'body'
=====================================
compiler/GHC/Core/Opt/OccurAnal.hs
=====================================
@@ -42,7 +42,7 @@ import GHC.Core.Coercion
import GHC.Core.Type
import GHC.Core.TyCo.FVs ( tyCoVarsOfMCo )
-import GHC.Data.Maybe( orElse )
+import GHC.Data.Maybe( orElse, isNothing )
import GHC.Data.Graph.Directed ( SCC(..), Node(..)
, stronglyConnCompFromEdgedVerticesUniq
, stronglyConnCompFromEdgedVerticesUniqR )
@@ -68,6 +68,7 @@ import GHC.Builtin.Names( runRWKey )
import GHC.Unit.Module( Module )
import Data.List (mapAccumL)
+import qualified Data.List.NonEmpty as NE
import qualified Data.Semigroup as Semi
{-
@@ -2299,7 +2300,7 @@ occ_anal_lam_tail env (Cast expr co)
_ -> usage1
-- usage3: see Note [Quasi join points] in GHC.Core.Opt.Simplify.Iteration.
- usage3 = markAllNonTail usage2 -- SLD TODO
+ usage3 = markAllQuasiTail usage2 -- SLD TODO
in WUD usage3 (Cast expr' co)
@@ -2612,7 +2613,7 @@ occAnal env (Cast expr co)
= let (WUD usage expr') = occAnal env expr
usage1 = addManyOccs usage (coVarsOfCo co)
-- usage1: see Note [Gather occurrences of coercion variables]
- usage2 = markAllNonTail usage1 -- SLD TODO
+ usage2 = markAllQuasiTail usage1 -- SLD TODO
-- usage2: see Note [Quasi join points]
in WUD usage2 (Cast expr' co)
@@ -3985,20 +3986,31 @@ adjustNonRecRhs mb_join_arity (WTUD (TUD rhs_ja uds) rhs)
where
exact_join =
case mb_join_arity of
- Nothing -> False
- Just ja' -> ja' == rhs_ja
-
-adjustTailUsage :: Bool -- True <=> Exactly-matching join point; don't do markNonTail
+ Nothing -> Nothing
+ Just ja' ->
+ if ja' == rhs_ja
+ then Just TrueJoinPoint
+ else Nothing
+
+adjustTailUsage :: HasDebugCallStack
+ => Maybe JoinPointType
-> CoreExpr -- Rhs usage, AFTER occAnalLamTail
-> UsageDetails
-> UsageDetails
-adjustTailUsage exact_join rhs uds
+adjustTailUsage mb_join rhs uds
= -- c.f. occAnal (Lam {})
markAllInsideLamIf (not one_shot) $
- markAllNonTailIf (not exact_join) $
+ mb_mark_nontail $
uds
where
- one_shot = isOneShotFun rhs
+ one_shot = isOneShotFun rhs
+ mb_mark_nontail =
+ case mb_join of
+ Nothing -> markAllNonTail
+ Just join_ty ->
+ case join_ty of
+ QuasiJoinPoint -> markAllQuasiTail
+ TrueJoinPoint -> id
adjustTailArity :: Maybe JoinArity -> TailUsageDetails -> UsageDetails
adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf not_same_arity usage
@@ -4036,11 +4048,8 @@ tagNonRecBinder :: TopLevelFlag -- At top level?
-- No-op on TyVars
-- Precondition: OccInfo is not IAmDead
tagNonRecBinder lvl occ bndr
- | okForJoinPoint lvl bndr tail_call_info
- , AlwaysTailCalled
- { tailCallArity = ar
- , tailCallJoinPointType = join_ty
- } <- tail_call_info
+ | Just join_ty <- okForJoinPoint lvl bndr tail_call_info
+ , AlwaysTailCalled { tailCallArity = ar } <- tail_call_info
= (setBinderOcc occ bndr, JoinPoint join_ty ar)
| otherwise
= (setBinderOcc zapped_occ bndr, NotJoinPoint)
@@ -4070,7 +4079,7 @@ tagRecBinders lvl body_uds details_s
= assertPpr (rhs_ja == joinRhsArity rhs) (ppr rhs_ja $$ ppr uds $$ ppr rhs) $
uds
- will_be_joins :: Bool
+ will_be_joins :: Maybe JoinPointType
will_be_joins = decideRecJoinPointHood lvl unadj_uds bndrs
-- 2. Adjust usage details of each RHS, taking into account the
@@ -4108,42 +4117,50 @@ setBinderOcc occ_info bndr
--
-- See Note [Invariants on join points] in "GHC.Core".
decideRecJoinPointHood :: TopLevelFlag -> UsageDetails
- -> [CoreBndr] -> Bool
-decideRecJoinPointHood lvl usage bndrs
- = all ok bndrs -- Invariant 3: Either all are join points or none are
+ -> [CoreBndr] -> Maybe JoinPointType
+decideRecJoinPointHood lvl usage bndrs = do
+ bndrsNE <- NE.nonEmpty bndrs
+ res <- Semi.sconcat <$> traverse ok bndrsNE -- Invariant 3: Either all are join points or none are
+ pprTraceM "decideRecJoinPointHood" $
+ vcat [ text "bndrs:" <+> ppr bndrs
+ , text "res:" <+> ppr res ]
+ return res
where
ok bndr = okForJoinPoint lvl bndr (lookupTailCallInfo usage bndr)
-okForJoinPoint :: TopLevelFlag -> Id -> TailCallInfo -> Bool
+okForJoinPoint :: TopLevelFlag -> Id -> TailCallInfo -> Maybe JoinPointType
-- See Note [Invariants on join points]; invariants cited by number below.
-- Invariant 2 is always satisfiable by the simplifier by eta expansion.
okForJoinPoint lvl bndr tail_call_info
- | isJoinId bndr -- A current join point should still be one!
+ | Just join_ty <- joinId_maybe bndr
+ -- A current join point should still be one!
= warnPprTrace lost_join "Lost join point" lost_join_doc $
- True
- | valid_join
- = True
+ Just join_ty
| otherwise
- = False
+ = mb_valid_join
where
- valid_join | NotTopLevel <- lvl
- , AlwaysTailCalled { tailCallArity = arity } <- tail_call_info
-
- , -- Invariant 1 as applied to LHSes of rules
- all (ok_rule arity) (idCoreRules bndr)
-
- -- Invariant 2a: stable unfoldings
- -- See Note [Join points and INLINE pragmas]
- , ok_unfolding arity (realIdUnfolding bndr)
-
- -- Invariant 4: Satisfies polymorphism rule
- , isValidJoinPointType arity (idType bndr)
- = True
- | otherwise
- = False
+ mb_valid_join
+ | NotTopLevel <- lvl
+ , AlwaysTailCalled
+ { tailCallArity = arity
+ , tailCallJoinPointType = join_ty
+ } <- tail_call_info
+
+ , -- Invariant 1 as applied to LHSes of rules
+ all (ok_rule arity) (idCoreRules bndr)
+
+ -- Invariant 2a: stable unfoldings
+ -- See Note [Join points and INLINE pragmas]
+ , ok_unfolding arity (realIdUnfolding bndr)
+
+ -- Invariant 4: Satisfies polymorphism rule
+ , isValidJoinPointType arity (idType bndr)
+ = Just join_ty
+ | otherwise
+ = Nothing
lost_join | JoinPoint { joinPointArity = ja } <- idJoinPointHood bndr
- = not valid_join ||
+ = isNothing mb_valid_join ||
(case tail_call_info of -- Valid join but arity differs
AlwaysTailCalled { tailCallArity = ja' } -> ja /= ja'
_ -> False)
=====================================
compiler/GHC/Core/Opt/Simplify/Iteration.hs
=====================================
@@ -2056,6 +2056,17 @@ is a join point, and what 'cont' is, in a value of type MaybeJoinCont
of a SpecConstr-generated RULE for a join point.
-}
+-- SLD TODO horrible logic that must be removed
+peelJoinResTy :: Int -> Type -> Type
+peelJoinResTy 0 ty = ty
+peelJoinResTy n ty
+ | Just (_bndr, inner_ty) <- splitForAllTyCoVar_maybe ty
+ = peelJoinResTy n inner_ty
+ | Just (_, _mult, _arg, res_ty) <- splitFunTy_maybe ty
+ = peelJoinResTy (n-1) res_ty
+ | otherwise
+ = ty
+
simplNonRecJoinPoint :: SimplEnv -> InId -> InExpr
-> InExpr -> SimplCont
-> SimplM (SimplFloats, OutExpr)
@@ -2064,8 +2075,12 @@ simplNonRecJoinPoint env bndr rhs body cont
wrapJoinCont do_case_case env cont $ \ env cont ->
do { -- We push join_cont into the join RHS and the body;
-- and wrap wrap_cont around the whole thing
- ; let mult = contHoleScaling cont
- res_ty = contResultType cont
+ ; let (mult, res_ty)
+ -- SLD TODO
+ | Just QuasiJoinPoint <- occInfoJoinPointType_maybe (idOccInfo bndr)
+ = (idMult bndr, peelJoinResTy (idJoinArity bndr) $ substTy env (idType bndr))
+ | otherwise
+ = (contHoleScaling cont, contResultType cont)
; (env1, bndr1) <- simplNonRecJoinBndr env bndr mult res_ty
; (env2, bndr2) <- addBndrRules env1 bndr bndr1 (BC_Join NonRecursive cont)
; (floats1, env3) <- simplJoinBind NonRecursive cont (bndr,env) (bndr2,env2) (rhs,env)
@@ -2084,8 +2099,13 @@ simplRecJoinPoint :: SimplEnv -> [(InId, InExpr)]
simplRecJoinPoint env pairs body cont
= wrapJoinCont do_case_case env cont $ \ env cont ->
do { let bndrs = map fst pairs
- mult = contHoleScaling cont
- res_ty = contResultType cont
+ (mult, res_ty)
+ -- SLD TODO
+ | [b] <- bndrs
+ , Just QuasiJoinPoint <- occInfoJoinPointType_maybe (idOccInfo b)
+ = (idMult b, peelJoinResTy (idJoinArity b) $ substTy env (idType b))
+ | otherwise
+ = (contHoleScaling cont, contResultType cont)
; env1 <- simplRecJoinBndrs env bndrs mult res_ty
-- NB: bndrs' don't have unfoldings or rules
-- We add them as we go down
@@ -2135,7 +2155,7 @@ trimJoinCont _ NotJoinPoint cont
= cont -- Not a jump
trimJoinCont var (JoinPoint { joinPointType = join_ty, joinPointArity = arity }) cont
| QuasiJoinPoint <- join_ty
- -- As per Note [Quasi join points], don't do any trimming for quasi join points.
+ -- SLD TODO
= cont
| otherwise
= trim arity cont
=====================================
compiler/GHC/Core/Opt/Simplify/Monad.hs
=====================================
@@ -214,7 +214,7 @@ newJoinId bndrs body_ty
-- arity: See Note [Invariants on join points] invariant 2b, in GHC.Core
join_arity = length bndrs
details = JoinId
- { joinIdType = TrueJoinPoint -- SLD TODO this is very suspicious
+ { joinIdType = TrueJoinPoint -- SLD TODO this is suspicious
, joinIdArity = join_arity
, joinIdCbvMarks = Nothing
}
=====================================
compiler/GHC/Types/Id/Info.hs
=====================================
@@ -441,7 +441,7 @@ pprIdDetails other = brackets (pp other)
pp CoVarId = text "CoVarId"
pp (JoinId ty arity marks) = quasi <> text "JoinId" <> parens (int arity) <> parens (ppr marks)
where
- quasi = case ty of { QuasiJoinPoint -> text "quasi"; TrueJoinPoint -> empty }
+ quasi = case ty of { QuasiJoinPoint -> text "Quasi"; TrueJoinPoint -> empty }
{-
************************************************************************
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a3ef7ffcc6418ab11ba039915f99513…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a3ef7ffcc6418ab11ba039915f99513…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Teo Camarasu pushed new branch wip/T26834 at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T26834
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26832] 2 commits: ghc-internal: move considerAccessible to GHC.Internal.Magic
by Teo Camarasu (@teo) 26 Jan '26
by Teo Camarasu (@teo) 26 Jan '26
26 Jan '26
Teo Camarasu pushed to branch wip/T26832 at Glasgow Haskell Compiler / GHC
Commits:
23516844 by Teo Camarasu at 2026-01-26T20:42:39+00:00
ghc-internal: move considerAccessible to GHC.Internal.Magic
Previously it lived in GHC.Internal.Exts, but it really deserves to live
along with the other magic function, which are already re-exported from .Exts
- - - - -
f5cee207 by Teo Camarasu at 2026-01-26T20:51:24+00:00
ghc-internal: move maxTupleSize to GHC.Internal.Tuple
This previously lived in GHC.Internal.Exts but a comment already said it
should be moved to .Tuple
- - - - -
4 changed files:
- compiler/GHC/Builtin/Names.hs
- libraries/ghc-internal/src/GHC/Internal/Exts.hs
- libraries/ghc-internal/src/GHC/Internal/Magic.hs
- libraries/ghc-internal/src/GHC/Internal/Tuple.hs
Changes:
=====================================
compiler/GHC/Builtin/Names.hs
=====================================
@@ -1063,7 +1063,7 @@ alternativeClassKey = mkPreludeMiscIdUnique 754
-- Functions for GHC extensions
considerAccessibleName :: Name
-considerAccessibleName = varQual gHC_INTERNAL_EXTS (fsLit "considerAccessible") considerAccessibleIdKey
+considerAccessibleName = varQual gHC_MAGIC (fsLit "considerAccessible") considerAccessibleIdKey
-- Random GHC.Internal.Base functions
fromStringName, otherwiseIdName, foldrName, buildName, augmentName,
=====================================
libraries/ghc-internal/src/GHC/Internal/Exts.hs
=====================================
@@ -321,10 +321,7 @@ import GHC.Internal.Data.Data
import GHC.Internal.Data.Ord
import qualified GHC.Internal.Debug.Trace
import GHC.Internal.Unsafe.Coerce ( unsafeCoerce# ) -- just for re-export
-
--- XXX This should really be in Data.Tuple, where the definitions are
-maxTupleSize :: Int
-maxTupleSize = 64
+import GHC.Internal.Tuple (maxTupleSize)
-- | 'the' ensures that all the elements of the list are identical
-- and then returns that unique element
@@ -444,27 +441,3 @@ resizeSmallMutableArray# arr0 szNew a s0 =
(# s2, arr1 #) -> case copySmallMutableArray# arr0 0# arr1 0# szOld s2 of
s3 -> (# s3, arr1 #)
else (# s1, arr0 #)
-
--- | Semantically, @considerAccessible = True@. But it has special meaning
--- to the pattern-match checker, which will never flag the clause in which
--- 'considerAccessible' occurs as a guard as redundant or inaccessible.
--- Example:
---
--- > case (x, x) of
--- > (True, True) -> 1
--- > (False, False) -> 2
--- > (True, False) -> 3 -- Warning: redundant
---
--- The pattern-match checker will warn here that the third clause is redundant.
--- It will stop doing so if the clause is adorned with 'considerAccessible':
---
--- > case (x, x) of
--- > (True, True) -> 1
--- > (False, False) -> 2
--- > (True, False) | considerAccessible -> 3 -- No warning
---
--- Put 'considerAccessible' as the last statement of the guard to avoid get
--- confusing results from the pattern-match checker, which takes \"consider
--- accessible\" by word.
-considerAccessible :: Bool
-considerAccessible = True
=====================================
libraries/ghc-internal/src/GHC/Internal/Magic.hs
=====================================
@@ -24,7 +24,7 @@
--
-----------------------------------------------------------------------------
-module GHC.Internal.Magic ( inline, noinline, lazy, oneShot, runRW#, DataToTag(..) ) where
+module GHC.Internal.Magic ( inline, noinline, lazy, oneShot, runRW#, DataToTag(..), considerAccessible ) where
--------------------------------------------------
-- See Note [magicIds] in GHC.Types.Id.Make
@@ -34,7 +34,7 @@ module GHC.Internal.Magic ( inline, noinline, lazy, oneShot, runRW#, DataToTag(.
-- because TYPE is not exported by the source Haskell module generated by
-- genprimops which Haddock will typecheck (#15935).
import GHC.Internal.Prim (State#, realWorld#, RealWorld, Int#)
-import GHC.Internal.Types (RuntimeRep(BoxedRep), TYPE, Levity, Constraint)
+import GHC.Internal.Types (RuntimeRep(BoxedRep), TYPE, Levity, Constraint, Bool(True))
-- | The call @inline f@ arranges that @f@ is inlined, regardless of
-- its size. More precisely, the call @inline f@ rewrites to the
@@ -137,3 +137,27 @@ type DataToTag :: forall {lev :: Levity}. TYPE (BoxedRep lev) -> Constraint
-- So it does not get its own Unsafe module, unlike WithDict.
class DataToTag a where
dataToTag# :: a -> Int#
+
+-- | Semantically, @considerAccessible = True@. But it has special meaning
+-- to the pattern-match checker, which will never flag the clause in which
+-- 'considerAccessible' occurs as a guard as redundant or inaccessible.
+-- Example:
+--
+-- > case (x, x) of
+-- > (True, True) -> 1
+-- > (False, False) -> 2
+-- > (True, False) -> 3 -- Warning: redundant
+--
+-- The pattern-match checker will warn here that the third clause is redundant.
+-- It will stop doing so if the clause is adorned with 'considerAccessible':
+--
+-- > case (x, x) of
+-- > (True, True) -> 1
+-- > (False, False) -> 2
+-- > (True, False) | considerAccessible -> 3 -- No warning
+--
+-- Put 'considerAccessible' as the last statement of the guard to avoid get
+-- confusing results from the pattern-match checker, which takes \"consider
+-- accessible\" by word.
+considerAccessible :: Bool
+considerAccessible = True
=====================================
libraries/ghc-internal/src/GHC/Internal/Tuple.hs
=====================================
@@ -27,10 +27,11 @@ module GHC.Internal.Tuple (
Tuple40(..), Tuple41(..), Tuple42(..), Tuple43(..), Tuple44(..), Tuple45(..), Tuple46(..), Tuple47(..), Tuple48(..), Tuple49(..),
Tuple50(..), Tuple51(..), Tuple52(..), Tuple53(..), Tuple54(..), Tuple55(..), Tuple56(..), Tuple57(..), Tuple58(..), Tuple59(..),
Tuple60(..), Tuple61(..), Tuple62(..), Tuple63(..), Tuple64(..),
+ maxTupleSize,
) where
-- See W1 of Note [Tracking dependencies on primitives] in GHC.Internal.Base
-import GHC.Internal.Types ()
+import GHC.Internal.Types (Int)
default () -- Double and Integer aren't available yet
@@ -598,3 +599,6 @@ data Tuple64 a b c d e f g h i j k l m n o p q r s t u v w x y z a1 b1 c1 d1 e1
r1 s1 t1 u1 v1 w1 x1 y1 z1 a2 b2 c2 d2 e2 f2 g2 h2 i2 j2 k2 l2
= (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a1,b1,c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1,n1,o1,p1,q1,
r1,s1,t1,u1,v1,w1,x1,y1,z1,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2)
+
+maxTupleSize :: Int
+maxTupleSize = 64
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/af41951a5efa750a9dad9ba877ef0d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/af41951a5efa750a9dad9ba877ef0d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
26 Jan '26
sheaf pushed to branch wip/andreask/ticked_joins at Glasgow Haskell Compiler / GHC
Commits:
f84e5d95 by sheaf at 2026-01-26T21:49:00+01:00
WIP: give up on casts
- - - - -
3 changed files:
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Monad.hs
Changes:
=====================================
compiler/GHC/Core/Opt/OccurAnal.hs
=====================================
@@ -2299,7 +2299,7 @@ occ_anal_lam_tail env (Cast expr co)
_ -> usage1
-- usage3: see Note [Quasi join points] in GHC.Core.Opt.Simplify.Iteration.
- usage3 = markAllQuasiTail usage2 -- SLD TODO
+ usage3 = markAllNonTail usage2 -- SLD TODO
in WUD usage3 (Cast expr' co)
@@ -2602,6 +2602,7 @@ occAnal env (Tick tickish body)
| Breakpoint _ _ ids <- tickish
= -- Never substitute for any of the Ids in a Breakpoint
addManyOccs usage_lam (mkVarSet ids)
+
| otherwise
= usage_lam
@@ -2611,7 +2612,7 @@ occAnal env (Cast expr co)
= let (WUD usage expr') = occAnal env expr
usage1 = addManyOccs usage (coVarsOfCo co)
-- usage1: see Note [Gather occurrences of coercion variables]
- usage2 = markAllQuasiTail usage1 -- SLD TODO
+ usage2 = markAllNonTail usage1 -- SLD TODO
-- usage2: see Note [Quasi join points]
in WUD usage2 (Cast expr' co)
@@ -2748,7 +2749,6 @@ occAnalApp env (Var fun, args, ticks)
| fun `hasKey` runRWKey
, [t1, t2, arg] <- args
, WUD usage arg' <- adjustNonRecRhs (Just 1) $ occAnalLamTail env arg
- -- SLD TODO TrueJoinPoint OK here??
= let app_out = mkTicks ticks $ mkApps (Var fun) [t1, t2, arg']
in WUD usage app_out
=====================================
compiler/GHC/Core/Opt/Simplify/Iteration.hs
=====================================
@@ -2135,7 +2135,7 @@ trimJoinCont _ NotJoinPoint cont
= cont -- Not a jump
trimJoinCont var (JoinPoint { joinPointType = join_ty, joinPointArity = arity }) cont
| QuasiJoinPoint <- join_ty
- -- SLD TODO: not sure why we can end up here. Needs further investigation.
+ -- As per Note [Quasi join points], don't do any trimming for quasi join points.
= cont
| otherwise
= trim arity cont
=====================================
compiler/GHC/Core/Opt/Simplify/Monad.hs
=====================================
@@ -214,7 +214,7 @@ newJoinId bndrs body_ty
-- arity: See Note [Invariants on join points] invariant 2b, in GHC.Core
join_arity = length bndrs
details = JoinId
- { joinIdType = TrueJoinPoint
+ { joinIdType = TrueJoinPoint -- SLD TODO this is very suspicious
, joinIdArity = join_arity
, joinIdCbvMarks = Nothing
}
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f84e5d955ab9a3233b5ad30a61310b0…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f84e5d955ab9a3233b5ad30a61310b0…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Teo Camarasu pushed new branch wip/T26832 at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T26832
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc] Pushed new branch wip/jeltsch/ghc-desugar-removal
by Wolfgang Jeltsch (@jeltsch) 26 Jan '26
by Wolfgang Jeltsch (@jeltsch) 26 Jan '26
26 Jan '26
Wolfgang Jeltsch pushed new branch wip/jeltsch/ghc-desugar-removal at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/jeltsch/ghc-desugar-removal
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26830] ghc-internal: move all Data instances to Data.Data
by Teo Camarasu (@teo) 26 Jan '26
by Teo Camarasu (@teo) 26 Jan '26
26 Jan '26
Teo Camarasu pushed to branch wip/T26830 at Glasgow Haskell Compiler / GHC
Commits:
15b48aca by Teo Camarasu at 2026-01-26T20:10:40+00:00
ghc-internal: move all Data instances to Data.Data
Most instances of Data are defined in GHC.Internal.Data.Data.
Let's move all remaining instance there.
This moves other modules down in the dependency hierarchy allowing for
more parallelism, and it decreases the likelihood that we would need to
load this heavy .hi file if we don't actually need it.
Resolves #26830
Metric Decrease:
T12227
T16875
- - - - -
9 changed files:
- libraries/ghc-internal/src/GHC/Internal/Data/Data.hs
- libraries/ghc-internal/src/GHC/Internal/Exts.hs
- libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
Changes:
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/Data.hs
=====================================
@@ -144,6 +144,8 @@ import qualified GHC.Internal.Generics as Generics (Fixity(..))
import GHC.Internal.Generics hiding (Fixity(..))
-- So we can give Data instance for U1, V1, ...
import qualified GHC.Internal.TH.Syntax as TH
+import GHC.Internal.Functor.ZipList (ZipList(..))
+import GHC.Internal.Exts (SpecConstrAnnotation(..))
------------------------------------------------------------------------------
--
@@ -1414,3 +1416,9 @@ deriving instance Data TH.TySynEqn
deriving instance Data TH.Type
deriving instance Data TH.TypeFamilyHead
deriving instance Data flag => Data (TH.TyVarBndr flag)
+
+-- | @since base-4.14.0.0
+deriving instance Data a => Data (ZipList a)
+
+-- | @since base-4.3.0.0
+deriving instance Data SpecConstrAnnotation
=====================================
libraries/ghc-internal/src/GHC/Internal/Exts.hs
=====================================
@@ -5,7 +5,6 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE Unsafe #-}
-{-# LANGUAGE DeriveDataTypeable #-}
{-# OPTIONS_HADDOCK print-explicit-runtime-reps #-}
-----------------------------------------------------------------------------
@@ -317,7 +316,6 @@ import GHC.Internal.IsList (IsList(..)) -- for re-export
import qualified GHC.Internal.Data.Coerce
import GHC.Internal.Data.String
import GHC.Internal.Data.OldList
-import GHC.Internal.Data.Data
import GHC.Internal.Data.Ord
import qualified GHC.Internal.Debug.Trace
import GHC.Internal.Unsafe.Coerce ( unsafeCoerce# ) -- just for re-export
@@ -384,8 +382,7 @@ traceEvent = GHC.Internal.Debug.Trace.traceEventIO
-- entire ghc package at runtime
data SpecConstrAnnotation = NoSpecConstr | ForceSpecConstr
- deriving ( Data -- ^ @since base-4.3.0.0
- , Eq -- ^ @since base-4.3.0.0
+ deriving ( Eq -- ^ @since base-4.3.0.0
)
=====================================
libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
=====================================
@@ -3,7 +3,6 @@
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveFoldable #-}
-{-# LANGUAGE DeriveDataTypeable #-}
module GHC.Internal.Functor.ZipList (ZipList(..)) where
@@ -14,7 +13,6 @@ import GHC.Internal.Read (Read)
import GHC.Internal.Show (Show)
import GHC.Internal.Data.Foldable (Foldable)
import GHC.Internal.Data.Traversable (Traversable(..))
-import GHC.Internal.Data.Data (Data)
-- | Lists, but with an 'Applicative' functor based on zipping.
--
@@ -76,7 +74,3 @@ instance Alternative ZipList where
go (x:xs) (_:ys) = x : go xs ys
go [] ys = ys
go xs _ = xs
-
--- | @since base-4.14.0.0
-deriving instance Data a => Data (ZipList a)
-
=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -11591,7 +11591,6 @@ instance GHC.Internal.Control.Monad.Zip.MonadZip Data.Complex.Complex -- Defined
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Zip.MonadZip f, GHC.Internal.Control.Monad.Zip.MonadZip g) => GHC.Internal.Control.Monad.Zip.MonadZip (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance forall (a :: * -> * -> *) b c. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable b, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable c, GHC.Internal.Data.Data.Data (a b c)) => GHC.Internal.Data.Data.Data (Control.Applicative.WrappedArrow a b c) -- Defined in ‘Control.Applicative’
instance forall (m :: * -> *) a. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable m, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Data.Data.Data (m a)) => GHC.Internal.Data.Data.Data (Control.Applicative.WrappedMonad m a) -- Defined in ‘Control.Applicative’
-instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Functor.ZipList.ZipList a) -- Defined in ‘GHC.Internal.Functor.ZipList’
instance GHC.Internal.Data.Data.Data Data.Array.Byte.ByteArray -- Defined in ‘Data.Array.Byte’
instance forall s. ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable s => GHC.Internal.Data.Data.Data (Data.Array.Byte.MutableByteArray s) -- Defined in ‘Data.Array.Byte’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Complex.Complex a) -- Defined in ‘Data.Complex’
@@ -11694,6 +11693,7 @@ instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.SourceStrictness --
instance GHC.Internal.Data.Data.Data GHC.Internal.Generics.SourceStrictness -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.SourceUnpackedness -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Generics.SourceUnpackedness -- Defined in ‘GHC.Internal.Data.Data’
+instance GHC.Internal.Data.Data.Data GHC.Internal.Exts.SpecConstrAnnotation -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.Specificity -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.Stmt -- Defined in ‘GHC.Internal.Data.Data’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Data.Semigroup.Internal.Sum a) -- Defined in ‘GHC.Internal.Data.Data’
@@ -11719,6 +11719,7 @@ instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word32 -- Defined in ‘G
instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word64 -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word8 -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Foreign.Ptr.WordPtr -- Defined in ‘GHC.Internal.Data.Data’
+instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Functor.ZipList.ZipList a) -- Defined in ‘GHC.Internal.Data.Data’
instance forall k (a :: k). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a) => GHC.Internal.Data.Data.Data (Data.Fixed.Fixed a) -- Defined in ‘Data.Fixed’
instance forall k1 (f :: k1 -> *) k2 (g :: k2 -> k1) (a :: k2). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable f, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable g, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k1, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k2, GHC.Internal.Data.Data.Data (f (g a))) => GHC.Internal.Data.Data.Data (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’
instance [safe] forall k (f :: k -> *) (g :: k -> *) (a :: k). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable f, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable g, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k, GHC.Internal.Data.Data.Data (f a), GHC.Internal.Data.Data.Data (g a)) => GHC.Internal.Data.Data.Data (Data.Functor.Product.Product f g a) -- Defined in ‘Data.Functor.Product’
@@ -11729,7 +11730,6 @@ instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Semigroup.Max a) -- Defined in ‘Data.Semigroup’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Semigroup.Min a) -- Defined in ‘Data.Semigroup’
instance forall m. GHC.Internal.Data.Data.Data m => GHC.Internal.Data.Data.Data (Data.Semigroup.WrappedMonoid m) -- Defined in ‘Data.Semigroup’
-instance GHC.Internal.Data.Data.Data GHC.Internal.Exts.SpecConstrAnnotation -- Defined in ‘GHC.Internal.Exts’
instance forall m. GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Data.Functor.Const.Const m) -- Defined in ‘GHC.Internal.Data.Functor.Const’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Data.Foldable’
=====================================
testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
=====================================
@@ -11618,7 +11618,6 @@ instance GHC.Internal.Control.Monad.Zip.MonadZip Data.Complex.Complex -- Defined
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Zip.MonadZip f, GHC.Internal.Control.Monad.Zip.MonadZip g) => GHC.Internal.Control.Monad.Zip.MonadZip (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance forall (a :: * -> * -> *) b c. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable b, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable c, GHC.Internal.Data.Data.Data (a b c)) => GHC.Internal.Data.Data.Data (Control.Applicative.WrappedArrow a b c) -- Defined in ‘Control.Applicative’
instance forall (m :: * -> *) a. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable m, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Data.Data.Data (m a)) => GHC.Internal.Data.Data.Data (Control.Applicative.WrappedMonad m a) -- Defined in ‘Control.Applicative’
-instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Functor.ZipList.ZipList a) -- Defined in ‘GHC.Internal.Functor.ZipList’
instance GHC.Internal.Data.Data.Data Data.Array.Byte.ByteArray -- Defined in ‘Data.Array.Byte’
instance forall s. ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable s => GHC.Internal.Data.Data.Data (Data.Array.Byte.MutableByteArray s) -- Defined in ‘Data.Array.Byte’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Complex.Complex a) -- Defined in ‘Data.Complex’
@@ -11721,6 +11720,7 @@ instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.SourceStrictness --
instance GHC.Internal.Data.Data.Data GHC.Internal.Generics.SourceStrictness -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.SourceUnpackedness -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Generics.SourceUnpackedness -- Defined in ‘GHC.Internal.Data.Data’
+instance GHC.Internal.Data.Data.Data GHC.Internal.Exts.SpecConstrAnnotation -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.Specificity -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.Stmt -- Defined in ‘GHC.Internal.Data.Data’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Data.Semigroup.Internal.Sum a) -- Defined in ‘GHC.Internal.Data.Data’
@@ -11746,6 +11746,7 @@ instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word32 -- Defined in ‘G
instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word64 -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word8 -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Foreign.Ptr.WordPtr -- Defined in ‘GHC.Internal.Data.Data’
+instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Functor.ZipList.ZipList a) -- Defined in ‘GHC.Internal.Data.Data’
instance forall k (a :: k). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a) => GHC.Internal.Data.Data.Data (Data.Fixed.Fixed a) -- Defined in ‘Data.Fixed’
instance forall k1 (f :: k1 -> *) k2 (g :: k2 -> k1) (a :: k2). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable f, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable g, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k1, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k2, GHC.Internal.Data.Data.Data (f (g a))) => GHC.Internal.Data.Data.Data (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’
instance [safe] forall k (f :: k -> *) (g :: k -> *) (a :: k). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable f, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable g, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k, GHC.Internal.Data.Data.Data (f a), GHC.Internal.Data.Data.Data (g a)) => GHC.Internal.Data.Data.Data (Data.Functor.Product.Product f g a) -- Defined in ‘Data.Functor.Product’
@@ -11756,7 +11757,6 @@ instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Semigroup.Max a) -- Defined in ‘Data.Semigroup’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Semigroup.Min a) -- Defined in ‘Data.Semigroup’
instance forall m. GHC.Internal.Data.Data.Data m => GHC.Internal.Data.Data.Data (Data.Semigroup.WrappedMonoid m) -- Defined in ‘Data.Semigroup’
-instance GHC.Internal.Data.Data.Data GHC.Internal.Exts.SpecConstrAnnotation -- Defined in ‘GHC.Internal.Exts’
instance forall m. GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Data.Functor.Const.Const m) -- Defined in ‘GHC.Internal.Data.Functor.Const’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Data.Foldable’
=====================================
testsuite/tests/interface-stability/base-exports.stdout-mingw32
=====================================
@@ -11849,7 +11849,6 @@ instance GHC.Internal.Control.Monad.Zip.MonadZip Data.Complex.Complex -- Defined
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Zip.MonadZip f, GHC.Internal.Control.Monad.Zip.MonadZip g) => GHC.Internal.Control.Monad.Zip.MonadZip (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance forall (a :: * -> * -> *) b c. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable b, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable c, GHC.Internal.Data.Data.Data (a b c)) => GHC.Internal.Data.Data.Data (Control.Applicative.WrappedArrow a b c) -- Defined in ‘Control.Applicative’
instance forall (m :: * -> *) a. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable m, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Data.Data.Data (m a)) => GHC.Internal.Data.Data.Data (Control.Applicative.WrappedMonad m a) -- Defined in ‘Control.Applicative’
-instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Functor.ZipList.ZipList a) -- Defined in ‘GHC.Internal.Functor.ZipList’
instance GHC.Internal.Data.Data.Data Data.Array.Byte.ByteArray -- Defined in ‘Data.Array.Byte’
instance forall s. ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable s => GHC.Internal.Data.Data.Data (Data.Array.Byte.MutableByteArray s) -- Defined in ‘Data.Array.Byte’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Complex.Complex a) -- Defined in ‘Data.Complex’
@@ -11952,6 +11951,7 @@ instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.SourceStrictness --
instance GHC.Internal.Data.Data.Data GHC.Internal.Generics.SourceStrictness -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.SourceUnpackedness -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Generics.SourceUnpackedness -- Defined in ‘GHC.Internal.Data.Data’
+instance GHC.Internal.Data.Data.Data GHC.Internal.Exts.SpecConstrAnnotation -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.Specificity -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.Stmt -- Defined in ‘GHC.Internal.Data.Data’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Data.Semigroup.Internal.Sum a) -- Defined in ‘GHC.Internal.Data.Data’
@@ -11977,6 +11977,7 @@ instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word32 -- Defined in ‘G
instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word64 -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word8 -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Foreign.Ptr.WordPtr -- Defined in ‘GHC.Internal.Data.Data’
+instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Functor.ZipList.ZipList a) -- Defined in ‘GHC.Internal.Data.Data’
instance forall k (a :: k). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a) => GHC.Internal.Data.Data.Data (Data.Fixed.Fixed a) -- Defined in ‘Data.Fixed’
instance forall k1 (f :: k1 -> *) k2 (g :: k2 -> k1) (a :: k2). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable f, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable g, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k1, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k2, GHC.Internal.Data.Data.Data (f (g a))) => GHC.Internal.Data.Data.Data (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’
instance [safe] forall k (f :: k -> *) (g :: k -> *) (a :: k). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable f, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable g, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k, GHC.Internal.Data.Data.Data (f a), GHC.Internal.Data.Data.Data (g a)) => GHC.Internal.Data.Data.Data (Data.Functor.Product.Product f g a) -- Defined in ‘Data.Functor.Product’
@@ -11987,7 +11988,6 @@ instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Semigroup.Max a) -- Defined in ‘Data.Semigroup’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Semigroup.Min a) -- Defined in ‘Data.Semigroup’
instance forall m. GHC.Internal.Data.Data.Data m => GHC.Internal.Data.Data.Data (Data.Semigroup.WrappedMonoid m) -- Defined in ‘Data.Semigroup’
-instance GHC.Internal.Data.Data.Data GHC.Internal.Exts.SpecConstrAnnotation -- Defined in ‘GHC.Internal.Exts’
instance forall m. GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Data.Functor.Const.Const m) -- Defined in ‘GHC.Internal.Data.Functor.Const’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Data.Foldable’
=====================================
testsuite/tests/interface-stability/base-exports.stdout-ws-32
=====================================
@@ -11591,7 +11591,6 @@ instance GHC.Internal.Control.Monad.Zip.MonadZip Data.Complex.Complex -- Defined
instance [safe] forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Zip.MonadZip f, GHC.Internal.Control.Monad.Zip.MonadZip g) => GHC.Internal.Control.Monad.Zip.MonadZip (Data.Functor.Product.Product f g) -- Defined in ‘Data.Functor.Product’
instance forall (a :: * -> * -> *) b c. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable b, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable c, GHC.Internal.Data.Data.Data (a b c)) => GHC.Internal.Data.Data.Data (Control.Applicative.WrappedArrow a b c) -- Defined in ‘Control.Applicative’
instance forall (m :: * -> *) a. (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable m, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, GHC.Internal.Data.Data.Data (m a)) => GHC.Internal.Data.Data.Data (Control.Applicative.WrappedMonad m a) -- Defined in ‘Control.Applicative’
-instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Functor.ZipList.ZipList a) -- Defined in ‘GHC.Internal.Functor.ZipList’
instance GHC.Internal.Data.Data.Data Data.Array.Byte.ByteArray -- Defined in ‘Data.Array.Byte’
instance forall s. ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable s => GHC.Internal.Data.Data.Data (Data.Array.Byte.MutableByteArray s) -- Defined in ‘Data.Array.Byte’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Complex.Complex a) -- Defined in ‘Data.Complex’
@@ -11694,6 +11693,7 @@ instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.SourceStrictness --
instance GHC.Internal.Data.Data.Data GHC.Internal.Generics.SourceStrictness -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.SourceUnpackedness -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Generics.SourceUnpackedness -- Defined in ‘GHC.Internal.Data.Data’
+instance GHC.Internal.Data.Data.Data GHC.Internal.Exts.SpecConstrAnnotation -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.Specificity -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.TH.Syntax.Stmt -- Defined in ‘GHC.Internal.Data.Data’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Data.Semigroup.Internal.Sum a) -- Defined in ‘GHC.Internal.Data.Data’
@@ -11719,6 +11719,7 @@ instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word32 -- Defined in ‘G
instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word64 -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Word.Word8 -- Defined in ‘GHC.Internal.Data.Data’
instance GHC.Internal.Data.Data.Data GHC.Internal.Foreign.Ptr.WordPtr -- Defined in ‘GHC.Internal.Data.Data’
+instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (GHC.Internal.Functor.ZipList.ZipList a) -- Defined in ‘GHC.Internal.Data.Data’
instance forall k (a :: k). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a) => GHC.Internal.Data.Data.Data (Data.Fixed.Fixed a) -- Defined in ‘Data.Fixed’
instance forall k1 (f :: k1 -> *) k2 (g :: k2 -> k1) (a :: k2). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable f, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable g, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k1, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k2, GHC.Internal.Data.Data.Data (f (g a))) => GHC.Internal.Data.Data.Data (Data.Functor.Compose.Compose f g a) -- Defined in ‘Data.Functor.Compose’
instance [safe] forall k (f :: k -> *) (g :: k -> *) (a :: k). (ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable a, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable f, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable g, ghc-internal-9.1500.0:GHC.Internal.Data.Typeable.Internal.Typeable k, GHC.Internal.Data.Data.Data (f a), GHC.Internal.Data.Data.Data (g a)) => GHC.Internal.Data.Data.Data (Data.Functor.Product.Product f g a) -- Defined in ‘Data.Functor.Product’
@@ -11729,7 +11730,6 @@ instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Semigroup.Max a) -- Defined in ‘Data.Semigroup’
instance forall a. GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Data.Semigroup.Min a) -- Defined in ‘Data.Semigroup’
instance forall m. GHC.Internal.Data.Data.Data m => GHC.Internal.Data.Data.Data (Data.Semigroup.WrappedMonoid m) -- Defined in ‘Data.Semigroup’
-instance GHC.Internal.Data.Data.Data GHC.Internal.Exts.SpecConstrAnnotation -- Defined in ‘GHC.Internal.Exts’
instance forall m. GHC.Internal.Data.Foldable.Foldable (GHC.Internal.Data.Functor.Const.Const m) -- Defined in ‘GHC.Internal.Data.Functor.Const’
instance GHC.Internal.Data.Foldable.Foldable GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Foldable.Foldable f, GHC.Internal.Data.Foldable.Foldable g) => GHC.Internal.Data.Foldable.Foldable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Data.Foldable’
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout
=====================================
@@ -11186,7 +11186,6 @@ instance forall a. GHC.Internal.Classes.Ord (GHC.Internal.Ptr.FunPtr a) -- Defin
instance forall a. GHC.Internal.Classes.Ord (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.Internal.Ptr’
instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’
instance GHC.Internal.Classes.Ord GHC.Internal.Base.Void -- Defined in ‘GHC.Internal.Base’
-instance GHC.Internal.Data.Data.Data GHC.Internal.Exts.SpecConstrAnnotation -- Defined in ‘GHC.Internal.Exts’
instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.String’
instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Data.String’
instance forall a. (a ~ GHC.Internal.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
=====================================
@@ -11189,7 +11189,6 @@ instance forall a. GHC.Internal.Classes.Ord (GHC.Internal.Ptr.FunPtr a) -- Defin
instance forall a. GHC.Internal.Classes.Ord (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.Internal.Ptr’
instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’
instance GHC.Internal.Classes.Ord GHC.Internal.Base.Void -- Defined in ‘GHC.Internal.Base’
-instance GHC.Internal.Data.Data.Data GHC.Internal.Exts.SpecConstrAnnotation -- Defined in ‘GHC.Internal.Exts’
instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.String’
instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Data.String’
instance forall a. (a ~ GHC.Internal.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/15b48aca8435ad4f92b83d320762498…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/15b48aca8435ad4f92b83d320762498…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
sheaf pushed to branch wip/andreask/ticked_joins at Glasgow Haskell Compiler / GHC
Commits:
e7146154 by sheaf at 2026-01-26T20:42:55+01:00
WIP fixes
- - - - -
5 changed files:
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Exitify.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Types/Tickish.hs
Changes:
=====================================
compiler/GHC/Core/Lint.hs
=====================================
@@ -935,7 +935,12 @@ lintCoreExpr (Tick tickish expr)
-- ; when block_joins
; pure r}
where
- block_joins = not (tickishCanScopeJoin tickish)
+ block_joins
+ | ProfNote {} <- tickish
+ = False -- Turns a true join point into a quasi join point.
+ -- SLD TODO: proper Core Lint support for quasi join points.
+ | otherwise
+ = not (tickishCanScopeJoin tickish)
-- TODO Consider whether this is the correct rule. It is consistent with
-- the simplifier's behaviour - cost-centre-scoped ticks become part of
-- the continuation, and thus they behave like part of an evaluation
=====================================
compiler/GHC/Core/Opt/Exitify.hs
=====================================
@@ -226,7 +226,7 @@ exitifyRec in_scope pairs
let rhs = mkLams abs_vars e
avoid = in_scope `extendInScopeSetList` captured
-- Remember this binding under a suitable name
- ; v <- addExit avoid TrueJoinPoint (length abs_vars) rhs
+ ; v <- addExit avoid (length abs_vars) rhs
-- And jump to it from here
; return $ mkVarApps (Var v) abs_vars }
@@ -273,11 +273,11 @@ mkExitJoinId in_scope ty join_ty join_arity = do
asJoinId (mkSysLocal (fsLit "exit") initExitJoinUnique ManyTy ty)
join_ty join_arity
-addExit :: InScopeSet -> JoinPointType -> JoinArity -> CoreExpr -> ExitifyM JoinId
-addExit in_scope join_ty join_arity rhs = do
+addExit :: InScopeSet -> JoinArity -> CoreExpr -> ExitifyM JoinId
+addExit in_scope join_arity rhs = do
-- Pick a suitable name
let ty = exprType rhs
- v <- mkExitJoinId in_scope ty join_ty join_arity
+ v <- mkExitJoinId in_scope ty TrueJoinPoint join_arity
fs <- get
put ((v,rhs):fs)
return v
=====================================
compiler/GHC/Core/Opt/OccurAnal.hs
=====================================
@@ -2299,7 +2299,7 @@ occ_anal_lam_tail env (Cast expr co)
_ -> usage1
-- usage3: see Note [Quasi join points] in GHC.Core.Opt.Simplify.Iteration.
- usage3 = markAllNonTail usage2 -- SLD TODO: markAllQuasiTail but this prevenst GHC bootstrapping
+ usage3 = markAllQuasiTail usage2 -- SLD TODO
in WUD usage3 (Cast expr' co)
@@ -2611,7 +2611,7 @@ occAnal env (Cast expr co)
= let (WUD usage expr') = occAnal env expr
usage1 = addManyOccs usage (coVarsOfCo co)
-- usage1: see Note [Gather occurrences of coercion variables]
- usage2 = markAllNonTail usage1 -- SLD TODO: markAllQuasiTail but this prevenst GHC bootstrapping
+ usage2 = markAllQuasiTail usage1 -- SLD TODO
-- usage2: see Note [Quasi join points]
in WUD usage2 (Cast expr' co)
@@ -3874,8 +3874,10 @@ markAllManyNonTail = markAllMany . markAllNonTail -- effectively sets to noOccIn
markAllNonTail ud@(UD { ud_env = env }) =
ud { ud_z_tail = fmap (const MarkNonTail) env }
-markAllQuasiTail ud@(UD { ud_env = env }) =
- ud { ud_z_tail = fmap (const MarkQuasi) env }
+markAllQuasiTail ud@(UD { ud_env = env, ud_z_tail = z_tail }) =
+ let quasis = fmap (const MarkQuasi) env
+ in ud { ud_z_tail = strictPlusVarEnv_C (Semi.<>) quasis z_tail }
+ -- NB: be careful not to override any MarkNonTail with MarkQuasi.
markAllInsideLamIf, markAllNonTailIf :: HasDebugCallStack => Bool -> UsageDetails -> UsageDetails
=====================================
compiler/GHC/Core/Opt/Simplify/Iteration.hs
=====================================
@@ -2134,9 +2134,11 @@ trimJoinCont :: Id -- Used only in error message
trimJoinCont _ NotJoinPoint cont
= cont -- Not a jump
trimJoinCont var (JoinPoint { joinPointType = join_ty, joinPointArity = arity }) cont
- = assertPpr (join_ty == TrueJoinPoint)
- (text "trimJoinCont: unexpected quasi join point:" <+> ppr var) $
- trim arity cont
+ | QuasiJoinPoint <- join_ty
+ -- SLD TODO: not sure why we can end up here. Needs further investigation.
+ = cont
+ | otherwise
+ = trim arity cont
where
trim 0 cont@(Stop {})
= cont
=====================================
compiler/GHC/Types/Tickish.hs
=====================================
@@ -330,7 +330,8 @@ tickishCanSplit _ = False
-- | Is @join f x in <tick> jump f x@ valid?
tickishCanScopeJoin :: GenTickish pass -> Bool
tickishCanScopeJoin tick = case tick of
- ProfNote{} -> True
+ ProfNote{} -> False -- Turns the join point into a quasi join point.
+ -- See Note [Quasi join points]
HpcTick{} -> False
Breakpoint{} -> False
SourceNote{} -> True
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e7146154eb711d91c03f703fbdf83d7…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e7146154eb711d91c03f703fbdf83d7…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
26 Jan '26
sheaf pushed to branch wip/andreask/ticked_joins at Glasgow Haskell Compiler / GHC
Commits:
425073c8 by sheaf at 2026-01-26T20:00:08+01:00
WIP: refactoring
- - - - -
591bc759 by sheaf at 2026-01-26T20:26:19+01:00
WIP fixes
- - - - -
19 changed files:
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Exitify.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Monad.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Ppr.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Id.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/GHC/Types/Tickish.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
Changes:
=====================================
compiler/GHC/Core/Lint.hs
=====================================
@@ -935,7 +935,12 @@ lintCoreExpr (Tick tickish expr)
-- ; when block_joins
; pure r}
where
- block_joins = not (tickishCanScopeJoin tickish)
+ block_joins
+ | ProfNote {} <- tickish
+ = False -- Turns a true join point into a quasi join point.
+ -- SLD TODO: proper Core Lint support for quasi join points.
+ | otherwise
+ = not (tickishCanScopeJoin tickish)
-- TODO Consider whether this is the correct rule. It is consistent with
-- the simplifier's behaviour - cost-centre-scoped ticks become part of
-- the continuation, and thus they behave like part of an evaluation
@@ -1021,22 +1026,27 @@ lintCoreExpr e@(App _ _)
; return app_pair}
where
- skipTick t = case collectFunSimple e of
- (Var v) -> etaExpansionTick v t
- _ -> tickishFloatable t
- (fun, args, _source_ticks) = collectArgsTicks skipTick e
- -- We must look through source ticks to avoid #21152, for example:
+ skipTick t =
+ case collectFunSimple e of
+ Var v -> canCollectArgsThroughTick v t
+ _ -> tickishFloatable t
+ (fun, args, _ticks) = collectArgsTicks skipTick e
+ -- We must look through ticks, using similar logic as CorePrep does,
+ -- otherwise we may fail to spot a saturated application.
+ --
+ -- 1. Look through floatable ticks, as per Note [Eta expansion and source notes]
+ -- in GHC.Core.Opt.Arity. We need to do this to avoid e.g.:
+ --
+ -- reallyUnsafePtrEquality
+ -- = \ @a ->
+ -- (src<loc> reallyUnsafePtrEquality#)
+ -- @Lifted @a @Lifted @a
--
- -- reallyUnsafePtrEquality
- -- = \ @a ->
- -- (src<loc> reallyUnsafePtrEquality#)
- -- @Lifted @a @Lifted @a
+ -- 2. Look through profiling ticks when the head of the application must
+ -- always remain saturated (e.g. a primop or a join point), as per
+ -- Note [Ticks and mandatory eta expansion] in GHC.CoreToStg.Prep.
--
- -- To do this, we use `collectArgsTicks tickishFloatable` to match
- -- the eta expansion behaviour, as per Note [Eta expansion and source notes]
- -- in GHC.Core.Opt.Arity.
- -- Sadly this was not quite enough. So we now also accept things that CorePrep will allow.
- -- See Note [Ticks and mandatory eta expansion]
+ -- To do this, we use 'canCollectArgsThroughTick', as CorePrep does.
lintCoreExpr (Lam var expr)
= markAllJoinsBad $
=====================================
compiler/GHC/Core/Opt/Exitify.hs
=====================================
@@ -226,7 +226,7 @@ exitifyRec in_scope pairs
let rhs = mkLams abs_vars e
avoid = in_scope `extendInScopeSetList` captured
-- Remember this binding under a suitable name
- ; v <- addExit avoid TrueJoinPoint (length abs_vars) rhs
+ ; v <- addExit avoid (length abs_vars) rhs
-- And jump to it from here
; return $ mkVarApps (Var v) abs_vars }
@@ -262,7 +262,7 @@ exitifyRec in_scope pairs
-- * the free variables of the whole joinrec
-- * any bound variables (captured)
-- * any exit join points created so far.
-mkExitJoinId :: InScopeSet -> Type -> JoinType -> JoinArity -> ExitifyM JoinId
+mkExitJoinId :: InScopeSet -> Type -> JoinPointType -> JoinArity -> ExitifyM JoinId
mkExitJoinId in_scope ty join_ty join_arity = do
fs <- get
let avoid = in_scope `extendInScopeSetList` (map fst fs)
@@ -273,11 +273,11 @@ mkExitJoinId in_scope ty join_ty join_arity = do
asJoinId (mkSysLocal (fsLit "exit") initExitJoinUnique ManyTy ty)
join_ty join_arity
-addExit :: InScopeSet -> JoinType -> JoinArity -> CoreExpr -> ExitifyM JoinId
-addExit in_scope join_ty join_arity rhs = do
+addExit :: InScopeSet -> JoinArity -> CoreExpr -> ExitifyM JoinId
+addExit in_scope join_arity rhs = do
-- Pick a suitable name
let ty = exprType rhs
- v <- mkExitJoinId in_scope ty join_ty join_arity
+ v <- mkExitJoinId in_scope ty TrueJoinPoint join_arity
fs <- get
put ((v,rhs):fs)
return v
=====================================
compiler/GHC/Core/Opt/OccurAnal.hs
=====================================
@@ -1126,7 +1126,7 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs
-- returned by of occAnalLamTail. It's totally OK for them to mismatch;
-- hence adjust the UDs from the RHS
- WUD adj_rhs_uds final_rhs = adjustNonRecRhs mb_join $
+ WUD adj_rhs_uds final_rhs = adjustNonRecRhs (joinPointHoodArity mb_join) $
occAnalLamTail rhs_env rhs
final_bndr_with_rules
| noBinderSwaps env = bndr -- See Note [Unfoldings and rules]
@@ -1140,7 +1140,8 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs
-- See Note [Join points and unfoldings/rules]
unf = idUnfolding bndr
WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf
- adj_unf_uds = adjustTailArity mb_join unf_tuds
+ adj_unf_uds = adjustTailArity mb_join_arity unf_tuds
+ mb_join_arity = joinPointHoodArity mb_join
--------- Rules ---------
-- See Note [Rules are extra RHSs] and Note [Rule dependency info]
@@ -1160,7 +1161,7 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs
adj_rule_uds :: [UsageDetails]
adj_rule_uds = imp_rule_uds ++
- [ l `andUDs` adjustTailArity mb_join r
+ [ l `andUDs` adjustTailArity mb_join_arity r
| (_,l,r) <- rules_w_uds ]
mkNonRecRhsCtxt :: TopLevelFlag -> Id -> Unfolding -> OccEncl
@@ -1215,7 +1216,7 @@ occAnalRec !_ lvl
= WUD body_uds binds
| otherwise
= let (bndr', mb_join) = tagNonRecBinder lvl occ bndr
- !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds
+ !(WUD rhs_uds' rhs') = adjustNonRecRhs (joinPointHoodArity mb_join) wtuds
in WUD (body_uds `andUDs` rhs_uds')
(NonRec bndr' rhs' : binds)
where
@@ -1831,7 +1832,7 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs)
unf = realIdUnfolding bndr -- realIdUnfolding: Ignore loop-breaker-ness
-- here because that is what we are setting!
WTUD unf_tuds unf' = occAnalUnfolding rhs_env unf
- adj_unf_uds = adjustTailArity (JoinPoint True rhs_ja) unf_tuds
+ adj_unf_uds = adjustTailArity (Just rhs_ja) unf_tuds
-- `rhs_ja` is `joinRhsArity rhs` and is the prediction for source MAr
-- of Note [Join arity prediction based on joinRhsArity]
@@ -1846,7 +1847,7 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs)
-- `rhs_ja` is `joinRhsArity rhs'` and is the prediction for source MAr
-- of Note [Join arity prediction based on joinRhsArity]
rules_w_uds :: [(CoreRule, UsageDetails, UsageDetails)]
- rules_w_uds = [ (r,l,adjustTailArity (JoinPoint True rhs_ja) rhs_wuds)
+ rules_w_uds = [ (r,l,adjustTailArity (Just rhs_ja) rhs_wuds)
| rule <- idCoreRules bndr
, let (r,l,rhs_wuds) = occAnalRule rhs_env rule ]
rules' = map fstOf3 rules_w_uds
@@ -2298,7 +2299,7 @@ occ_anal_lam_tail env (Cast expr co)
_ -> usage1
-- usage3: see Note [Quasi join points] in GHC.Core.Opt.Simplify.Iteration.
- usage3 = markAllQuasiTail usage2
+ usage3 = markAllQuasiTail usage2 -- SLD TODO
in WUD usage3 (Cast expr' co)
@@ -2606,19 +2607,11 @@ occAnal env (Tick tickish body)
usage_lam = markAllNonTail (markAllInsideLam usage)
- -- TODO There may be ways to make ticks and join points play
- -- nicer together, but right now there are problems:
- -- let j x = ... in tick<t> (j 1)
- -- Making j a join point may cause the simplifier to drop t
- -- (if the tick is put into the continuation). So we don't
- -- count j 1 as a tail call.
- -- See #14242.
-
occAnal env (Cast expr co)
= let (WUD usage expr') = occAnal env expr
usage1 = addManyOccs usage (coVarsOfCo co)
-- usage1: see Note [Gather occurrences of coercion variables]
- usage2 = markAllQuasiTail usage1
+ usage2 = markAllQuasiTail usage1 -- SLD TODO
-- usage2: see Note [Quasi join points]
in WUD usage2 (Cast expr' co)
@@ -2626,7 +2619,7 @@ occAnal env app@(App _ _)
= occAnalApp env (collectArgsTicks tickishFloatable app)
occAnal env expr@(Lam {})
- = adjustNonRecRhs NotJoinPoint $ -- NotJoinPoint <=> markAllManyNonTail
+ = adjustNonRecRhs Nothing $ -- Nothing <=> markAllManyNonTail
occAnalLamTail env expr
occAnal env (Case scrut bndr ty alts)
@@ -2754,7 +2747,8 @@ occAnalApp env (Var fun, args, ticks)
-- This caused #18296
| fun `hasKey` runRWKey
, [t1, t2, arg] <- args
- , WUD usage arg' <- adjustNonRecRhs (JoinPoint True 1) $ occAnalLamTail env arg
+ , WUD usage arg' <- adjustNonRecRhs (Just 1) $ occAnalLamTail env arg
+ -- SLD TODO TrueJoinPoint OK here??
= let app_out = mkTicks ticks $ mkApps (Var fun) [t1, t2, arg']
in WUD usage app_out
@@ -3814,8 +3808,8 @@ mkOneOcc !env id int_cxt arity
, lo_tail =
AlwaysTailCalled
{ tailCallArity = arity
- , trueTailCall = True
- -- ^ Start off as a true join point.
+ , tailCallJoinPointType = TrueJoinPoint
+ -- Start off as a true join point.
-- Updated by occurrence analysis.
--
-- See Note [Quasi join points] in GHC.Core.Opt.Simplify.Iteration.
@@ -3903,7 +3897,11 @@ maybeZapTailCallInfo tail_info0 z_tail id_unique =
Just MarkNonTail -> NoTailCallInfo
-- See Note [Quasi join points] in GHC.Core.Opt.Simplify.Iteration.
- Just MarkQuasi -> tail_info0 { trueTailCall = False }
+ Just MarkQuasi ->
+ case tail_info0 of
+ NoTailCallInfo -> NoTailCallInfo
+ atc@AlwaysTailCalled {} ->
+ atc { tailCallJoinPointType = QuasiJoinPoint }
Nothing -> tail_info0
@@ -3974,7 +3972,7 @@ lookupOccInfoByUnique (UD { ud_env = env
-------------------
-- See Note [Adjusting right-hand sides]
-adjustNonRecRhs :: JoinPointHood
+adjustNonRecRhs :: Maybe JoinArity
-> WithTailUsageDetails CoreExpr
-> WithUsageDetails CoreExpr
-- ^ This function concentrates shared logic between occAnalNonRecBind and the
@@ -3985,8 +3983,8 @@ adjustNonRecRhs mb_join_arity (WTUD (TUD rhs_ja uds) rhs)
where
exact_join =
case mb_join_arity of
- NotJoinPoint -> False
- JoinPoint { joinPointArity = ja' } -> ja' == rhs_ja
+ Nothing -> False
+ Just ja' -> ja' == rhs_ja
adjustTailUsage :: Bool -- True <=> Exactly-matching join point; don't do markNonTail
-> CoreExpr -- Rhs usage, AFTER occAnalLamTail
@@ -4000,12 +3998,12 @@ adjustTailUsage exact_join rhs uds
where
one_shot = isOneShotFun rhs
-adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails
+adjustTailArity :: Maybe JoinArity -> TailUsageDetails -> UsageDetails
adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf not_same_arity usage
where
not_same_arity = case mb_rhs_ja of
- NotJoinPoint -> True
- JoinPoint { joinPointArity = ja' } -> ja' /= ja
+ Nothing -> True
+ Just ja' -> ja' /= ja
type IdWithOccInfo = Id
@@ -4037,8 +4035,11 @@ tagNonRecBinder :: TopLevelFlag -- At top level?
-- Precondition: OccInfo is not IAmDead
tagNonRecBinder lvl occ bndr
| okForJoinPoint lvl bndr tail_call_info
- , AlwaysTailCalled { tailCallArity = ar, trueTailCall = true } <- tail_call_info
- = (setBinderOcc occ bndr, JoinPoint true ar)
+ , AlwaysTailCalled
+ { tailCallArity = ar
+ , tailCallJoinPointType = join_ty
+ } <- tail_call_info
+ = (setBinderOcc occ bndr, JoinPoint join_ty ar)
| otherwise
= (setBinderOcc zapped_occ bndr, NotJoinPoint)
where
@@ -4229,5 +4230,5 @@ orLocalOcc occ1 occ2 = andLocalOcc occ1 occ2
andTailCallInfo :: TailCallInfo -> TailCallInfo -> TailCallInfo
andTailCallInfo (AlwaysTailCalled arity1 true1) (AlwaysTailCalled arity2 true2)
- | arity1 == arity2 = AlwaysTailCalled arity1 (true1 && true2)
+ | arity1 == arity2 = AlwaysTailCalled arity1 (true1 Semi.<> true2)
andTailCallInfo _ _ = NoTailCallInfo
=====================================
compiler/GHC/Core/Opt/SetLevels.hs
=====================================
@@ -1889,11 +1889,10 @@ newPolyBndrs dest_lvl
dest_is_top = isTopLvl dest_lvl
transfer_join_info bndr new_bndr
| JoinPoint
- { isTrueJoinPoint = true_join
+ { joinPointType = join_ty
, joinPointArity = join_arity }
<- idJoinPointHood bndr
, not dest_is_top
- , let join_ty = if true_join then TrueJoinPoint else QuasiJoinPoint
= asJoinId new_bndr
join_ty
( join_arity + length abs_vars )
=====================================
compiler/GHC/Core/Opt/Simplify/Env.hs
=====================================
@@ -493,8 +493,8 @@ instance Outputable SimplSR where
where
pp_mj = case mj of
NotJoinPoint -> empty
- JoinPoint true_join n
- -> (if true_join then empty else text "[Quasi]") <> parens (int n)
+ JoinPoint { joinPointType = join_ty, joinPointArity = n }
+ -> ppr join_ty <> parens (int n)
ppr (ContEx _tv _cv _id e) = vcat [text "ContEx" <+> ppr e {-,
ppr (filter_env tv), ppr (filter_env id) -}]
=====================================
compiler/GHC/Core/Opt/Simplify/Iteration.hs
=====================================
@@ -2073,7 +2073,7 @@ simplNonRecJoinPoint env bndr rhs body cont
; return (floats1 `addFloats` floats2, body') }
where
do_case_case
- | Just True <- occInfoIsTrueJoinPoint (idOccInfo bndr)
+ | Just TrueJoinPoint <- occInfoJoinPointType_maybe (idOccInfo bndr)
= seCaseCase env
| otherwise
= False
@@ -2094,7 +2094,7 @@ simplRecJoinPoint env pairs body cont
; return (floats1 `addFloats` floats2, body') }
where
do_case_case =
- if all ((== Just True) . occInfoIsTrueJoinPoint . idOccInfo . fst) pairs
+ if all ((== Just TrueJoinPoint) . occInfoJoinPointType_maybe . idOccInfo . fst) pairs
then seCaseCase env
else False
@@ -2133,10 +2133,12 @@ trimJoinCont :: Id -- Used only in error message
trimJoinCont _ NotJoinPoint cont
= cont -- Not a jump
-trimJoinCont var (JoinPoint { isTrueJoinPoint = true_join, joinPointArity = arity }) cont
- = assertPpr true_join
- (text "trimJoinCont: unexpected quasi join point:" <+> ppr var) $
- trim arity cont
+trimJoinCont var (JoinPoint { joinPointType = join_ty, joinPointArity = arity }) cont
+ | QuasiJoinPoint <- join_ty
+ -- SLD TODO: not sure why we can end up here. Needs further investigation.
+ = cont
+ | otherwise
+ = trim arity cont
where
trim 0 cont@(Stop {})
= cont
@@ -2246,7 +2248,7 @@ Note [Join points and case-of-case]:
This transformation is not valid if the occurrences of 'j' in 'body' appear:
1. under casts (see #26422)
- 2. under profiling ticks (see #26693, #26157, #26642)
+ 2. under profiling ticks (see #14242, #26157, #26642, #26693)
For example, consider (a minimisation of) the program in #26693:
@@ -2312,7 +2314,7 @@ we proceed as follows:
2. In the simplifier, when we come across a join point binding (in either
'simplNonRecJoinPoint' or 'simplRecJoinPoint'), we retrieve the information
of whether this is a true join point or a quasi join point using
- 'occInfoIsTrueJoinPoint'.
+ 'occInfoJoinPointType_maybe'.
If we are dealing with a quasi join point, we switch off the case-of-case
transformation.
=====================================
compiler/GHC/Core/Opt/Simplify/Monad.hs
=====================================
@@ -25,7 +25,7 @@ import GHC.Prelude
import GHC.Types.Var ( Var, isId, mkLocalVar )
import GHC.Types.Name ( mkSystemVarName )
import GHC.Types.Id ( Id, mkSysLocalOrCoVarM )
-import GHC.Types.Id.Info ( IdDetails(..), vanillaIdInfo, setArityInfo, JoinType (..) )
+import GHC.Types.Id.Info ( IdDetails(..), vanillaIdInfo, setArityInfo )
import GHC.Core.Type ( Type, Mult )
import GHC.Core.Opt.Stats
import GHC.Core.Rules
=====================================
compiler/GHC/Core/Opt/SpecConstr.hs
=====================================
@@ -46,7 +46,7 @@ import GHC.Types.InlinePragma
import GHC.Types.Error (DiagnosticReason(..))
import GHC.Types.Literal ( litIsLifted )
import GHC.Types.Id
-import GHC.Types.Id.Info ( IdDetails(..), JoinType (..) )
+import GHC.Types.Id.Info ( IdDetails(..) )
import GHC.Types.Id.Make ( voidArgId, voidPrimId )
import GHC.Types.Var.Env
import GHC.Types.Var.Set
@@ -1993,9 +1993,8 @@ spec_one env fn arg_bndrs body (call_pat, rule_number)
spec_id_ty = mkLamTypes spec_lam_args spec_body_ty
spec_arity = count isId spec_lam_args
spec_join_arity
- | Just ty <- joinId_maybe fn
- , let is_true = case ty of { TrueJoinPoint -> True; QuasiJoinPoint -> False }
- = JoinPoint { isTrueJoinPoint = is_true, joinPointArity = length spec_call_args }
+ | Just join_ty <- joinId_maybe fn
+ = JoinPoint { joinPointType = join_ty, joinPointArity = length spec_call_args }
| otherwise
= NotJoinPoint
spec_id = setCbvCandidate $
=====================================
compiler/GHC/Core/Opt/WorkWrap.hs
=====================================
@@ -844,10 +844,10 @@ mkWWBindPair ww_opts fn_id fn_info fn_args fn_body work_uniq div
-- inl_rule: it does not make sense for workers to be constructorlike.
work_join_arity
- | Just ty <- joinId_maybe fn_id =
- let true_join = case ty of { TrueJoinPoint -> True; QuasiJoinPoint -> False }
- in JoinPoint true_join join_arity
- | otherwise = NotJoinPoint
+ | Just join_ty <- joinId_maybe fn_id
+ = JoinPoint join_ty join_arity
+ | otherwise
+ = NotJoinPoint
-- worker is join point iff wrapper is join point
-- (see Note [Don't w/w join points for CPR])
=====================================
compiler/GHC/Core/Ppr.hs
=====================================
@@ -308,13 +308,21 @@ ppr_expr add_par (Let bind expr)
sep [hang (keyword bind <+> char '{') 2 (ppr_bind noAnn bind <+> text "} in"),
pprCoreExpr expr]
where
- keyword (NonRec b _)
- | isJoinPoint (bndrIsJoin_maybe b) = text "join"
- | otherwise = text "let"
- keyword (Rec pairs)
- | ((b,_):_) <- pairs
- , isJoinPoint (bndrIsJoin_maybe b) = text "joinrec"
- | otherwise = text "letrec"
+ keyword (NonRec b _) =
+ case bndrIsJoin_maybe b of
+ NotJoinPoint -> text "let"
+ JoinPoint { joinPointType = join_ty } ->
+ case join_ty of
+ TrueJoinPoint -> text "join"
+ QuasiJoinPoint -> text "quasijoin"
+ keyword (Rec ((b,_):_)) =
+ case bndrIsJoin_maybe b of
+ NotJoinPoint -> text "letrec"
+ JoinPoint { joinPointType = join_ty } ->
+ case join_ty of
+ TrueJoinPoint -> text "joinrec"
+ QuasiJoinPoint -> text "quasijoinrec"
+ keyword (Rec _) = text "letrec"
ppr_expr add_par (Tick tickish expr)
= sdocOption sdocSuppressTicks $ \case
=====================================
compiler/GHC/Core/SimpleOpt.hs
=====================================
@@ -38,7 +38,10 @@ import GHC.Core.Coercion hiding ( substCo, substCoVarBndr )
import GHC.Types.Literal
import GHC.Types.Id
-import GHC.Types.Id.Info ( realUnfoldingInfo, setUnfoldingInfo, setRuleInfo, IdInfo (..), JoinType (..) )
+import GHC.Types.Id.Info
+ ( IdInfo(..)
+ , realUnfoldingInfo, setUnfoldingInfo, setRuleInfo
+ )
import GHC.Types.InlinePragma ( isAlwaysActive )
import GHC.Types.Var ( isNonCoVarId )
import GHC.Types.Var.Set
@@ -1078,12 +1081,11 @@ joinPointBinding_maybe bndr rhs
| AlwaysTailCalled
{ tailCallArity = join_arity
- , trueTailCall = is_true_tail }
+ , tailCallJoinPointType = join_ty }
<- tailCallInfo (idOccInfo bndr)
, (bndrs, body) <- etaExpandToJoinPoint join_arity rhs
, let str_sig = idDmdSig bndr
str_arity = count isId bndrs -- Strictness demands are for Ids only
- join_ty = if is_true_tail then TrueJoinPoint else QuasiJoinPoint
join_bndr =
(asJoinId bndr join_ty join_arity)
`setIdDmdSig` etaConvertDmdSig str_arity str_sig
=====================================
compiler/GHC/Core/Utils.hs
=====================================
@@ -34,7 +34,7 @@ module GHC.Core.Utils (
exprIsTickedString, exprIsTickedString_maybe,
exprIsTopLevelBindable,
exprIsUnaryClassFun, isUnaryClassId,
- altsAreExhaustive, etaExpansionTick,
+ altsAreExhaustive, canCollectArgsThroughTick,
cantEtaReduceFun,
-- * Equality
@@ -2076,14 +2076,17 @@ altsAreExhaustive (Alt con1 _ _ : alts)
-- we behave conservatively here -- I don't think it's important
-- enough to deserve special treatment
--- | Should we look past this tick when eta-expanding the given function?
+-- | Should we look past this tick when collecting arguments
+-- for the given function?
--
-- See Note [Ticks and mandatory eta expansion]
--- Takes the function we are applying as argument.
-etaExpansionTick :: Id -> GenTickish pass -> Bool
-etaExpansionTick id t
- = ( cantEtaReduceFun id ) &&
- ( tickishFloatable t || isProfTick t )
+canCollectArgsThroughTick
+ :: Id -- ^ function at the head of the application
+ -> GenTickish pass -- ^ tick we want to collect arguments past
+ -> Bool
+canCollectArgsThroughTick id t
+ = tickishFloatable t
+ || (cantEtaReduceFun id && isProfTick t)
-- | Can we eta-reduce the given function?
-- See Note [Eta reduction soundness], criteria (B), (J), and (W).
=====================================
compiler/GHC/CoreToStg/Prep.hs
=====================================
@@ -1052,8 +1052,8 @@ cpeApp top_env expr
-- floating the tick which isn't optimal for perf. But this only makes
-- a difference if we have a non-floatable tick which is somewhat rare.
| Var vh <- head
- , Var head' <- lookupCorePrepEnv top_env vh
- , etaExpansionTick head' tickish
+ , Just head' <- getIdFromTrivialExpr_maybe (lookupCorePrepEnv top_env vh)
+ , canCollectArgsThroughTick head' tickish
= (head,as')
where
(head,as') = go fun (AITick tickish : as)
=====================================
compiler/GHC/Types/Basic.hs
=====================================
@@ -24,7 +24,7 @@ module GHC.Types.Basic (
ConTag, ConTagZ, fIRST_TAG,
Arity, VisArity, RepArity, JoinArity, FullArgCount,
- JoinPointHood(..), isJoinPoint,
+ JoinPointType(..), JoinPointHood(..), joinPointHoodArity, isJoinPoint,
Alignment, mkAlignment, alignmentOf, alignmentBytes,
@@ -70,7 +70,7 @@ module GHC.Types.Basic (
BranchCount, oneBranch,
InterestingCxt(..),
TailCallInfo(..), tailCallInfo, zapOccTailCallInfo,
- isAlwaysTailCalled, occInfoIsTrueJoinPoint,
+ isAlwaysTailCalled, occInfoJoinPointType_maybe,
EP(..),
@@ -1150,11 +1150,16 @@ instance Monoid InsideLam where
-----------------
+joinPointHoodArity :: JoinPointHood -> Maybe JoinArity
+joinPointHoodArity = \case
+ NotJoinPoint -> Nothing
+ JoinPoint { joinPointArity = ja } -> Just ja
+
-- | See Note [TailCallInfo]
data TailCallInfo
= AlwaysTailCalled
- { tailCallArity :: {-# UNPACK #-} !JoinArity
- , trueTailCall :: !Bool -- ^ is this a true join point? see Note [Quasi join points]
+ { tailCallArity :: {-# UNPACK #-} !JoinArity
+ , tailCallJoinPointType :: !JoinPointType -- ^ See Note [Quasi join points]
}
| NoTailCallInfo
deriving (Eq)
@@ -1176,14 +1181,14 @@ isAlwaysTailCalled occ
-- If so, is it a true join point or a quasi join point?
--
-- See Note [Quasi join points] in GHC.Core.Opt.Simplify.Iteration.
-occInfoIsTrueJoinPoint :: OccInfo -> Maybe Bool
-occInfoIsTrueJoinPoint occ =
+occInfoJoinPointType_maybe :: OccInfo -> Maybe JoinPointType
+occInfoJoinPointType_maybe occ =
case tailCallInfo occ of
- AlwaysTailCalled { trueTailCall = true } -> Just true
+ AlwaysTailCalled { tailCallJoinPointType = join_ty } -> Just join_ty
NoTailCallInfo -> Nothing
instance Outputable TailCallInfo where
- ppr (AlwaysTailCalled ar t) =
- sep [ text "Tail", (if t then empty else text "Quasi"), int ar ]
+ ppr (AlwaysTailCalled { tailCallJoinPointType = join_ty, tailCallArity = ar }) =
+ sep [ ppr join_ty <> text "Tail", int ar ]
ppr NoTailCallInfo = text "NoTailCallInfo"
-----------------
@@ -1232,8 +1237,11 @@ instance Outputable OccInfo where
pp_tail = pprShortTailCallInfo tail_info
pprShortTailCallInfo :: TailCallInfo -> SDoc
-pprShortTailCallInfo (AlwaysTailCalled ar t)
- = char 'T' <> (if t then empty else text "[Q]")
+pprShortTailCallInfo
+ (AlwaysTailCalled
+ { tailCallJoinPointType = join_type
+ , tailCallArity = ar })
+ = char 'T' <> (case join_type of { TrueJoinPoint -> empty; QuasiJoinPoint -> char 'Q' })
<> brackets (int ar)
pprShortTailCallInfo NoTailCallInfo = empty
=====================================
compiler/GHC/Types/Id.hs
=====================================
@@ -574,7 +574,7 @@ isWorkerLikeId id =
isJoinId :: Var -> Bool
isJoinId = isJust . joinId_maybe
-joinId_maybe :: Var -> Maybe JoinType
+joinId_maybe :: Var -> Maybe JoinPointType
-- It is convenient in GHC.Core.Opt.SetLevels.lvlMFE to apply isJoinId
-- to the free vars of an expression, so it's convenient
-- if it returns False for type variables
@@ -589,10 +589,11 @@ idJoinPointHood :: Var -> JoinPointHood
idJoinPointHood id
| isId id
= case Var.idDetails id of
- JoinId ty arity _marks ->
- let isTrue = case ty of { TrueJoinPoint -> True; QuasiJoinPoint -> False}
- in JoinPoint isTrue arity
- _ -> NotJoinPoint
+ JoinId
+ { joinIdType = join_type
+ , joinIdArity = arity }
+ -> JoinPoint join_type arity
+ _ -> NotJoinPoint
| otherwise = NotJoinPoint
idDataCon :: Id -> DataCon
@@ -675,7 +676,7 @@ idJoinArity id =
JoinPoint { joinPointArity = ar } -> ar
NotJoinPoint -> pprPanic "idJoinArity" (ppr id)
-asJoinId :: Id -> JoinType -> JoinArity -> JoinId
+asJoinId :: Id -> JoinPointType -> JoinArity -> JoinId
asJoinId id ty arity
= warnPprTrace (not (isLocalId id))
"global id being marked as join var" (ppr id) $
@@ -710,9 +711,8 @@ zapJoinId jid
asJoinId_maybe :: Id -> JoinPointHood -> Id
asJoinId_maybe id = \case
NotJoinPoint -> zapJoinId id
- JoinPoint { isTrueJoinPoint = true_join, joinPointArity = arity } ->
- let ty = if true_join then TrueJoinPoint else QuasiJoinPoint
- in asJoinId id ty arity
+ JoinPoint { joinPointType = join_type, joinPointArity = arity } ->
+ asJoinId id join_type arity
{-
************************************************************************
=====================================
compiler/GHC/Types/Id/Info.hs
=====================================
@@ -65,7 +65,7 @@ module GHC.Types.Id.Info (
TailCallInfo(..),
tailCallInfo, isAlwaysTailCalled,
- JoinType(..),
+ JoinPointType(..),
-- ** The RuleInfo type
RuleInfo(..),
@@ -207,7 +207,7 @@ data IdDetails
-- This only covers /un-lifted/ coercions, of type
-- (t1 ~# t2) or (t1 ~R# t2), not their lifted variants
| JoinId
- { joinIdType :: JoinType
+ { joinIdType :: JoinPointType
, joinIdArity :: JoinArity
, joinIdCbvMarks :: Maybe [CbvMark]
}
@@ -226,14 +226,6 @@ data IdDetails
-- The [CbvMark] is always empty (and ignored) until after Tidy for ids from the current
-- module.
-data JoinType
- = TrueJoinPoint
- | QuasiJoinPoint
- deriving stock ( Eq, Show )
-instance Outputable JoinType where
- ppr TrueJoinPoint = text "TrueJoinPoint"
- ppr QuasiJoinPoint = text "QuasiJoinPoint"
-
data RecSelInfo
= RSI { rsi_def :: [ConLike] -- Record selector defined for these
, rsi_undef :: [ConLike] -- Record selector not defined for these
@@ -422,7 +414,7 @@ isCoVarDetails :: IdDetails -> Bool
isCoVarDetails CoVarId = True
isCoVarDetails _ = False
-isJoinIdDetails_maybe :: IdDetails -> Maybe (JoinType, JoinArity, Maybe [CbvMark])
+isJoinIdDetails_maybe :: IdDetails -> Maybe (JoinPointType, JoinArity, Maybe [CbvMark])
isJoinIdDetails_maybe (JoinId ty join_arity marks) = Just (ty, join_arity, marks)
isJoinIdDetails_maybe _ = Nothing
=====================================
compiler/GHC/Types/Tickish.hs
=====================================
@@ -330,7 +330,8 @@ tickishCanSplit _ = False
-- | Is @join f x in <tick> jump f x@ valid?
tickishCanScopeJoin :: GenTickish pass -> Bool
tickishCanScopeJoin tick = case tick of
- ProfNote{} -> True
+ ProfNote{} -> False -- Turns the join point into a quasi join point.
+ -- See Note [Quasi join points]
HpcTick{} -> False
Breakpoint{} -> False
SourceNote{} -> True
=====================================
compiler/GHC/Utils/Binary.hs
=====================================
@@ -132,7 +132,7 @@ import GHC.Utils.Fingerprint
import GHC.Types.SrcLoc
import GHC.Types.Unique
import qualified GHC.Data.Strict as Strict
-import GHC.Utils.Outputable( JoinPointHood(..) )
+import GHC.Utils.Outputable( JoinPointHood(..), JoinPointType (..) )
import GHCi.FFI
import GHCi.Message
@@ -1053,6 +1053,10 @@ instance Binary DiffTime where
get bh = do r <- get bh
return $ fromRational r
+instance Binary JoinPointType where
+ put_ bh ty = put_ bh (ty == TrueJoinPoint)
+ get bh = do { true <- get bh; return $ if true then TrueJoinPoint else QuasiJoinPoint }
+
instance Binary JoinPointHood where
put_ bh NotJoinPoint = putByte bh 0
put_ bh (JoinPoint t ar) = do
=====================================
compiler/GHC/Utils/Outputable.hs
=====================================
@@ -15,7 +15,7 @@
module GHC.Utils.Outputable (
-- * Type classes
Outputable(..), OutputableBndr(..), OutputableP(..),
- BindingSite(..), JoinPointHood(..), isJoinPoint,
+ BindingSite(..), JoinPointType(..), JoinPointHood(..), isJoinPoint,
IsOutput(..), IsLine(..), IsDoc(..),
HLine, HDoc,
@@ -150,6 +150,7 @@ import Data.Graph (SCC(..))
import Data.List (intersperse)
import Data.List.NonEmpty (NonEmpty (..))
import Data.Semigroup (Arg(..))
+import qualified Data.Semigroup as Semi
import qualified Data.List.NonEmpty as NEL
import Data.Time ( UTCTime )
import Data.Time.Format.ISO8601
@@ -1284,10 +1285,21 @@ data BindingSite
| LetBind -- ^ The x in (let x = rhs in e)
deriving Eq
+data JoinPointType
+ = TrueJoinPoint
+ | QuasiJoinPoint
+ deriving Eq
+instance Outputable JoinPointType where
+ ppr TrueJoinPoint = empty
+ ppr QuasiJoinPoint = text "Quasi"
+instance Semigroup JoinPointType where
+ TrueJoinPoint <> TrueJoinPoint = TrueJoinPoint
+ _ <> _ = QuasiJoinPoint
+
data JoinPointHood
= JoinPoint
- { isTrueJoinPoint :: {-# UNPACK #-} !Bool
- , joinPointArity :: {-# UNPACK #-} !Int
+ { joinPointType :: {-# UNPACK #-} !JoinPointType
+ , joinPointArity :: {-# UNPACK #-} !Int
-- ^ The JoinArity (but an Int here because synonym JoinArity is defined in Types.Basic)
}
| NotJoinPoint
@@ -1298,10 +1310,9 @@ isJoinPoint (JoinPoint {}) = True
isJoinPoint NotJoinPoint = False
instance Outputable JoinPointHood where
- ppr NotJoinPoint = text "NotJoinPoint"
- ppr (JoinPoint true arity) =
- (if true then empty else text "Quasi")
- <> text "JoinPoint" <> parens (ppr arity)
+ ppr NotJoinPoint = text "NotJoinPoint"
+ ppr (JoinPoint join_type arity) =
+ ppr join_type <> text "JoinPoint" <> parens (ppr arity)
instance NFData JoinPointHood where
rnf x = x `seq` ()
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d01b5ee6554022b6898aed101f3cf7…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d01b5ee6554022b6898aed101f3cf7…
You're receiving this email because of your account on gitlab.haskell.org.
1
0