[Git][ghc/ghc][master] ci: only push perf notes on master/release branches
by Marge Bot (@marge-bot) 23 Jan '26
by Marge Bot (@marge-bot) 23 Jan '26
23 Jan '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
3f5e8d80 by Cheng Shao at 2026-01-23T10:53:37-05:00
ci: only push perf notes on master/release branches
This patch fixes push_perf_notes logic in ci.sh to only push perf
notes on master/release branches. We used to unconditionally push perf
notes even in MRs, but the perf numbers in the wip branches wouldn't
be used as baseline anyway, plus this is causing a space leak in the
ghc-performance-notes repo. See #25317 for the perf notes repo size
problem.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
1 changed file:
- .gitlab/ci.sh
Changes:
=====================================
.gitlab/ci.sh
=====================================
@@ -493,6 +493,11 @@ function fetch_perf_notes() {
}
function push_perf_notes() {
+ if [[ "${CI_COMMIT_BRANCH:-}" != "master" ]] && [[ ! "${CI_COMMIT_BRANCH:-}" =~ ghc-[0-9]+\.[0-9]+ ]]; then
+ info "Perf notes are only pushed on master/release branches"
+ return
+ fi
+
if [[ -z "${TEST_ENV:-}" ]]; then
return
fi
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3f5e8d80b32063d265aeead6b62604c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3f5e8d80b32063d265aeead6b62604c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] Export labelThread from Control.Concurrent
by Marge Bot (@marge-bot) 23 Jan '26
by Marge Bot (@marge-bot) 23 Jan '26
23 Jan '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
917ab8ff by Oleg Grenrus at 2026-01-23T10:52:55-05:00
Export labelThread from Control.Concurrent
- - - - -
7 changed files:
- libraries/base/changelog.md
- libraries/base/src/Control/Concurrent.hs
- libraries/base/src/System/Timeout.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
Changes:
=====================================
libraries/base/changelog.md
=====================================
@@ -22,6 +22,7 @@
* `GHC.Conc.throwSTM` and `GHC.Conc.Sync.throwSTM` now carry a `HasCallStack` constraint and attach a `Backtrace` annotation to the thrown exception. ([GHC #25365](https://gitlab.haskell.org/ghc/ghc/-/issues/25365))
* `GHC.Conc.catchSTM` and `GHC.Conc.Sync.catchSTM` now attach `WhileHandling` annotation to exceptions thrown from the handler. ([GHC #25365](https://gitlab.haskell.org/ghc/ghc/-/issues/25365))
* Remove `GHC.JS.Prim.Internal.Build`, as per [CLC #329](https://github.com/haskell/core-libraries-committee/issues/329)
+ * Export `labelThread` from `Control.Concurrent`.([CLC proposal #376](https://github.com/haskell/core-libraries-committee/issues/376))
## 4.22.0.0 *TBA*
* Shipped with GHC 9.14.1
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -82,6 +82,9 @@ module Control.Concurrent (
-- * Weak references to ThreadIds
mkWeakThreadId,
+ -- * Thread debugging
+ labelThread,
+
-- * GHC's implementation of concurrency
-- |This section describes features specific to GHC's
=====================================
libraries/base/src/System/Timeout.hs
=====================================
@@ -29,7 +29,6 @@ import GHC.Internal.Control.Exception (Exception(..), handleJust, bracket,
asyncExceptionToException,
asyncExceptionFromException)
import GHC.Internal.Data.Unique (Unique, newUnique)
-import GHC.Conc (labelThread)
import Prelude
-- $setup
=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -120,6 +120,7 @@ module Control.Concurrent where
isCurrentThreadBound :: GHC.Internal.Types.IO GHC.Internal.Types.Bool
isEmptyMVar :: forall a. MVar a -> GHC.Internal.Types.IO GHC.Internal.Types.Bool
killThread :: ThreadId -> GHC.Internal.Types.IO ()
+ labelThread :: ThreadId -> GHC.Internal.Base.String -> GHC.Internal.Types.IO ()
mkWeakMVar :: forall a. MVar a -> GHC.Internal.Types.IO () -> GHC.Internal.Types.IO (GHC.Internal.Weak.Weak (MVar a))
mkWeakThreadId :: ThreadId -> GHC.Internal.Types.IO (GHC.Internal.Weak.Weak ThreadId)
modifyMVar :: forall a b. MVar a -> (a -> GHC.Internal.Types.IO (a, b)) -> GHC.Internal.Types.IO b
=====================================
testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
=====================================
@@ -120,6 +120,7 @@ module Control.Concurrent where
isCurrentThreadBound :: GHC.Internal.Types.IO GHC.Internal.Types.Bool
isEmptyMVar :: forall a. MVar a -> GHC.Internal.Types.IO GHC.Internal.Types.Bool
killThread :: ThreadId -> GHC.Internal.Types.IO ()
+ labelThread :: ThreadId -> GHC.Internal.Base.String -> GHC.Internal.Types.IO ()
mkWeakMVar :: forall a. MVar a -> GHC.Internal.Types.IO () -> GHC.Internal.Types.IO (GHC.Internal.Weak.Weak (MVar a))
mkWeakThreadId :: ThreadId -> GHC.Internal.Types.IO (GHC.Internal.Weak.Weak ThreadId)
modifyMVar :: forall a b. MVar a -> (a -> GHC.Internal.Types.IO (a, b)) -> GHC.Internal.Types.IO b
=====================================
testsuite/tests/interface-stability/base-exports.stdout-mingw32
=====================================
@@ -120,6 +120,7 @@ module Control.Concurrent where
isCurrentThreadBound :: GHC.Internal.Types.IO GHC.Internal.Types.Bool
isEmptyMVar :: forall a. MVar a -> GHC.Internal.Types.IO GHC.Internal.Types.Bool
killThread :: ThreadId -> GHC.Internal.Types.IO ()
+ labelThread :: ThreadId -> GHC.Internal.Base.String -> GHC.Internal.Types.IO ()
mkWeakMVar :: forall a. MVar a -> GHC.Internal.Types.IO () -> GHC.Internal.Types.IO (GHC.Internal.Weak.Weak (MVar a))
mkWeakThreadId :: ThreadId -> GHC.Internal.Types.IO (GHC.Internal.Weak.Weak ThreadId)
modifyMVar :: forall a b. MVar a -> (a -> GHC.Internal.Types.IO (a, b)) -> GHC.Internal.Types.IO b
=====================================
testsuite/tests/interface-stability/base-exports.stdout-ws-32
=====================================
@@ -120,6 +120,7 @@ module Control.Concurrent where
isCurrentThreadBound :: GHC.Internal.Types.IO GHC.Internal.Types.Bool
isEmptyMVar :: forall a. MVar a -> GHC.Internal.Types.IO GHC.Internal.Types.Bool
killThread :: ThreadId -> GHC.Internal.Types.IO ()
+ labelThread :: ThreadId -> GHC.Internal.Base.String -> GHC.Internal.Types.IO ()
mkWeakMVar :: forall a. MVar a -> GHC.Internal.Types.IO () -> GHC.Internal.Types.IO (GHC.Internal.Weak.Weak (MVar a))
mkWeakThreadId :: ThreadId -> GHC.Internal.Types.IO (GHC.Internal.Weak.Weak ThreadId)
modifyMVar :: forall a b. MVar a -> (a -> GHC.Internal.Types.IO (a, b)) -> GHC.Internal.Types.IO b
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/917ab8ff84157eeda54dbe818cdc7ed…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/917ab8ff84157eeda54dbe818cdc7ed…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26699] 3 commits: hadrian: Bump QuickCheck upper bound
by recursion-ninja (@recursion-ninja) 23 Jan '26
by recursion-ninja (@recursion-ninja) 23 Jan '26
23 Jan '26
recursion-ninja pushed to branch wip/26699 at Glasgow Haskell Compiler / GHC
Commits:
be8e5236 by Ben Gamari at 2026-01-23T03:28:45-05:00
hadrian: Bump QuickCheck upper bound
This patch bumps QuickCheck upper bound to 2.18. selftest rule
manually tested to work with current latest QuickCheck-2.17.1.0.
- - - - -
5aa328fb by Zubin Duggal at 2026-01-23T03:29:30-05:00
Add genindex to index.rst. This adds a link to the index in the navigation bar.
Fixes #26437
- - - - -
5456a01f by Recursion Ninja at 2026-01-23T14:10:18+00:00
Migrating the simplest types required for Trees That Grow progress
from GHC.Types.Basic to Language.Haskell.Syntax.Basic. Related
function definitions were also moved. Outputable type-class instances
are defined in GHC.Utils.Outputable. Binary instance of Boxity was
moved to GHC.Utils.Binary.
Migrated types:
* TopLevelFlag
* RuleName
* TyConFlavour
* TypeOrData
* NewOrData
- - - - -
20 changed files:
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- docs/users_guide/index.rst
- hadrian/hadrian.cabal
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
Changes:
=====================================
compiler/GHC/Hs/Decls.hs
=====================================
@@ -17,7 +17,7 @@ module GHC.Hs.Decls (
-- * Toplevel declarations
HsDecl(..), LHsDecl, HsDataDefn(..), HsDeriving, LHsFunDep,
HsDerivingClause(..), LHsDerivingClause, DerivClauseTys(..), LDerivClauseTys,
- NewOrData, newOrDataToFlavour, anyLConIsGadt,
+ NewOrData, newOrDataToFlavour, dataDefnConsNewOrData, anyLConIsGadt,
StandaloneKindSig(..), LStandaloneKindSig, standaloneKindSigName,
-- ** Class or type declarations
@@ -1106,6 +1106,11 @@ anyLConIsGadt xs = case toList xs of
{-# SPECIALIZE anyLConIsGadt :: [GenLocated l (ConDecl pass)] -> Bool #-}
{-# SPECIALIZE anyLConIsGadt :: DataDefnCons (GenLocated l (ConDecl pass)) -> Bool #-}
+dataDefnConsNewOrData :: DataDefnCons a -> NewOrData
+dataDefnConsNewOrData = \ case
+ NewTypeCon {} -> NewType
+ DataTypeCons {} -> DataType
+
{-
************************************************************************
* *
=====================================
compiler/GHC/Hs/Utils.hs
=====================================
@@ -53,6 +53,7 @@ module GHC.Hs.Utils(
-- * Bindings
mkFunBind, mkVarBind, mkHsVarBind, mkSimpleGeneratedFunBind, mkTopFunBind,
mkPatSynBind,
+ familyInfoTyConFlavour,
isInfixFunBind,
spanHsLocaLBinds,
@@ -148,6 +149,7 @@ import Control.Arrow ( first )
import Data.Foldable ( toList )
import Data.List ( partition )
import Data.List.NonEmpty ( NonEmpty (..), nonEmpty )
+import Data.Maybe ( isNothing )
import qualified Data.List.NonEmpty as NE
import Data.IntMap ( IntMap )
@@ -1502,6 +1504,18 @@ hsLTyClDeclBinders (L loc (DataDecl { tcdLName = (L _ name)
where
flav = newOrDataToFlavour $ dataDefnConsNewOrData $ dd_cons defn
+familyInfoTyConFlavour
+ :: Maybe tc -- ^ Just cls <=> this is an associated family of class cls
+ -> FamilyInfo pass
+ -> TyConFlavour tc
+familyInfoTyConFlavour mb_parent_tycon info =
+ case info of
+ DataFamily -> OpenFamilyFlavour (IAmData DataType) mb_parent_tycon
+ OpenTypeFamily -> OpenFamilyFlavour IAmType mb_parent_tycon
+ ClosedTypeFamily _ -> assert (isNothing mb_parent_tycon)
+ -- See Note [Closed type family mb_parent_tycon]
+ ClosedTypeFamilyFlavour
+
-------------------
hsForeignDeclsBinders :: forall p a. (UnXRec (GhcPass p), IsSrcSpanAnn p a)
=> [LForeignDecl (GhcPass p)] -> [LIdP (GhcPass p)]
=====================================
compiler/GHC/HsToCore/Errors/Types.hs
=====================================
@@ -4,7 +4,7 @@ module GHC.HsToCore.Errors.Types where
import GHC.Prelude
-import GHC.Core (CoreRule, CoreExpr, RuleName)
+import GHC.Core (CoreRule, CoreExpr)
import GHC.Core.DataCon
import GHC.Core.ConLike
import GHC.Core.Type
=====================================
compiler/GHC/Rename/Env.hs
=====================================
@@ -80,7 +80,7 @@ import GHC.Core.ConLike
import GHC.Core.DataCon
import GHC.Core.TyCon
import GHC.Builtin.Names( rOOT_MAIN )
-import GHC.Types.Basic ( TopLevelFlag(..), TupleSort(..), tupleSortBoxity )
+import GHC.Types.Basic ( TupleSort(..), tupleSortBoxity )
import GHC.Types.TyThing ( tyThingGREInfo )
import GHC.Types.SrcLoc as SrcLoc
import GHC.Utils.Outputable as Outputable
=====================================
compiler/GHC/Rename/Module.hs
=====================================
@@ -52,7 +52,7 @@ import GHC.Types.ForeignCall ( CCallTarget(..) )
import GHC.Types.Name
import GHC.Types.Name.Set
import GHC.Types.Name.Env
-import GHC.Types.Basic ( VisArity, TyConFlavour(..), TypeOrKind(..), RuleName )
+import GHC.Types.Basic ( VisArity, TyConFlavour(..), TypeOrKind(..) )
import GHC.Types.GREInfo (ConLikeInfo (..), ConInfo, mkConInfo, conInfoFields)
import GHC.Types.Hint (SigLike(..))
import GHC.Types.Unique.Set
=====================================
compiler/GHC/Rename/Names.hs
=====================================
@@ -70,7 +70,7 @@ import GHC.Types.FieldLabel
import GHC.Types.Hint
import GHC.Types.SourceFile
import GHC.Types.SrcLoc as SrcLoc
-import GHC.Types.Basic ( TopLevelFlag(..), TyConFlavour (..), convImportLevel )
+import GHC.Types.Basic ( TyConFlavour (..), convImportLevel )
import GHC.Types.SourceText
import GHC.Types.Id
import GHC.Types.PkgQual
=====================================
compiler/GHC/Rename/Splice.hs
=====================================
@@ -32,7 +32,7 @@ import GHC.Rename.Unbound ( isUnboundName )
import GHC.Rename.Module ( rnSrcDecls, findSplice )
import GHC.Rename.Pat ( rnPat )
import GHC.Types.Error
-import GHC.Types.Basic ( TopLevelFlag, isTopLevel, maxPrec )
+import GHC.Types.Basic ( maxPrec )
import GHC.Types.SourceText ( SourceText(..) )
import GHC.Types.ThLevelIndex
import GHC.Utils.Outputable
=====================================
compiler/GHC/Tc/Gen/Head.hs
=====================================
@@ -62,7 +62,6 @@ import GHC.Types.Id
import GHC.Types.Name
import GHC.Types.Name.Reader
import GHC.Types.SrcLoc
-import GHC.Types.Basic
import GHC.Types.Error
import GHC.Builtin.Names
=====================================
compiler/GHC/Tc/Utils/Env.hs
=====================================
@@ -119,7 +119,6 @@ import GHC.Data.List.SetOps
import GHC.Data.Maybe( MaybeErr(..), orElse, maybeToList, fromMaybe )
import GHC.Types.SrcLoc
-import GHC.Types.Basic hiding( SuccessFlag(..) )
import GHC.Types.TypeEnv
import GHC.Types.SourceFile
import GHC.Types.Name
=====================================
compiler/GHC/Tc/Utils/Monad.hs
=====================================
@@ -239,7 +239,7 @@ import GHC.Types.Unique.DFM
import GHC.Types.Unique.Supply
import GHC.Types.Unique (uniqueTag)
import GHC.Types.Annotations
-import GHC.Types.Basic( TopLevelFlag(..), TypeOrKind(..) )
+import GHC.Types.Basic( TypeOrKind(..) )
import GHC.Types.CostCentre.State
import GHC.Types.SourceFile
=====================================
compiler/GHC/Types/Basic.hs
=====================================
@@ -103,7 +103,6 @@ module GHC.Types.Basic (
import GHC.Prelude
import GHC.ForeignSrcLang
-import GHC.Data.FastString
import GHC.Utils.Outputable
import GHC.Utils.Panic
import GHC.Utils.Binary
@@ -111,15 +110,16 @@ import GHC.Types.Arity
import GHC.Types.SourceText
import qualified GHC.LanguageExtensions as LangExt
import {-# SOURCE #-} Language.Haskell.Syntax.Type (PromotionFlag(..), isPromoted)
-import Language.Haskell.Syntax.Basic (Boxity(..), isBoxed, ConTag)
import {-# SOURCE #-} Language.Haskell.Syntax.Expr (HsDoFlavour)
+
+import Language.Haskell.Syntax.Basic
+import Language.Haskell.Syntax.ImpExp
+
import Control.DeepSeq ( NFData(..) )
import Data.Data
import Data.Maybe
import qualified Data.Semigroup as Semi
-import Language.Haskell.Syntax.ImpExp
-
{-
************************************************************************
* *
@@ -420,55 +420,10 @@ instance NFData FunctionOrData where
************************************************************************
-}
-type RuleName = FastString
-
pprRuleName :: RuleName -> SDoc
pprRuleName rn = doubleQuotes (ftext rn)
-{-
-************************************************************************
-* *
-\subsection[Top-level/local]{Top-level/not-top level flag}
-* *
-************************************************************************
--}
-
-data TopLevelFlag
- = TopLevel
- | NotTopLevel
- deriving Data
-
-isTopLevel, isNotTopLevel :: TopLevelFlag -> Bool
-
-isNotTopLevel NotTopLevel = True
-isNotTopLevel TopLevel = False
-
-isTopLevel TopLevel = True
-isTopLevel NotTopLevel = False
-
-instance Outputable TopLevelFlag where
- ppr TopLevel = text "<TopLevel>"
- ppr NotTopLevel = text "<NotTopLevel>"
-
-{-
-************************************************************************
-* *
- Boxity flag
-* *
-************************************************************************
--}
-
-instance Outputable Boxity where
- ppr Boxed = text "Boxed"
- ppr Unboxed = text "Unboxed"
-
-instance Binary Boxity where -- implemented via isBoxed-isomorphism to Bool
- put_ bh = put_ bh . isBoxed
- get bh = do
- b <- get bh
- pure $ if b then Boxed else Unboxed
-
{-
************************************************************************
* *
@@ -1524,11 +1479,13 @@ instance NFData TypeOrConstraint where
TypeLike -> ()
ConstraintLike -> ()
-{- *********************************************************************
+{-
+************************************************************************
* *
- TyConFlavour
+TyConFlavour
* *
-********************************************************************* -}
+************************************************************************
+-}
-- | Paints a picture of what a 'TyCon' represents, in broad strokes.
-- This is used towards more informative error messages.
@@ -1571,7 +1528,6 @@ instance Outputable (TyConFlavour tc) where
go BuiltInTypeFlavour = "built-in type"
go PromotedDataConFlavour = "promoted data constructor"
-
-- | Get the enclosing class TyCon (if there is one) for the given TyConFlavour
tyConFlavourAssoc_maybe :: TyConFlavour tc -> Maybe tc
tyConFlavourAssoc_maybe (OpenFamilyFlavour _ mb_parent) = mb_parent
@@ -1584,22 +1540,10 @@ data TypeOrData
| IAmType
deriving (Eq, Data)
--- | When we only care whether a data-type declaration is `data` or `newtype`,
--- but not what constructors it has.
-data NewOrData
- = NewType -- ^ @newtype Blah ...@
- | DataType -- ^ @data Blah ...@
- deriving ( Eq, Data ) -- Needed because Demand derives Eq
-
instance Outputable TypeOrData where
ppr (IAmData newOrData) = ppr newOrData
ppr IAmType = text "type"
-instance Outputable NewOrData where
- ppr = \case
- NewType -> text "newtype"
- DataType -> text "data"
-
{- *********************************************************************
* *
Defaulting options
=====================================
compiler/GHC/Utils/Binary.hs
=====================================
@@ -117,6 +117,7 @@ module GHC.Utils.Binary
import GHC.Prelude
+import Language.Haskell.Syntax.Basic
import Language.Haskell.Syntax.Binds.InlinePragma
import Language.Haskell.Syntax.Module.Name (ModuleName(..))
import Language.Haskell.Syntax.ImpExp.IsBoot (IsBootInterface(..))
@@ -2011,6 +2012,12 @@ instance NFData a => NFData (FingerprintWithValue a) where
rnf (FingerprintWithValue fp mflags)
= rnf fp `seq` rnf mflags `seq` ()
+instance Binary Boxity where -- implemented via isBoxed-isomorphism to Bool
+ put_ bh = put_ bh . isBoxed
+ get bh = do
+ b <- get bh
+ pure $ if b then Boxed else Unboxed
+
instance Binary ConInfoTable where
get bh = Binary.decode <$> get bh
=====================================
compiler/GHC/Utils/Outputable.hs
=====================================
@@ -112,6 +112,7 @@ module GHC.Utils.Outputable (
import {-# SOURCE #-} GHC.Unit.Types ( Unit, Module, moduleName )
import {-# SOURCE #-} GHC.Types.Name.Occurrence( OccName )
+import Language.Haskell.Syntax.Basic
import Language.Haskell.Syntax.Binds.InlinePragma
import Language.Haskell.Syntax.Module.Name ( ModuleName(..) )
@@ -2001,19 +2002,32 @@ instance IsDoc HDoc where
{-# INLINE CONLIKE dualDoc #-}
instance Outputable (ActivationX p) where
- ppr AlwaysActive = empty
- ppr NeverActive = brackets (text "~")
- ppr (ActiveBefore n) = brackets (char '~' <> int n)
- ppr (ActiveAfter n) = brackets (int n)
- ppr (XActivation _) = text "[final]"
+ ppr AlwaysActive = empty
+ ppr NeverActive = brackets (text "~")
+ ppr (ActiveBefore n) = brackets (char '~' <> int n)
+ ppr (ActiveAfter n) = brackets (int n)
+ ppr (XActivation _) = text "[final]"
instance Outputable InlineSpec where
- ppr Inline = text "INLINE"
- ppr NoInline = text "NOINLINE"
- ppr Inlinable = text "INLINABLE"
- ppr Opaque = text "OPAQUE"
- ppr NoUserInlinePrag = empty
+ ppr Inline = text "INLINE"
+ ppr NoInline = text "NOINLINE"
+ ppr Inlinable = text "INLINABLE"
+ ppr Opaque = text "OPAQUE"
+ ppr NoUserInlinePrag = empty
+
+instance Outputable Boxity where
+ ppr Boxed = text "Boxed"
+ ppr Unboxed = text "Unboxed"
instance Outputable RuleMatchInfo where
- ppr ConLike = text "CONLIKE"
- ppr FunLike = text "FUNLIKE"
+ ppr ConLike = text "CONLIKE"
+ ppr FunLike = text "FUNLIKE"
+
+instance Outputable NewOrData where
+ ppr = \case
+ NewType -> text "newtype"
+ DataType -> text "data"
+
+instance Outputable TopLevelFlag where
+ ppr TopLevel = text "<TopLevel>"
+ ppr NotTopLevel = text "<NotTopLevel>"
=====================================
compiler/Language/Haskell/Syntax/Basic.hs
=====================================
@@ -10,6 +10,37 @@ import Prelude
import GHC.Data.FastString (FastString)
import Control.DeepSeq
+{-
+************************************************************************
+* *
+Rules
+* *
+************************************************************************
+-}
+
+type RuleName = FastString
+
+{-
+************************************************************************
+* *
+\subsection[Top-level/local]{Top-level/not-top level flag}
+* *
+************************************************************************
+-}
+
+data TopLevelFlag
+ = TopLevel
+ | NotTopLevel
+ deriving Data
+
+isTopLevel, isNotTopLevel :: TopLevelFlag -> Bool
+
+isNotTopLevel NotTopLevel = True
+isNotTopLevel TopLevel = False
+
+isTopLevel TopLevel = True
+isTopLevel NotTopLevel = False
+
{-
************************************************************************
* *
@@ -125,3 +156,10 @@ data Fixity = Fixity Int FixityDirection
instance NFData Fixity where
rnf (Fixity i d) = rnf i `seq` rnf d `seq` ()
+
+-- | When we only care whether a data-type declaration is `data` or `newtype`,
+-- but not what constructors it has.
+data NewOrData
+ = NewType -- ^ @newtype Blah ...@
+ | DataType -- ^ @data Blah ...@
+ deriving ( Eq, Data ) -- Needed because Demand derives Eq
=====================================
compiler/Language/Haskell/Syntax/Decls.hs
=====================================
@@ -18,7 +18,7 @@ module Language.Haskell.Syntax.Decls (
-- * Toplevel declarations
HsDecl(..), LHsDecl, HsDataDefn(..), HsDeriving, LHsFunDep, FunDep(..),
HsDerivingClause(..), LHsDerivingClause, DerivClauseTys(..), LDerivClauseTys,
- NewOrData(..), DataDefnCons(..), dataDefnConsNewOrData,
+ NewOrData(..), DataDefnCons(..),
isTypeDataDefnCons, firstDataDefnCon,
StandaloneKindSig(..), LStandaloneKindSig,
@@ -31,7 +31,7 @@ module Language.Haskell.Syntax.Decls (
FamilyDecl(..), LFamilyDecl,
-- ** Instance declarations
- InstDecl(..), LInstDecl, FamilyInfo(..), familyInfoTyConFlavour,
+ InstDecl(..), LInstDecl, FamilyInfo(..),
TyFamInstDecl(..), LTyFamInstDecl,
TyFamDefltDecl, LTyFamDefltDecl,
DataFamInstDecl(..), LDataFamInstDecl,
@@ -91,6 +91,7 @@ import {-# SOURCE #-} Language.Haskell.Syntax.Expr
( HsExpr, HsUntypedSplice )
-- Because Expr imports Decls via HsBracket
+import Language.Haskell.Syntax.Basic (TopLevelFlag, RuleName, NewOrData(..))
import Language.Haskell.Syntax.Binds
import Language.Haskell.Syntax.Binds.InlinePragma (Activation)
import Language.Haskell.Syntax.Extension
@@ -98,8 +99,7 @@ import Language.Haskell.Syntax.Type
import Language.Haskell.Syntax.Basic (Role, LexicalFixity)
import Language.Haskell.Syntax.Specificity (Specificity)
-import GHC.Types.Basic (TopLevelFlag, OverlapMode, RuleName
- ,TyConFlavour(..), TypeOrData(..), NewOrData(..))
+import GHC.Types.Basic (OverlapMode)
import GHC.Types.ForeignCall (CType, CCallConv, Safety, Header, CLabelString, CCallTarget, CExportSpec)
import GHC.Data.FastString (FastString)
@@ -108,7 +108,6 @@ import GHC.Hs.Doc (WithHsDocIdentifiers)
import GHC.Types.SourceText (StringLiteral)
import Control.DeepSeq
-import Control.Exception (assert)
import Control.Monad
import Data.Data hiding (TyCon, Fixity, Infix)
import Data.Maybe
@@ -779,18 +778,6 @@ data FamilyInfo pass
-- said "type family Foo x where .."
| ClosedTypeFamily (Maybe [LTyFamInstEqn pass])
-familyInfoTyConFlavour
- :: Maybe tc -- ^ Just cls <=> this is an associated family of class cls
- -> FamilyInfo pass
- -> TyConFlavour tc
-familyInfoTyConFlavour mb_parent_tycon info =
- case info of
- DataFamily -> OpenFamilyFlavour (IAmData DataType) mb_parent_tycon
- OpenTypeFamily -> OpenFamilyFlavour IAmType mb_parent_tycon
- ClosedTypeFamily _ -> assert (isNothing mb_parent_tycon)
- -- See Note [Closed type family mb_parent_tycon]
- ClosedTypeFamilyFlavour
-
{- Note [Closed type family mb_parent_tycon]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There's no way to write a closed type family inside a class declaration:
@@ -932,11 +919,6 @@ data DataDefnCons a
[a] -- The (possibly empty) list of data constructors
deriving ( Eq, Data, Foldable, Functor, Traversable ) -- Needed because Demand derives Eq
-dataDefnConsNewOrData :: DataDefnCons a -> NewOrData
-dataDefnConsNewOrData = \ case
- NewTypeCon {} -> NewType
- DataTypeCons {} -> DataType
-
-- | Are the constructors within a @type data@ declaration?
-- See Note [Type data declarations] in GHC.Rename.Module.
isTypeDataDefnCons :: DataDefnCons a -> Bool
=====================================
docs/users_guide/index.rst
=====================================
@@ -29,6 +29,7 @@ Contents:
eventlog-formats
glossary
editing-guide
+ genindex
Indices and tables
=====================================
hadrian/hadrian.cabal
=====================================
@@ -190,4 +190,4 @@ executable hadrian
if flag(selftest)
other-modules: Rules.Selftest
cpp-options: -DHADRIAN_ENABLE_SELFTEST
- build-depends: QuickCheck >= 2.6 && < 2.15
+ build-depends: QuickCheck >= 2.6 && < 2.18
=====================================
utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
=====================================
@@ -33,7 +33,6 @@ import GHC
import GHC.Core.InstEnv
import qualified GHC.Driver.DynFlags as DynFlags
import GHC.Driver.Ppr
-import GHC.Plugins (TopLevelFlag (..))
import GHC.Types.SourceText
import GHC.Unit.State
import GHC.Utils.Outputable as Outputable
=====================================
utils/haddock/haddock-api/src/Haddock/Convert.hs
=====================================
@@ -59,7 +59,7 @@ import GHC.Core.TyCo.Rep
import GHC.Core.TyCon
import GHC.Core.Type
import GHC.Hs
-import GHC.Types.Basic (DefMethSpec (..), TopLevelFlag (..), TupleSort (..))
+import GHC.Types.Basic (DefMethSpec (..), TupleSort (..))
import GHC.Types.Id (idType, setIdType)
import GHC.Types.Name
import GHC.Types.Name.Reader (mkVarUnqual)
=====================================
utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
=====================================
@@ -37,7 +37,7 @@ import GHC hiding (NoLink, HsTypeGhcPsExt (..))
import GHC.Builtin.Types (eqTyCon_RDR, tupleDataConName, tupleTyConName)
import GHC.Core.TyCon (tyConResKind)
import GHC.Driver.DynFlags (getDynFlags)
-import GHC.Types.Basic (TopLevelFlag (..), TupleSort (..))
+import GHC.Types.Basic (TupleSort (..))
import GHC.Types.Name
import GHC.Types.Name.Reader (RdrName (Exact))
import Language.Haskell.Syntax.BooleanFormula(BooleanFormula(..))
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d970f2bb8e0c5d173becef1c1aa8f1…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d970f2bb8e0c5d173becef1c1aa8f1…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/jeltsch/obtaining-os-handles] 152 commits: X86 CodeGen: fix assign_eax_sse_regs
by Wolfgang Jeltsch (@jeltsch) 23 Jan '26
by Wolfgang Jeltsch (@jeltsch) 23 Jan '26
23 Jan '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/obtaining-os-handles at Glasgow Haskell Compiler / GHC
Commits:
fca9cd7c by sheaf at 2025-12-18T13:18:18-05:00
X86 CodeGen: fix assign_eax_sse_regs
We must set %al to the number of SSE2 registers that contain arguments
(in case we are dealing with a varargs function). The logic for counting
how many arguments reside in SSE2 registers was incorrect, as it used
'isFloatFormat', which incorrectly ignores vector registers.
We now instead do case analysis on the register class:
is_sse_reg r =
case targetClassOfReg platform r of
RcFloatOrVector -> True
RcInteger -> False
This change is necessary to prevent segfaults in T20030_test1j, because
subsequent commits change the format calculations, resulting in vector
formats more often.
- - - - -
53150617 by sheaf at 2025-12-18T13:18:19-05:00
X86 regUsageOfInstr: fix format for IMUL
When used with 8-bit operands, the IMUL instruction returns the result
in the lower 16 bits of %rax (also known as %ax). This is different
than for the other sizes, where an input at 16, 32 or 64 bits will
result in 16, 32 or 64 bits of output in both %rax and %rdx.
This doesn't affect the behaviour of the compiler, because we don't
allow partial writes at sub-word sizes. The rationale is explained
in Wrinkle [Don't allow scalar partial writes] in Note [Register formats in liveness analysis],
in GHC.CmmToAsm.Reg.Liveness.
- - - - -
c7a56dd1 by sheaf at 2025-12-18T13:18:19-05:00
Liveness analysis: consider register formats
This commit updates the register allocator to be a bit more careful in
situations in which a single register is used at multiple different
formats, e.g. when xmm1 is used both to store a Double# and a DoubleX2#.
This is done by introducing the 'Regs' newtype around 'UniqSet RegWithFormat',
for which the combining operations take the larger of the two formats
instead of overriding the format.
Operations on 'Regs' are defined in 'GHC.CmmToAsm.Reg.Regs'. There is
a modest compile-time cost for the additional overhead for tracking
register formats, which causes the metric increases of this commit.
The subtle aspects of the implementation are outlined in
Note [Register formats in liveness analysis] in GHC.CmmToAsm.Reg.Liveness.
Fixes #26411 #26611
-------------------------
Metric Increase:
T12707
T26425
T3294
-------------------------
- - - - -
c2e83339 by sheaf at 2025-12-18T13:18:19-05:00
Register allocator: reload at same format as spill
This commit ensures that if we spill a register onto the stack at a
given format, we then always reload the register at this same format.
This ensures we don't end up in a situation where we spill F64x2 but end
up only reloading the lower F64. This first reload would make us believe
the whole data is in a register, thus silently losing the upper 64 bits
of the spilled register's contents.
Fixes #26526
- - - - -
55ab583b by sheaf at 2025-12-18T13:18:19-05:00
Register allocation: writes redefine format
As explained in Note [Allocated register formats] in GHC.CmmToAsm.Reg.Linear,
we consider all writes to redefine the format of the register.
This ensures that in a situation such as
movsd .Ln6m(%rip),%v1
shufpd $0,%v1,%v1
we properly consider the broadcast operation to change the format of %v1
from F64 to F64x2.
This completes the fix to #26411 (test in T26411b).
- - - - -
951402ed by Vladislav Zavialov at 2025-12-18T13:19:05-05:00
Parser: improve mkModuleImpExp, remove checkImportSpec
1. The `mkModuleImpExp` helper now knows whether it is processing an import or
export list item, and uses this information to produce a more accurate error
message for `import M (T(..,x))` with PatternSynonyms disabled.
The old message incorrectly referred to this case as an export form.
2. The `checkImportSpec` helper is removed in favor of more comprehensive error
checking in `mkModuleImpExp`.
3. Additionaly, the invariants of `ImpExpList` and `ImpExpAllWith` have been
made more explicit in the comments and assertions (calls to 'panic').
Test case: import-syntax-no-ext
- - - - -
47d83d96 by Vladislav Zavialov at 2025-12-18T13:19:06-05:00
Subordinate namespace-specified wildcards (#25901)
Add support for subordinate namespace-specified wildcards
`X(type ..)` and `X(data ..)` to import and export lists.
Examples:
import M (Cls(type ..)) -- imports Cls and all its associated types
import M (Cls(data ..)) -- imports Cls and all its methods
module M (R(data ..), C(type ..)) where
-- exports R and all its data constructors and record fields;
-- exports C and all its associated types, but not its methods
The scope of this change is limited to the case where the wildcard is the only
subordinate import/export item, whereas the more complex forms `X(type .., f)`
or `X(type .., data ..)` are unsupported and raise the newly introduced
PsErrUnsupportedExplicitNamespace error. This restriction may be lifted later.
Summary of the changes:
1. Refactor IEThingAll to store its extension field XIEThingAll as a record
IEThingAllExt instead of a tuple.
2. Extend the AST by adding a NamespaceSpecifier field to IEThingAllExt,
representing an optional namespace specifier `type` or `data` in front
of a subordinate wildcard `X(..)`.
3. Extend the grammar in Parser.y with productions for `type ..` and `data ..`
in subordinate import/export items.
4. Introduce `filterByNamespaceGREs` to filter [GlobalRdrElt] by a
NamespaceSpecifier; use it in `filterImports` and `exports_from_avail`
to account for the namespace specifier in IEThingAll.
5. Improve diagnostics by storing more information in DodgyImportsEmptyParent
and DodgyExportsEmptyParent.
Test cases:
T25901_sub_e T25901_sub_f T25901_sub_g T25901_sub_a
T25901_sub_b T25901_sub_c T25901_sub_d T25901_sub_w
DodgyImports02 DodgyImports03 DodgyImports04
- - - - -
eac418bb by Recursion Ninja at 2025-12-18T13:19:48-05:00
Removing the 'Data' instance for 'InstEnv'.
The 'Data' instance is blocking work on Trees that Grow, and the
'Data' instance seem to have been added without a clear purpose.
- - - - -
e920e038 by Recursion Ninja at 2025-12-18T13:19:48-05:00
'Decouple Language.Haskell.Syntax.Decls' from 'GHC.Unit.Module.Warnings'
- - - - -
bd38b76c by Cheng Shao at 2025-12-18T13:20:31-05:00
testsuite: improve coverage of foundation test
This patch refactors the `foundation` test a bit to improve coverage:
- Instead of using a hard-coded seed, a random seed is now taken from
the command line, and printed upon test failure. This improves test
coverage over many future CI runs, and shall a failure occur, the
seed is available in the CI log for local reproduction.
- The iterations count is bumped to 1000 instead of 100, similar to
the bump in `test-primops`. Runtime timeout is bumped 2x just to be
safe.
- Improve `newLCGGen` by using non-atomic loads/stores on a
`MutableByteArray#` for storing mutable `Word64`, this test doesn't
use parallelism in the first place
- Fixed a few compiler warnings and removed redundant pragmas and
imports
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
3995187c by Sylvain Henry at 2025-12-18T13:21:45-05:00
Doc: document -pgmi "" (#26634)
- - - - -
5729418c by Cheng Shao at 2025-12-18T13:22:29-05:00
rts: use __builtin_mul_overflow for hs_mulIntMayOflo
This patch uses `__builtin_mul_overflow` to implement
`hs_mulIntMayOflo`. This is a GNU C checked arithmetic builtin
function supported by gcc/clang, is type-generic so works for both
32-bit/64-bit, and makes the code both more efficient and easier to
read/maintain than the previous hand rolled logic.
- - - - -
1ca4b49a by Cheng Shao at 2025-12-18T13:23:11-05:00
compiler/rts: fix ABI mismatch in barf() invocations
This patch fixes a long-standing issue of ABI mismatch in `barf()`
invocations, both in compiler-emitted code and in hand written Cmm
code:
- In RTS, we have `barf()` which reports a fatal internal error
message and exits the program.
- `barf()` is a variadic C function! When used as a callee of a
foreign call with `ccall` calling convention instead of `capi`,
there is an ABI mismatch between the caller and the callee!
- Unfortunately, both the compiler and the Cmm sources contain many
places where we call `barf()` via `ccall` convention!! Like, when
you write `foreign "C" barf("foo object (%p) entered!", R1)`, it
totally doesn't do what you think it'll do at all!! The second
argument `R1` is not properly passed in `va_list`, and the behavior
is completely undefined!!
- Even more unfortunately, this issue has been sitting around long
enough because the ABI mismatch is subtle enough on normie platforms
like x64 and arm64.
- But there are platforms like wasm32 that are stricter about ABI, and
the broken `barf()` invocations already causes trouble for wasm
backend: we had to use ugly hacks like `barf(errmsg, NULL)` to make
`wasm-ld` happy, and even with this band-aid, compiler-generated
`barf()` invocations are still broken, resulting in regressions in
certain debug-related functionality, e.g. `-dtag-inference-checks`
is broken on wasm32 (#22882).
This patch properly fixes the issue:
- We add non-variadic `barf` wrappers in the RTS that can be used as
`ccall` callees
- Both the compiler `emitBarf` logic and the hand-written Cmm are
changed to call these wrappers
- `emitBarf` now also properly annotates the foreign call as
`CmmNeverReturns` to indicate it's a noreturn call to enable more
efficient code generation
`-dtag-inference-checks` now works on wasm. Closes #22882.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
b3dd23b9 by Vilim Lendvaj at 2025-12-18T13:23:57-05:00
Remove outdated comment
The Traversable instance for ZipList is no longer in
GHC.Internal.Data.Traversable. In fact, it is right below this very comment.
- - - - -
9a9c2f03 by Cheng Shao at 2025-12-18T13:24:39-05:00
compiler: remove unused OtherSection logic
This patch removes the OtherSection logic in Cmm, given it's never
actually used by any of our backends.
- - - - -
91edd292 by Wolfgang Jeltsch at 2025-12-19T03:18:19-05:00
Remove unused known-key and name variables for generics
This removes the known-key and corresponding name variables for `K1`,
`M1`, `R`, `D`, `C`, `S`, and `URec` from `GHC.Generics`, as they are
apparently nowhere used in GHC’s source code.
- - - - -
73ee7e38 by Wolfgang Jeltsch at 2025-12-19T03:19:02-05:00
Remove unused known keys and names for generics classes
This removes the known-key and corresponding name variables for
`Datatype`, `Constructor`, and `Selector` from `GHC.Generics`, as they
are apparently nowhere used in GHC’s source code.
- - - - -
f69c5f14 by Cheng Shao at 2025-12-19T03:19:45-05:00
wasm: fix handling of ByteArray#/MutableByteArray# arguments in JSFFI imports
This patch fixes the handling of ByteArray#/MutableByteArray#
arguments in JSFFI imports, see the amended note and manual for
explanation. Also adds a test to witness the fix.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
224446a2 by Cheng Shao at 2025-12-20T07:49:54-05:00
rts: workaround -Werror=maybe-uninitialized false positives
In some cases gcc might report -Werror=maybe-uninitialized that we
know are false positives, but need to workaround it to make validate
builds with -Werror pass.
- - - - -
251ec087 by Cheng Shao at 2025-12-20T07:49:54-05:00
hadrian: use -Og as C/C++ optimization level when debugging
This commit enables -Og as optimization level when compiling the debug
ways of rts. According to gcc documentation
(https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-Og)
-Og is a better choice than -O0 for producing debuggable code. It's
also supported by clang as well, so it makes sense to use it as a
default for debugging. Also add missing -g3 flag to C++ compilation
flags in +debug_info flavour transformer.
- - - - -
fb586c67 by Cheng Shao at 2025-12-20T07:50:36-05:00
compiler: replace DList with OrdList
This patch removes `DList` logic from the compiler and replaces it
with `OrdList` which also supports O(1) concatenation and should be
more memory efficient than the church-encoded `DList`.
- - - - -
8149c987 by Cheng Shao at 2025-12-20T17:06:51-05:00
hadrian: add with_profiled_libs flavour transformer
This patch adds a `with_profiled_libs` flavour transformer to hadrian
which is the exact opposite of `no_profiled_libs`. It adds profiling
ways to stage1+ rts/library ways, and doesn't alter other flavour
settings. It is useful when needing to test profiling logic locally
with a quick flavour.
- - - - -
746b18cd by Cheng Shao at 2025-12-20T17:06:51-05:00
hadrian: fix missing profiled dynamic libraries in profiled_ghc
This commit fixes the profiled_ghc flavour transformer to include
profiled dynamic libraries as well, since they're supported by GHC
since !12595.
- - - - -
4dd7e3b9 by Cheng Shao at 2025-12-20T17:07:33-05:00
ci: set http.postBuffer to mitigate perf notes timeout on some runners
This patch sets http.postBuffer to mitigate the timeout when fetching
perf notes on some runners with slow internet connection. Fixes #26684.
- - - - -
bc36268a by Wolfgang Jeltsch at 2025-12-21T16:23:24-05:00
Remove unused known keys and names for type representations
This removes the known-key and corresponding name variables for
`TrName`, `TrNameD`, `TypeRep`, `KindRepTypeLitD`, `TypeLitSort`, and
`mkTrType`, as they are apparently nowhere used in GHC’s source code.
- - - - -
ff5050e9 by Wolfgang Jeltsch at 2025-12-21T16:24:04-05:00
Remove unused known keys and names for natural operations
This removes the known-key and corresponding name variables for
`naturalAndNot`, `naturalLog2`, `naturalLogBaseWord`, `naturalLogBase`,
`naturalPowMod`, `naturalSizeInBase`, `naturalToFloat`, and
`naturalToDouble`, as they are apparently nowhere used in GHC’s source
code.
- - - - -
424388c2 by Wolfgang Jeltsch at 2025-12-21T16:24:45-05:00
Remove the unused known key and name for `Fingerprint`
This removes the variables for the known key and the name of the
`Fingerprint` data constructor, as they are apparently nowhere used in
GHC’s source code.
- - - - -
a1ed86fe by Wolfgang Jeltsch at 2025-12-21T16:25:26-05:00
Remove the unused known key and name for `failIO`
This removes the variables for the known key and the name of the
`failIO` operation, as they are apparently nowhere used in GHC’s source
code.
- - - - -
b8220daf by Wolfgang Jeltsch at 2025-12-21T16:26:07-05:00
Remove the unused known key and name for `liftM`
This removes the variables for the known key and the name of the `liftM`
operation, as they are apparently nowhere used in GHC’s source code.
- - - - -
eb0628b1 by Wolfgang Jeltsch at 2025-12-21T16:26:47-05:00
Fix the documentation of `hIsClosed`
- - - - -
db1ce858 by sheaf at 2025-12-22T17:11:17-05:00
Do deep subsumption when computing valid hole fits
This commit makes a couple of improvements to the code that
computes "valid hole fits":
1. It uses deep subsumption for data constructors.
This matches up the multiplicities, as per
Note [Typechecking data constructors].
This fixes #26338 (test: LinearHoleFits).
2. It now suggests (non-unidirectional) pattern synonyms as valid
hole fits. This fixes #26339 (test: PatSynHoleFit).
3. It uses 'stableNameCmp', to make the hole fit output deterministic.
-------------------------
Metric Increase:
hard_hole_fits
-------------------------
- - - - -
72ee9100 by sheaf at 2025-12-22T17:11:17-05:00
Speed up hole fits with a quick pre-test
This speeds up the machinery for valid hole fits by doing a small
check to rule out obviously wrong hole fits, such as:
1. A hole fit identifier whose type has a different TyCon at the head,
after looking through foralls and (=>) arrows, e.g.:
hole_ty = Int
cand_ty = Maybe a
or
hole_ty = forall a b. a -> b
cand_ty = forall x y. Either x y
2. A hole fit identifier that is not polymorphic when the hole type
is polymorphic, e.g.
hole_ty = forall a. a -> a
cand_ty = Int -> Int
-------------------------
Metric Decrease:
hard_hole_fits
-------------------------
- - - - -
30e513ba by Cheng Shao at 2025-12-22T17:12:00-05:00
configure: remove unused win32-tarballs.md5sum
This patch removes the unused `win32-tarballs.md5sum` file from the
tree. The current mingw tarball download logic in
`mk/get-win32-tarballs.py` fetches and checks against `SHA256SUM` from
the same location where the tarballs are fetched, and this file has
been unused for a few years.
- - - - -
a2d52b3b by Wolfgang Jeltsch at 2025-12-23T04:47:33-05:00
Add an operation `System.IO.hGetNewlineMode`
This commit also contains some small code and documentation changes for
related operations, for the sake of consistency.
- - - - -
b26d134a by Cheng Shao at 2025-12-23T04:48:15-05:00
rts: opportunistically reclaim slop space in shrinkMutableByteArray#
Previously, `shrinkMutableByteArray#` shrinks a `MutableByteArray#`
in-place by assigning the new size to it, and zeroing the extra slop
space. That slop space is not reclaimed and wasted. But it's often the
case that we allocate a `MutableByteArray#` upfront, then shrink it
shortly after, so the `MutableByteArray#` closure sits right at the
end of a nursery block; this patch identifies such chances, and also
shrink `bd->free` if possible, reducing heap space fragmentation.
Co-authored-by: Codex <codex(a)openai.com>
-------------------------
Metric Decrease:
T10678
-------------------------
- - - - -
c72ddabf by Cheng Shao at 2025-12-23T16:13:23-05:00
hadrian: fix bootstrapping with ghc-9.14
This patch fixes bootstrapping GHC with ghc-9.14, tested locally with
ghc-9.14.1 release as bootstrapping GHC.
- - - - -
0fd6d8e4 by Cheng Shao at 2025-12-23T16:14:05-05:00
hadrian: pass -keep-tmp-files to test ghc when --keep-test-files is enabled
This patch makes hadrian pass `-keep-tmp-files` to test ghc when
`--keep-test-files` is enabled, so you can check the ghc intermediate
files when debugging certain test failures. Closes #26688.
- - - - -
81d10134 by Cheng Shao at 2025-12-24T06:11:52-05:00
configure: remove dead code in configure scripts
This patch removes dead code in our configure scripts, including:
- Variables and auto-detected programs that are not used
- autoconf functions that are not used, or export a variable that's
not used
- `AC_CHECK_HEADERS` invocations that don't have actual corresponding
`HAVE_XXX_H` usage
- Other dead code (e.g. stray `AC_DEFUN()`)
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
fb1381c3 by Wolfgang Jeltsch at 2025-12-24T06:12:34-05:00
Remove unused known keys and names for list operations
This removes the known-key and corresponding name variables for
`concat`, `filter`, `zip`, and `(++)`, as they are apparently nowhere
used in GHC’s source code.
- - - - -
7b9c20f4 by Recursion Ninja at 2025-12-24T10:35:36-05:00
Decoupling Language.Haskell.Syntax.Binds from GHC.Types.Basic
by transferring InlinePragma types between the modules.
* Moved InlinePragma data-types to Language.Haskell.Syntax.Binds.InlinePragma
* Partitioned of Arity type synonyms to GHC.Types.Arity
* InlinePragma is now extensible via Trees That Grow
* Activation is now extensible via Trees That Grow
* Maybe Arity change to more descriptive InlineSaturation data-type
* InlineSaturation information removed from InlinePragma during GHS parsing pass
* Cleaned up the exposed module interfaces of the new modules
- - - - -
a3afae0c by Simon Peyton Jones at 2025-12-25T15:26:36-05:00
Check for rubbish literals in Lint
Addresses #26607.
See new Note [Checking for rubbish literals] in GHC.Core.Lint
- - - - -
8a317b6f by Aaron Allen at 2026-01-01T03:05:15-05:00
[#26183] Associated Type Iface Fix
When determining "extras" for class decl interface entries, axioms for
the associated types need to included so that dependent modules will be
recompiled if those axioms change.
resolves #26183
- - - - -
ae1aeaab by Cheng Shao at 2026-01-01T03:06:32-05:00
testsuite: run numeric tests with optasm when available
This patch adds the `optasm` extra way to nueric tests when NCG is
available. Some numeric bugs only surface with optimization, omitting
this can hide these bugs and even make them slip into release! (e.g. #26711)
- - - - -
6213bb57 by maralorn at 2026-01-02T16:30:32+01:00
GHC.Internal.Exception.Context: Fix comment
on addExceptionAnnotation
- - - - -
b820ff50 by Janis Voigtlaender at 2026-01-05T02:43:18-05:00
GHC.Internal.Control.Monad.replicateM: Fix comment
- - - - -
a8a94aad by Cheng Shao at 2026-01-05T16:24:04-05:00
hadrian: drops unused PE linker script for windows
This patch drops unused PE linker script for windows in the
`MergeObjects` builder of hadrian. The linker script is used for
merging object files into a single `HS*.o` object file and undoing the
effect of split sections, when building the "ghci library" object
file. However, we don't build the ghci library on windows, and this
code path is actually unreachable.
- - - - -
53038ea9 by Cheng Shao at 2026-01-05T16:24:04-05:00
hadrian: drop unused logic for building ghci libraries
This patch drops the unused logic for building ghci libraries in
hadrian:
- The term "ghci library" refers to an optional object file per
library `HS*.o`, which is merged from multiple object files in that
library using the `MergeObjects` builder in hadrian.
- The original rationale of having a ghci library object, in addition
to normal archives, was to speedup ghci loading, since the combined
object is linked with a linker script to undo the effects of
`-fsplit-sections` to reduce section count and make it easier for
the RTS linker to handle.
- However, most GHC builds enable `dynamicGhcPrograms` by default, in
such cases the ghci library would already not be built.
- `dynamicGhcPrograms` is disabled on Windows, but still we don't
build the ghci library due to lack of functioning merge objects
command.
- The only case that we actually build ghci library objects, are
alpine fully static bindists. However, for other reasons, split
sections is already disabled for fully static builds anyway!
- There will not be any regression if the ghci library objects are
absent from a GHC global libdir when `dynamicGhcPrograms` is
disabled. The RTS linker can already load the archives without any
issue.
Hence the removal. We now forcibly disable ghci libraries for all
Cabal components, and rip out all logic related to `MergeObjects` and
ghci libraries in hadrian. This also nicely cleans up some old todos
and fixmes that are no longer relevant.
Note that MergeObjects in hadrian is not the same thing as merge
objects in the GHC driver. The latter is not affected by this patch.
-------------------------
Metric Decrease:
libdir
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
8f209336 by Simon Jakobi at 2026-01-05T16:24:48-05:00
User's guide: Fix link to language extensions
Instead of linking to haddocks, it seemed more useful to link
to the extension overview in the user's guide.
Closes #26614.
- - - - -
0b7df6db by Simon Peyton Jones at 2026-01-06T09:32:23-05:00
Improved fundeps for closed type families
The big payload of this commit is to execute the plan suggested
in #23162, by improving the way that we generate functional
dependencies for closed type families.
It is all described in Note [Exploiting closed type families]
Most of the changes are in GHC.Tc.Solver.FunDeps
Other small changes
* GHC.Tc.Solver.bumpReductionDepth. This function brings together the code that
* Bumps the depth
* Checks for overflow
Previously the two were separated, sometimes quite widely.
* GHC.Core.Unify.niFixSubst: minor improvement, removing an unnecessary
itraetion in the base case.
* GHC.Core.Unify: no need to pass an InScopeSet to
tcUnifyTysForInjectivity. It can calculate one for itself; and it is
never inspected anyway so it's free to do so.
* GHC.Tc.Errors.Ppr: slight impovement to the error message for
reduction-stack overflow, when a constraint (rather than a type) is
involved.
* GHC.Tc.Solver.Monad.wrapUnifier: small change to the API
- - - - -
fde8bd88 by Simon Peyton Jones at 2026-01-06T09:32:23-05:00
Add missing (KK4) to kick-out criteria
There was a missing case in kick-out that meant we could fail
to solve an eminently-solvable constraint.
See the new notes about (KK4)
- - - - -
00082844 by Simon Peyton Jones at 2026-01-06T09:32:23-05:00
Some small refactorings of error reporting in the typechecker
This is just a tidy-up commit.
* Add ei_insoluble to ErrorItem, to cache insolubility.
Small tidy-up.
* Remove `is_ip` and `mkIPErr` from GHC.Tc.Errors; instead enhance mkDictErr
to handle implicit parameters. Small refactor.
- - - - -
fe4cb252 by Simon Peyton Jones at 2026-01-06T09:32:24-05:00
Improve recording of insolubility for fundeps
This commit addresses #22652, by recording when the fundeps for
a constraint are definitely insoluble. That in turn improves the
perspicacity of the pattern-match overlap checker.
See Note [Insoluble fundeps]
- - - - -
df0ffaa5 by Simon Peyton Jones at 2026-01-06T09:32:24-05:00
Fix a buglet in niFixSubst
The MR of which this is part failed an assertion check extendTvSubst
because we extended the TvSubst with a CoVar. Boo.
This tiny patch fixes it, and adds the regression test from #13882
that showed it up.
- - - - -
3d6aba77 by konsumlamm at 2026-01-06T09:33:16-05:00
Fix changelog formatting
- - - - -
69e0ab59 by Cheng Shao at 2026-01-06T19:37:56-05:00
compiler: add targetHasRTSWays function
This commit adds a `targetHasRTSWays` util function in
`GHC.Driver.Session` to query if the target RTS has a given Ways (e.g.
WayThreaded).
- - - - -
25a0ab94 by Cheng Shao at 2026-01-06T19:37:56-05:00
compiler: link on-demand external interpreter with threaded RTS
This commit makes the compiler link the on-demand external interpreter
program with threaded RTS if it is available in the target RTS ways.
This is a better default than the previous single-threaded RTS, and it
enables the external interpreter to benefit from parallelism when
deserializing CreateBCOs messages.
- - - - -
92404a2b by Cheng Shao at 2026-01-06T19:37:56-05:00
hadrian: link iserv with threaded RTS
This commit makes hadrian link iserv with threaded RTS if it's
available in the RTS ways. Also cleans up the iserv main C program
which can be replaced by the `-fkeep-cafs` link-time option.
- - - - -
a20542d2 by Cheng Shao at 2026-01-06T19:38:38-05:00
ghc-internal: remove unused GMP macros
This patch removes unused GMP related macros from `ghc-internal`. The
in-tree GMP version was hard coded and outdated, but it was not used
anywhere anyway.
- - - - -
4079dcd6 by Cheng Shao at 2026-01-06T19:38:38-05:00
hadrian: fix in-tree gmp configure error on newer c compilers
Building in-tree gmp on newer c compilers that default to c23 fails at
configure stage, this patch fixes it, see added comment for
explanation.
- - - - -
414d1fe1 by Cheng Shao at 2026-01-06T19:39:20-05:00
compiler: fix LLVM backend pdep/pext handling for i386 target
This patch fixes LLVM backend's pdep/pext handling for i386 target,
and also removes non-existent 128/256/512 bit hs_pdep/hs_pext callees.
See amended note for more explanation. Fixes #26450.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
c7f6fba3 by Cheng Shao at 2026-01-06T19:39:20-05:00
ci: remove allow_failure flag for i386 alpine job
The LLVM codegen issue for i386 has been fixed, and the i386 alpine
job should pass now. This commit removes the allow_failure flag so
that other i386 regressions in the future are signaled more timely.
- - - - -
52d00c05 by Simon Peyton Jones at 2026-01-07T10:24:21-05:00
Add missing InVar->OutVar lookup in SetLevels
As #26681 showed, the SetLevels pass was failing to map an InVar to
an OutVar. Very silly! I'm amazed it hasn't broken before now.
I have improved the type singatures (to mention InVar and OutVar)
so it's more obvious what needs to happen.
- - - - -
ab0a5594 by Cheng Shao at 2026-01-07T10:25:04-05:00
hadrian: drop deprecated pkgHashSplitObjs code path
This patch drops deprecated `pkgHashSplitObjs` code path from hadrian,
since GHC itself has removed split objs support many versions ago and
this code path is unused.
- - - - -
bb3a2ba1 by Cheng Shao at 2026-01-07T10:25:44-05:00
hadrian: remove linting/assertion in quick-validate flavour
The `quick-validate` flavour is meant for testing ghc and passing the
testsuite locally with similar settings to `validate` but faster. This
patch removes the linting/assertion overhead in `quick-validate` to
improve developer experience. I also took the chance to simplify
redundant logic of rts/library way definition in `validate` flavour.
- - - - -
7971f5dd by Cheng Shao at 2026-01-07T10:26:26-05:00
deriveConstants: clean up unused constants
This patch cleans up unused constants from `deriveConstants`, they are
not used by C/Cmm code in the RTS, nor compiler-generated code.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
4df96993 by Cheng Shao at 2026-01-07T10:27:08-05:00
hadrian: pass -fno-omit-frame-pointer with +debug_info
This patch adds `-fno-omit-frame-pointer` as C/C++ compilation flag
when compiling with `+debug_info` flavour transformer. It's a sane
default when you care about debugging and reliable backtraces, and
makes debugging/profiling with bpf easier.
- - - - -
8a3900a3 by Aaron Allen at 2026-01-07T10:27:57-05:00
[26705] Include TyCl instances in data fam iface entry
Ensures dependent modules are recompiled when the class instances for a
data family instance change.
resolves #26705
- - - - -
a0b980af by Cheng Shao at 2026-01-07T10:28:38-05:00
hadrian: remove unused Hp2Ps/Hpc builders
This patch removes the Hp2Ps/Hpc builders from hadrian, they are
unused in the build system. Note that the hp2ps/hpc programs are still
built and not affected.
- - - - -
50a58757 by Cheng Shao at 2026-01-07T10:29:20-05:00
hadrian: only install js files to libdir for wasm/js targets
There are certain js files required for wasm/js targets to work, and
previously hadrian would install those js files to libdir
unconditionally on other targets as well. This could be a minor
annoyance for packagers especially when the unused js files contain
shebangs that interfere with the packaging process. This patch makes
hadrian only selectively install the right js files for the right
targets.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
da40e553 by Simon Peyton Jones at 2026-01-07T10:30:00-05:00
Add flavour transformer assertions_stage1
This allows us to enable -DDEBUG assertions in the stage1 compiler
- - - - -
ec3cf767 by Cheng Shao at 2026-01-08T06:24:31-05:00
make: remove unused Makefiles from legacy make build system
This patch removes unused Makefiles from legacy make build system; now
they are never used by hadrian in any way, and they already include
common boilerplate mk files that are long gone in the make build
system removal, hence the housecleaning.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
04ea3f83 by Cheng Shao at 2026-01-08T06:25:13-05:00
compiler: use -O3 as LLVM optimization level for ghc -O2
The GHC driver clamps LLVM optimization level to `-O2` due to LLVM
crashes, but those were historical issues many years ago that are no
longer relevant for LLVM versions we support today. This patch changes
the driver to use `-O3` as LLVM optimization level when compiling with
`-O2`, which is a better default when we're willing to trade
compilation time for faster generated code.
- - - - -
472df471 by Peter Trommler at 2026-01-08T13:28:54-05:00
Use half-word literals in info tables
With this commit info tables are mapped to the same assembler code
on big-endian and little-endian platforms.
Fixes #26579.
- - - - -
393f9c51 by Simon Peyton Jones at 2026-01-08T13:29:35-05:00
Refactor srutOkForBinderSwap
This MR does a small refactor:
* Moves `scrutOkForBinderSwap` and `BinderSwapDecision`
to GHC.Core.Utils
* Inverts the sense of the coercion it returns, which makes
more sense
No effect on behaviour
- - - - -
ad76fb0f by Simon Peyton Jones at 2026-01-08T13:29:36-05:00
Improve case merging
This small MR makes case merging happen a bit more often than
it otherwise could, by getting join points out of the way.
See #26709 and GHC.Core.Utils
Note [Floating join points out of DEFAULT alternatives]
- - - - -
4c9395f5 by Cheng Shao at 2026-01-08T13:30:16-05:00
hadrian: remove broken hsc2hs flag when cross compiling to windows
This patch removes the `--via-asm` hsc2hs flag when cross compiling to
windows. With recent llvm-mingw toolchain, it would fail with:
```
x86_64-w64-mingw32-hsc2hs: Cannot combine instructions: [Quad 8,Long 4,Long 241,Ref ".Ltmp1-.Ltmp0"]
```
The hsc2hs default `--cross-compile` logic is slower but works.
- - - - -
71fdef55 by Simon Peyton Jones at 2026-01-08T13:30:57-05:00
Try harder to keep the substitution empty
Avoid unnecessary cloning of variables in the Simplifier.
Addresses #26724,
See Note [Keeping the substitution empty]
We get some big wins in compile time
Metrics: compile_time/bytes allocated
-------------------------------------
Baseline
Test Metric value New value Change
----------------------------------------------------------------------------
CoOpt_Singletons(normal) ghc/alloc 721,544,088 692,174,216 -4.1% GOOD
LargeRecord(normal) ghc/alloc 1,268,031,157 1,265,168,448 -0.2%
T14766(normal) ghc/alloc 918,218,533 688,432,296 -25.0% GOOD
T15703(normal) ghc/alloc 318,103,629 306,638,016 -3.6% GOOD
T17836(normal) ghc/alloc 419,174,584 418,400,824 -0.2%
T18478(normal) ghc/alloc 471,042,976 470,261,376 -0.2%
T20261(normal) ghc/alloc 573,387,162 563,663,336 -1.7%
T24984(normal) ghc/alloc 87,832,666 87,636,168 -0.2%
T25196(optasm) ghc/alloc 1,103,284,040 1,101,376,992 -0.2%
hard_hole_fits(normal) ghc/alloc 224,981,413 224,608,208 -0.2%
geo. mean -0.3%
minimum -25.0%
maximum +0.1%
Metric Decrease:
CoOpt_Singletons
T14766
T15703
- - - - -
30341168 by Simon Peyton Jones at 2026-01-08T13:31:38-05:00
Add regression test for #24867
- - - - -
1ac1a541 by Julian Ospald at 2026-01-09T02:48:53-05:00
Support statically linking executables properly
Fixes #26434
In detail, this does a number of things:
* Makes GHC aware of 'extra-libraries-static' (this changes the package
database format).
* Adds a switch '-static-external' that will honour 'extra-libraries-static'
to link external system dependencies statically.
* Adds a new field to settings/targets: "ld supports verbatim namespace".
This field is used by '-static-external' to conditionally use '-l:foo.a'
syntax during linking, which is more robust than trying to find the
absolute path to an archive on our own.
* Adds a switch '-fully-static' that is meant as a high-level interface
for e.g. cabal. This also honours 'extra-libraries-static'.
This also attempts to clean up the confusion around library search directories.
At the moment, we have 3 types of directories in the package database
format:
* library-dirs
* library-dirs-static
* dynamic-library-dirs
However, we only have two types of linking: dynamic or static. Given the
existing logic in 'mungeDynLibFields', this patch assumes that
'library-dirs' is really just nothing but a fallback and always
prefers the more specific variants if they exist and are non-empty.
Conceptually, we should be ok with even just one search dirs variant.
Haskell libraries are named differently depending on whether they're
static or dynamic, so GHC can conveniently pick the right one depending
on the linking needs. That means we don't really need to play tricks
with search paths to convince the compiler to do linking as we want it.
For system C libraries, the convention has been anyway to place static and
dynamic libs next to each other, so we need to deal with that issue
anyway and it is outside of our control. But this is out of the scope
of this patch.
This patch is backwards compatible with cabal. Cabal should however
be patched to use the new '-fully-static' switch.
- - - - -
ad3c808d by Julian Ospald at 2026-01-09T02:48:53-05:00
Warn when "-dynamic" is mixed with "-staticlib"
- - - - -
322dd672 by Matthew Pickering at 2026-01-09T02:49:35-05:00
rts: Use INFO_TABLE_CONSTR for stg_dummy_ret_closure
Since the closure type is CONSTR_NOCAF, we need to use INFO_TABLE_CONSTR
to populate the constructor description field (this crashes ghc-debug
when decoding AP_STACK frames sometimes)
Fixes #26745
- - - - -
039bac4c by Ben Gamari at 2026-01-09T20:22:16-05:00
ghc-internal: Move STM utilities out of GHC.Internal.Conc.Sync
This is necessary to avoid an import cycle on Windows when importing
`GHC.Internal.Exception.Context` in `GHC.Internal.Conc.Sync`.
On the road to address #25365.
- - - - -
8c389e8c by Ben Gamari at 2026-01-09T20:22:16-05:00
base: Capture backtrace from throwSTM
Implements core-libraries-committee#297.
Fixes #25365.
- - - - -
e1ce1fc3 by Ben Gamari at 2026-01-09T20:22:16-05:00
base: Annotate rethrown exceptions in catchSTM with WhileHandling
Implements core-libraries-committee#298
- - - - -
c4ebdbdf by Cheng Shao at 2026-01-09T20:23:06-05:00
compiler: make getPrim eagerly evaluate its result
This commit makes `GHC.Utils.Binary.getPrim` eagerly evaluate its
result, to avoid accidental laziness when future patches build other
binary parsers using `getPrim`.
- - - - -
66a0c4f7 by Cheng Shao at 2026-01-09T20:23:06-05:00
compiler: implement fast get/put for Word16/Word32/Word64
Previously, `GHC.Utils.Binary` contains `get`/`put` functions for
`Word16`/`Word32`/`Word64` which always loads and stores them as
big-endian words at a potentially unaligned address. The previous
implementation is based on loads/stores of individual bytes and
concatenating bytes with bitwise operations, which currently cannot be
fused to a single load/store operation by GHC.
This patch implements fast `get`/`put` functions for
`Word16`/`Word32`/`Word64` based on a single memory load/store, with
an additional `byteSwap` operation on little-endian hosts. It is based
on unaligned load/store primops added since GHC 9.10, and we already
require booting with at least 9.10, so it's about time to switch to
this faster path.
- - - - -
641ec3f0 by Simon Peyton Jones at 2026-01-09T20:23:55-05:00
Fix scoping errors in specialisation
Using -fspecialise-aggressively in #26682 showed up a couple of
subtle errors in the type-class specialiser.
* dumpBindUDs failed to call `deleteCallsMentioning`, resulting in a
call that mentioned a dictionary that was not in scope. This call
has been missing since 2009!
commit c43c981705ec33da92a9ce91eb90f2ecf00be9fe
Author: Simon Peyton Jones <simonpj(a)microsoft.com>
Date: Fri Oct 23 16:15:51 2009 +0000
Fixed by re-combining `dumpBindUDs` and `dumpUDs`.
* I think there was another bug involving the quantified type
variables in polymorphic specialisation. In any case I refactored
`specHeader` and `spec_call` so that the former looks for the
extra quantified type variables rather than the latter. This
is quite a worthwhile simplification: less code, easier to grok.
Test case in simplCore/should_compile/T26682,
brilliantly minimised by @sheaf.
- - - - -
2433e91d by Cheng Shao at 2026-01-09T20:24:43-05:00
compiler: change sectionProtection to take SectionType argument
This commit changes `sectionProtection` to only take `SectionType`
argument instead of whole `Section`, since it doesn't need the Cmm
section content anyway, and it can then be called in parts of NCG
where we only have a `SectionType` in scope.
- - - - -
e5926fbe by Cheng Shao at 2026-01-09T20:24:43-05:00
compiler: change isInitOrFiniSection to take SectionType argument
This commit changes `isInitOrFiniSection` to only take `SectionType`
argument instead of whole `Section`, since it doesn't need the Cmm
section content anyway, and it can then be called in parts of NCG
where we only have a `SectionType` in scope. Also marks it as
exported.
- - - - -
244d57d7 by Cheng Shao at 2026-01-09T20:24:43-05:00
compiler: fix split sections on windows
This patch fixes split sections on windows by emitting the right
COMDAT section header in NCG, see added comment for more explanation.
Fix #26696 #26494.
-------------------------
Metric Decrease:
LargeRecord
T9675
size_hello_artifact
size_hello_artifact_gzip
size_hello_unicode
size_hello_unicode_gzip
Metric Increase:
T13035
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
182f3d0f by Cheng Shao at 2026-01-09T20:25:28-05:00
iserv: add comment about -fkeep-cafs
- - - - -
49675b69 by Matthew Craven at 2026-01-09T20:26:14-05:00
Account for "stupid theta" in demand sig for DataCon wrappers
Fixes #26748.
- - - - -
f3c18890 by Samuel Thibault at 2026-01-10T15:48:22+01:00
hurd: Fix getExecutablePath build
3939a8bf93e27 ("GNU/Hurd: Add getExecutablePath support") added using
/proc/self/exe for GNU/Hurd but missed adding the required imports for
the corresponding code.
- - - - -
7f15bd15 by Samuel Thibault at 2026-01-12T07:16:25-05:00
Fix the OS string encoding for GNU/Hurd
Following https://github.com/haskell/cabal/pull/9434/files , and as seen
in the various gnu_HOST_OS usages in the source code, it is expected that
GNU/Hurd is advertised as "gnu", like the autotools do.
- - - - -
1db2f240 by Andrew Lelechenko at 2026-01-12T07:17:06-05:00
Add since annotation for Data.Bifoldable1
Fixes #26432
- - - - -
e038a383 by Sven Tennie at 2026-01-12T07:17:49-05:00
Ignore Windows CI tool directories in Git
Otherwise, we see thousands of changes in `git status` which is very
confusing to work with.
- - - - -
023c301c by sheaf at 2026-01-13T04:57:30-05:00
Don't re-use stack slots for growing registers
This commit avoids re-using a stack slot for a register that has grown
but already had a stack slot.
For example, suppose we have stack slot assigments
%v1 :: FF64 |-> StackSlot 0
%v2 :: FF64 |-> StackSlot 1
Later, we start using %v1 at a larger format (e.g. F64x2) and we need
to spill it again. Then we **must not** use StackSlot 0, as a spill
at format F64x2 would clobber the data in StackSlot 1.
This can cause some fragmentation of the `StackMap`, but that's probably
OK.
Fixes #26668
- - - - -
d0966e64 by fendor at 2026-01-13T04:58:11-05:00
Remove `traceId` from ghc-pkg executable
- - - - -
20d7efec by Simon Peyton Jones at 2026-01-13T12:41:22-05:00
Make SpecContr rules fire a bit later
See #26615 and Note [SpecConstr rule activation]
- - - - -
8bc4eb8c by Andrew Lelechenko at 2026-01-13T12:42:03-05:00
Upgrade mtl submodule to 2.3.2
Fixes #26656
- - - - -
c94aaacd by Cheng Shao at 2026-01-13T12:42:44-05:00
compiler: remove iserv and only use on-demand external interpreter
This patch removes `iserv` from the tree completely. Hadrian would no
longer build or distribute `iserv`, and the GHC driver would use the
on-demand external interpreter by default when invoked with
`-fexternal-interpreter`, without needing to specify `-pgmi ""`. This
has multiple benefits:
- It allows cleanup of a lot of legacy hacks in the hadrian codebase.
- It paves the way for running cross ghc's iserv via cross emulator
(#25523), fixing TH/ghci support for cross targets other than
wasm/js.
- - - - -
c1fe0097 by Peter Trommler at 2026-01-14T03:54:49-05:00
PPC NCG: Fix shift right MO code
The shift amount in shift right [arithmetic] MOs is machine word
width. Therefore remove unnecessary zero- or sign-extending of
shift amount.
It looks harmless to extend the shift amount argument because the
shift right instruction uses only the seven lowest bits (i. e. mod 128).
But now we have a conversion operation from a smaller type to word width
around a memory load at word width. The types are not matching up but
there is no check done in CodeGen. The necessary conversion from word
width down to the smaller width would be translated into a no-op on
PowerPC anyway. So all seems harmless if it was not for a small
optimisation in getRegister'.
In getRegister' a load instruction with the smaller width of the
conversion operation was generated. This loaded the most significant
bits of the word in memory on a big-endian platform. These bits were
zero and hence shift right was used with shift amount zero and not one
as required in test Sized.
Fixes #26519
- - - - -
2dafc65a by Cheng Shao at 2026-01-14T03:55:31-05:00
Tree-wide cleanup of cygwin logic
GHC has not supported cygwin for quite a few years already, and will
not resume support in the forseeable future. The only supported
windows toolchain is clang64/clangarm64 of the msys2 project. This
patch cleans up the unused cygwin logic in the tree.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
66b96e2a by Teo Camarasu at 2026-01-14T03:56:13-05:00
Set default eventlog-flush-interval to 5s
Resolves #26707
- - - - -
d0254579 by Andrew Lelechenko at 2026-01-14T03:56:53-05:00
Document when -maxN RTS option was added
- - - - -
f25e2b12 by Cheng Shao at 2026-01-14T11:10:39-05:00
testsuite: remove obsolete --ci option from the testsuite driver
This patch removes the obsolete `--ci` option from the testsuite
driver: neither the CI scripts nor hadrian ever invokes the testsuite
driver with `--ci`, and the perf notes are always fetched to the
`refs/notes/perf` local reference anyway.
- - - - -
7964763b by Julian Ospald at 2026-01-14T11:11:31-05:00
Fix fetch_cabal
* download cabal if the existing one is of an older version
* fix FreeBSD download url
* fix unpacking on FreeBSD
- - - - -
6b0129c1 by Julian Ospald at 2026-01-14T11:11:31-05:00
Bump toolchain in CI
- - - - -
0f53ccc6 by Julian Ospald at 2026-01-14T11:11:31-05:00
Use libffi-clib
Previously, we would build libffi via hadrian
and bundle it manually with the GHC bindist.
This now moves all that logic out of hadrian
and allows us to have a clean Haskell package
to build and link against and ship it without
extra logic.
This patch still retains the ability to link
against a system libffi.
The main reason of bundling libffi was that on
some platforms (e.g. FreeBSD and Mac), system libffi
is not visible to the C toolchain by default,
so users would require settings in e.g. cabal
to be able to compile anything.
This adds the submodule libffi-clib to the repository.
- - - - -
5e1cd595 by Peng Fan at 2026-01-14T11:12:26-05:00
NCG/LA64: add support for la664 micro architecture
Add '-mla664' flag to LA664, which has some new features:
atomic instructions, dbar hints, etc.
'LA464' is the default so that unrecognized instructions are not
generated.
- - - - -
c56567ec by Simon Peyton Jones at 2026-01-15T23:19:04+00:00
Add evals for strict data-con args in worker-functions
This fixes #26722, by adding an eval in a worker for
arguments of strict data constructors, even if the
function body uses them strictly.
See (WIS1) in Note [Which Ids should be strictified]
I took the opportunity to make substantial improvements in the
documentation for call-by-value functions. See especially
Note [CBV Function Ids: overview] in GHC.Types.Id.Info
Note [Which Ids should be CBV candidates?] ditto
Note [EPT enforcement] in GHC.Stg.EnforceEpt
among others.
- - - - -
9719ce5d by Simon Peyton Jones at 2026-01-15T23:19:04+00:00
Improve `interestingArg`
This function analyses a function's argument to see if it is
interesting enough to deserve an inlining discount. Improvements
for
* LitRubbish arguments
* exprIsExpandable arguments
See Note [Interesting arguments] which is substantially rewritten.
- - - - -
7b616b9f by Cheng Shao at 2026-01-16T06:45:00-05:00
compiler: fix regression when compiling foreign stubs in the rts unit
This patch fixes a regression when compiling foreign stubs in the rts
unit introduced in 05e25647f72bc102061af3f20478aa72bff6ff6e. A simple
revert would fix it, but it's better to implement a proper fix with
comment for better understanding of the underlying problem, see the
added comment for explanation.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
c343ef64 by Sylvain Henry at 2026-01-16T06:45:51-05:00
base: remove GHC.JS.Prim.Internal.Build (#23432)
See accepted CLC proposal https://github.com/haskell/core-libraries-committee/issues/329
- - - - -
29c0aceb by Simon Peyton Jones at 2026-01-16T17:18:11-05:00
Improve newtype unwrapping
Ticket #26746 describes several relatively-minor shortcomings of newtype
unwrapping. This MR addresses them, while also (arguably) simplifying
the code a bit.
See new Note [Solving newtype equalities: overview]
and Note [Decomposing newtype equalities]
and Note [Eager newtype decomposition]
and Note [Even more eager newtype decomposition]
For some reason, on Windows only, runtime allocations decrease for test
T5205 (from 52k to 48k). I have not idea why. No change at all on Linux.
I'm just going to accept the change. (I saw this same effect in another
MR so I think it's a fault in the baseline.)
Metric Decrease:
T5205
- - - - -
8b59e62c by Andreas Klebinger at 2026-01-16T17:18:52-05:00
testsuite: Widen acceptance window for T5205.
Fixes #26782
- - - - -
9e5e0234 by mangoiv at 2026-01-17T06:03:03-05:00
add a new issue template for getting verified
To reduce spam created by new users, we will in future not grant
any rights but reporting issues to new users. That is why we will
have to be able to verify them. The added issue template serves that
purpose.
- - - - -
b18b2c42 by Cheng Shao at 2026-01-17T06:03:44-05:00
llvm: fix split sections for llvm backend
This patch fixes split sections for llvm backend:
- Pass missing `--data-sections`/`--function-sections` flags to
llc/opt.
- Use `(a)llvm.compiler.used` instead of `(a)llvm.used` to avoid sections
being unnecessarily retained at link-time.
Fixes #26770.
-------------------------
Metric Decrease:
libdir
size_hello_artifact
size_hello_unicode
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
ebf66f67 by Cheng Shao at 2026-01-17T13:16:50-05:00
Update autoconf scripts
Scripts taken from autoconf a2287c3041a3f2a204eb942e09c015eab00dc7dd
- - - - -
598624b9 by Andreas Klebinger at 2026-01-17T13:17:32-05:00
CString.hs: Update incorrect comment.
Fixes #26322
- - - - -
eea2036b by Cheng Shao at 2026-01-18T10:00:49-05:00
libraries: bump haskeline submodule to 0.8.4.1
This patch bumps the haskeline submodule to 0.8.4.1 which includes an
important fix for an ANSI handling bug on Windows
(https://github.com/haskell/haskeline/pull/126)
- - - - -
87d8f6c2 by Cheng Shao at 2026-01-18T10:01:30-05:00
hadrian: replace default -H32m/-H64m with -O64M to improve mutator productivity
Most hadrian build flavours pass `-H32m`/`-H64m` to GHC as
conventional wisdom to improve mutator productivity and reduce GC
overhead. They were inherited from the legacy Make build system, and
there used to be make flags to instrument a build process with
`-Rghc-timing` option to collect GC stats of each GHC run from stderr.
It's time to revisit whether there are better defaults for
`-H32m`/`-H64m`, and this patch changes it to `-O64M` which indeed
improves mutator productivity based on real statistics. `-O64M` is
more aggressive than `-H64m`; it allows the old generation to grow to
at least 64M before triggering major GC and reduces major GC runs.
The stats of a clean build with `validate` flavour and `-H64m`:
```
h64m.log
matched RTS stat lines: 5499
sum MUT cpu : 2400.808 s
sum GC cpu : 1378.292 s
sum MUT elapsed : 2788.253 s
sum GC elapsed : 1389.233 s
GC/MUT cpu ratio : 0.574 (GC is 57.4% of MUT)
GC/MUT elapsed ratio : 0.498 (GC is 49.8% of MUT)
GC fraction of (MUT+GC) cpu : 36.5%
GC fraction of (MUT+GC) elapsed : 33.3%
per-line GC/MUT cpu ratio: median 0.691, p90 1.777
per-line GC/MUT elapsed ratio: median 0.519, p90 1.081
```
The stats of a clean build with `validate` flavour and `-O64M`:
```
o64m.log
matched RTS stat lines: 5499
sum MUT cpu : 2377.383 s
sum GC cpu : 1127.146 s
sum MUT elapsed : 2758.857 s
sum GC elapsed : 1135.587 s
GC/MUT cpu ratio : 0.474 (GC is 47.4% of MUT)
GC/MUT elapsed ratio : 0.412 (GC is 41.2% of MUT)
GC fraction of (MUT+GC) cpu : 32.2%
GC fraction of (MUT+GC) elapsed : 29.2%
per-line GC/MUT cpu ratio: median 0.489, p90 1.099
per-line GC/MUT elapsed ratio: median 0.367, p90 0.806
```
Mutator time is roughly in the same ballpark, but GC CPU time has
reduced by 18.22%, and mutator productivity has increased from 63.5%
to 67.8%.
- - - - -
8372e13d by Cheng Shao at 2026-01-18T10:02:12-05:00
rts: remove unused .def files from rts/win32
This patch removes unused .def files from `rts/win32`, given we don't
build .dll files for rts/ghc-internal/ghc-prim at all. Even when we
resurrect win32 dll support at some point in the future, these .def
files still contain incorrect symbols anyway and won't be of any use.
- - - - -
f6af485d by Cheng Shao at 2026-01-18T10:03:19-05:00
.gitmodules: use gitlab mirror for the libffi-clib submodule
This patch fixes .gitmodules to use the gitlab mirror for the
libffi-clib submodule, to make it coherent with other submodules that
allow ghc developers to experiment with wip branches in submodules for
ghc patches. Fixes #26783.
- - - - -
41432d25 by Cheng Shao at 2026-01-18T10:05:13-05:00
hadrian: remove the horrible i386 speedHack
When hadrian builds certain rts objects for i386, there's a horrible
speedHack that forces -fno-PIC even for dynamic ways of those objects.
This is not compatible with newer versions of gcc/binutils as well as
clang/lld, and this patch removes it. Fixes #26792.
- - - - -
323eb8f0 by Cheng Shao at 2026-01-18T21:48:19-05:00
hadrian: enable split sections for cross stage0
This patch fixes a minor issue with `splitSectionsArgs` in hadrian:
previously, it's unconditionally disabled for stage0 libraries because
it's not going to be shipped in the final bindists. But it's only true
when not cross compiling. So for now we also need to enable it for
cross stage0 as well.
- - - - -
3fadfefe by Andreas Klebinger at 2026-01-18T21:49:01-05:00
RTS: Document -K behaviour better
- - - - -
30f442a9 by Teo Camarasu at 2026-01-20T13:57:26-05:00
base: don't expose GHC.Num.{BigNat, Integer, Natural}
We no longer expose GHC.Num.{BigNat, Integer, Natural} from base instead users should get these modules from ghc-bignum.
We make this change to insulate end users from changes to GHC's implementation of big numbers.
Implements CLC proposal 359: https://github.com/haskell/core-libraries-committee/issues/359
- - - - -
75a9053d by Teo Camarasu at 2026-01-20T13:58:07-05:00
base: deprecate GHC internals in GHC.Num
Implements CLC proposal: https://github.com/haskell/core-libraries-committee/issues/360
- - - - -
9534b032 by Andreas Klebinger at 2026-01-20T13:58:50-05:00
ghc-experimental: Update Changelog
I tried to reconstruct a high level overview of the changes and when
they were made since we introduced it.
Fixes #26506
Co-authored-by: Teo Camarasu <teofilcamarasu(a)gmail.com>
- - - - -
346f2f5a by Cheng Shao at 2026-01-20T13:59:30-05:00
hadrian: remove RTS options in ghc-in-ghci flavour
This patch removes the RTS options passed to ghc in ghc-in-ghci
flavour, to workaround command line argument handling issue in
hls/hie-boot that results in `-O64M` instead of `+RTS -O64M -RTS`
being passed to ghc. It's not a hadrian bug per se, since ghc's own
ghc-in-ghci multi repl works fine, but we should still make sure HLS
works. Closes #26801.
- - - - -
759fd15a by Andreas Klebinger at 2026-01-21T16:05:28-05:00
Don't build GHC with -Wcompat
Without bumping the boot compiler the warnings it produces are often not
actionable leading to pointless noise.
Fixes #26800
- - - - -
3172db94 by Torsten Schmits at 2026-01-21T16:06:11-05:00
Use the correct field of ModOrigin when formatting error message listing hidden reexports
- - - - -
485c12b2 by Cheng Shao at 2026-01-21T16:06:54-05:00
Revert "hadrian: handle findExecutable "" gracefully"
This reverts commit 1e5752f64a522c4025365856d92f78073a7b3bba. The
underlying issue has been fixed in
https://github.com/haskell/directory/commit/75828696e7145adc09179111a0d631b…
and present since 1.3.9.0, and hadrian directory lower bound is
1.3.9.0, so we can revert our own in house hack now.
- - - - -
5efb58dc by Cheng Shao at 2026-01-21T16:07:36-05:00
rts: fix typo in TICK_ALLOC_RTS
This patch fixes a typo in the `TICK_ALLOC_RTS` macro, the original
`bytes` argument was silently dropped. The Cmm code has its own
version of `TICK_ALLOC_RTS` not affected by this typo, it affected the
C RTS, and went unnoticed because the variable `n` happened to also be
available at its call site. But the number was incorrect. Also fixes
its call site since `WDS()` is not available in C.
- - - - -
c406ea69 by Cheng Shao at 2026-01-21T16:07:36-05:00
rts: remove broken & unused ALLOC_P_TICKY
This patch removes the `ALLOC_P_TICKY` macro from the rts, it's
unused, and its expanded code is already broken.
- - - - -
34a27e20 by Simon Peyton Jones at 2026-01-21T16:08:17-05:00
Make the implicit-parameter class have representational role
This MR addresses #26737, by making the built-in class IP
have a representational role for its second parameter.
See Note [IP: implicit parameter class] in
ghc-internal:GHC.Internal.Classes.IP
In fact, IP is (unfortunately, currently) exposed by
base:GHC.Base, so we ran a quick CLC proposal to
agree the change:
https://github.com/haskell/core-libraries-committee/issues/385
Some (small) compilations get faster because they only need to
load (small) interface file GHC.Internal.Classes.IP.hi,
rather than (large) GHC.Internal.Classes.hi.
Metric Decrease:
T10421
T12150
T12425
T24582
T5837
T5030
- - - - -
ca79475f by Cheng Shao at 2026-01-21T16:09:00-05:00
testsuite: avoid re.sub in favor of simple string replacements
This patch refactors the testsuite driver and avoids the usage of
re.sub in favor of simple string replacements when possible. The
changes are not comprehensive, and there are still a lot of re.sub
usages lingering around the tree, but this already addresses a major
performance bottleneck in the testsuite driver that might has to do
with quadratic or worse slowdown in cpython's regular expression
engine when handling certain regex patterns with large strings.
Especially on i386, and i386 jobs are the bottlenecks of all full-ci
validate pipelines!
Here are the elapsed times of testing x86_64/i386 with -j48 before
this patch:
x86_64: `Build completed in 6m06s`
i386: `Build completed in 1h36m`
And with this patch:
x86_64: `Build completed in 4m55s`
i386: `Build completed in 4m23s`
Fixes #26786.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
88c93796 by Zubin Duggal at 2026-01-21T16:09:42-05:00
ghc-toolchain: Also configure windres on non-windows platforms.
It may be needed for cross compilation.
Fixes #24588
- - - - -
9788c0ec by Cheng Shao at 2026-01-21T16:10:24-05:00
ghci: print external interpreter trace messages to stderr instead of stdout
This patch makes ghci print external interpreter trace messages to
stderr instead of stdout, which is a much saner choice for diagnostic
information. Closes #26807.
- - - - -
0491f08a by Sylvain Henry at 2026-01-22T03:44:26-05:00
GC: don't use CAS without PARALLEL_GC on
If we're not using the parallel GC, there is no reason to do a costly
CAS. This was flagged as taking time in a perf profile.
- - - - -
211a8f56 by Sylvain Henry at 2026-01-22T03:44:26-05:00
GC: suffix parallel GC with "par" instead of "thr"
Avoid some potential confusion (see discussion in !15351).
- - - - -
77a23cbd by fendor at 2026-01-22T03:45:08-05:00
Remove blanket ignore that covers libraries/
- - - - -
18bf7f5c by Léana Jiang at 2026-01-22T08:58:45-05:00
doc: update Flavour type in hadrian user-settings
- - - - -
3d5a1365 by Cheng Shao at 2026-01-22T08:59:28-05:00
hadrian: add missing notCross predicate for stage0 -O0
There are a few hard-coded hadrian args that pass -O0 when compiling
some heavy modules in stage0, which only makes sense when not
cross-compiling and when cross-compiling we need properly optimized
stage0 packages. So this patch adds the missing `notCross` predicate
in those places.
- - - - -
ee937134 by Matthew Pickering at 2026-01-22T09:00:10-05:00
Fix ghc-experimental GHC.Exception.Backtrace.Experimental module
This module wasn't added to the cabal file so it was never compiled or
included in the library.
- - - - -
1b490f5a by Zubin Duggal at 2026-01-22T09:00:53-05:00
hadrian: Add ghc-{experimental,internal}.cabal to the list of dependencies of the doc target
We need these files to detect the version of these libraries
Fixes #26738
- - - - -
cdb74049 by Cheng Shao at 2026-01-22T14:52:36-05:00
rts: avoid Cmm loop to initialize Array#/SmallArray#
Previously, `newArray#`/`newSmallArray#` called an RTS C function to
allocate the `Array#`/`SmallArray#`, then used a Cmm loop to
initialize the elements. Cmm doesn't have native for-loop so the code
is a bit awkward, and it's less efficient than a C loop, since the C
compiler can effectively vectorize the loop with optimizations.
So this patch moves the loop that initializes the elements to the C
side. `allocateMutArrPtrs`/`allocateSmallMutArrPtrs` now takes a new
`init` argument and initializes the elements if `init` is non-NULL.
- - - - -
4c784f00 by Cheng Shao at 2026-01-22T14:53:19-05:00
Fix testsuite run for +ipe flavour transformer
This patch makes the +ipe flavour transformer pass the entire
testsuite:
- An RTS debug option `-DI` is added, the IPE trace information is now
only printed with `-DI`. The test cases that do require IPE trace
are now run with `-DI`.
- The testsuite config option `ghc_with_ipe` is added, enabled when
running the testsuite with `+ipe`, which skips a few tests that are
sensitive to eventlog output, allocation patterns etc that can fail
under `+ipe`.
This is the first step towards #26799.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
be8e5236 by Ben Gamari at 2026-01-23T03:28:45-05:00
hadrian: Bump QuickCheck upper bound
This patch bumps QuickCheck upper bound to 2.18. selftest rule
manually tested to work with current latest QuickCheck-2.17.1.0.
- - - - -
5aa328fb by Zubin Duggal at 2026-01-23T03:29:30-05:00
Add genindex to index.rst. This adds a link to the index in the navigation bar.
Fixes #26437
- - - - -
61cc7615 by Wolfgang Jeltsch at 2026-01-23T16:00:56+02:00
Add operations for obtaining operating-system handles
This contribution implements CLC proposal #369. It adds operations for
obtaining POSIX file descriptors and Windows handles that underlie
Haskell handles. Those operating system handles can also be obtained
without such additional operations, but this is more involved and, more
importantly, requires using internals.
- - - - -
602 changed files:
- .gitattributes
- .gitignore
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- + .gitlab/issue_templates/get-verified.md
- .gitlab/jobs.yaml
- .gitmodules
- CODEOWNERS
- cabal.project-reinstall
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/PrimOps/Ids.hs
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/Info.hs
- compiler/GHC/Cmm/InitFini.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/Config.hs
- compiler/GHC/CmmToAsm/LA64/Ppr.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/CmmToAsm/RV64/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Graph.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/Base.hs
- compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs
- compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs
- compiler/GHC/CmmToAsm/Reg/Liveness.hs
- + compiler/GHC/CmmToAsm/Reg/Regs.hs
- compiler/GHC/CmmToAsm/Reg/Target.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/CmmToLlvm/Data.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CSE.hs
- compiler/GHC/Core/Opt/CprAnal.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/Opt/Pipeline/Types.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/Ppr.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Subst.hs
- compiler/GHC/Core/Tidy.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Unfold.hs
- compiler/GHC/Core/Unfold/Make.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Config/CmmToAsm.hs
- compiler/GHC/Driver/Config/Core/Lint.hs
- compiler/GHC/Driver/Config/Core/Lint/Interactive.hs
- compiler/GHC/Driver/Config/Core/Opt/Simplify.hs
- compiler/GHC/Driver/Config/Interpreter.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/MakeFile.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/HsToCore/Foreign/JavaScript.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Iface/Warnings.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Linker/Dynamic.hs
- compiler/GHC/Linker/Executable.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Unit.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/String.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Interpreter/C.hs
- compiler/GHC/Runtime/Interpreter/Init.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/Stg/EnforceEpt.hs
- compiler/GHC/Stg/Lint.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/Expr.hs
- compiler/GHC/StgToCmm/InfoTableProv.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/StgToJS/Linker/Utils.hs
- compiler/GHC/SysTools/Terminal.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Hole/FitTypes.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/FunDeps.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Rewrite.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/CtLoc.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/ThToHs.hs
- + compiler/GHC/Types/Arity.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/DefaultEnv.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Id.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/GHC/Types/Id/Make.hs
- + compiler/GHC/Types/InlinePragma.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Types/TyThing.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Unique/Set.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Unit/Module/Warnings.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- + compiler/Language/Haskell/Syntax/Binds/InlinePragma.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/ghc.cabal.in
- config.guess
- config.sub
- configure.ac
- distrib/configure.ac.in
- − docs/Makefile
- − docs/storage-mgt/Makefile
- docs/users_guide/9.16.1-notes.rst
- − docs/users_guide/Makefile
- docs/users_guide/exts/pragmas.rst
- docs/users_guide/exts/table.rst
- docs/users_guide/ghci.rst
- docs/users_guide/index.rst
- docs/users_guide/packages.rst
- docs/users_guide/phases.rst
- docs/users_guide/runtime_control.rst
- docs/users_guide/using-concurrent.rst
- docs/users_guide/using.rst
- docs/users_guide/wasm.rst
- docs/users_guide/win32-dlls.rst
- − driver/Makefile
- − driver/ghc/Makefile
- − driver/ghci/Makefile
- driver/ghci/ghci.c
- − driver/haddock/Makefile
- driver/utils/cwrapper.c
- driver/utils/isMinTTY.c
- − driver/utils/merge_sections.ld
- − driver/utils/merge_sections_pe.ld
- ghc/Main.hs
- − ghc/Makefile
- hadrian/bindist/cwrappers/cwrapper.c
- hadrian/cabal.project
- hadrian/cfg/default.host.target.in
- hadrian/cfg/default.target.in
- hadrian/doc/flavours.md
- hadrian/doc/user-settings.md
- hadrian/hadrian.cabal
- hadrian/src/Base.hs
- hadrian/src/Builder.hs
- hadrian/src/Context.hs
- hadrian/src/Flavour.hs
- hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
- hadrian/src/Hadrian/Haskell/Cabal/Type.hs
- hadrian/src/Hadrian/Haskell/Hash.hs
- hadrian/src/Hadrian/Utilities.hs
- hadrian/src/Oracles/Flag.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Packages.hs
- hadrian/src/Rules.hs
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/CabalReinstall.hs
- hadrian/src/Rules/Docspec.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Gmp.hs
- − hadrian/src/Rules/Libffi.hs
- hadrian/src/Rules/Library.hs
- hadrian/src/Rules/Lint.hs
- hadrian/src/Rules/Program.hs
- hadrian/src/Rules/Register.hs
- hadrian/src/Rules/Rts.hs
- hadrian/src/Rules/SourceDist.hs
- hadrian/src/Rules/Test.hs
- hadrian/src/Settings/Builders/Cabal.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Builders/Hsc2Hs.hs
- − hadrian/src/Settings/Builders/MergeObjects.hs
- hadrian/src/Settings/Builders/RunTest.hs
- hadrian/src/Settings/Builders/SplitSections.hs
- hadrian/src/Settings/Default.hs
- hadrian/src/Settings/Flavours/Benchmark.hs
- hadrian/src/Settings/Flavours/Development.hs
- hadrian/src/Settings/Flavours/GhcInGhci.hs
- hadrian/src/Settings/Flavours/Performance.hs
- hadrian/src/Settings/Flavours/Quick.hs
- hadrian/src/Settings/Flavours/QuickCross.hs
- hadrian/src/Settings/Flavours/Quickest.hs
- hadrian/src/Settings/Flavours/Validate.hs
- hadrian/src/Settings/Packages.hs
- hadrian/src/Settings/Program.hs
- − libffi-tarballs
- − libraries/Makefile
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Data/Array/Byte.hs
- libraries/base/src/Data/Bifoldable1.hs
- libraries/base/src/GHC/Conc.hs
- libraries/base/src/GHC/Conc/Sync.hs
- − libraries/base/src/GHC/JS/Prim/Internal/Build.hs
- libraries/base/src/GHC/Num.hs
- − libraries/base/src/GHC/Num/BigNat.hs
- − libraries/base/src/GHC/Num/Integer.hs
- − libraries/base/src/GHC/Num/Natural.hs
- libraries/base/src/System/CPUTime/Utils.hs
- libraries/base/src/System/IO.hs
- + libraries/base/src/System/IO/OS.hs
- libraries/base/tests/IO/T12010/cbits/initWinSock.c
- libraries/base/tests/IO/all.T
- + libraries/base/tests/IO/osHandles001FileDescriptors.hs
- + libraries/base/tests/IO/osHandles001FileDescriptors.stdout
- + libraries/base/tests/IO/osHandles001WindowsHandles.hs
- + libraries/base/tests/IO/osHandles001WindowsHandles.stdout
- + libraries/base/tests/IO/osHandles002FileDescriptors.hs
- + libraries/base/tests/IO/osHandles002FileDescriptors.stderr
- + libraries/base/tests/IO/osHandles002FileDescriptors.stdin
- + libraries/base/tests/IO/osHandles002FileDescriptors.stdout
- + libraries/base/tests/IO/osHandles002WindowsHandles.hs
- + libraries/base/tests/IO/osHandles002WindowsHandles.stderr
- + libraries/base/tests/IO/osHandles002WindowsHandles.stdin
- + libraries/base/tests/IO/osHandles002WindowsHandles.stdout
- − libraries/doc/Makefile
- libraries/ghc-bignum/ghc-bignum.cabal
- libraries/ghc-boot/GHC/Unit/Database.hs
- libraries/ghc-compact/tests/all.T
- libraries/ghc-experimental/CHANGELOG.md
- libraries/ghc-experimental/ghc-experimental.cabal.in
- libraries/ghc-experimental/src/GHC/Exception/Backtrace/Experimental.hs
- libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs
- libraries/ghc-internal/cbits/consUtils.c
- libraries/ghc-internal/configure.ac
- libraries/ghc-internal/ghc-internal.buildinfo.in
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/include/HsIntegerGmp.h.in
- libraries/ghc-internal/src/GHC/Internal/CString.hs
- libraries/ghc-internal/src/GHC/Internal/Classes.hs
- + libraries/ghc-internal/src/GHC/Internal/Classes/IP.hs
- libraries/ghc-internal/src/GHC/Internal/Conc/IO.hs
- libraries/ghc-internal/src/GHC/Internal/Conc/POSIX.hs
- libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs
- libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs-boot
- libraries/ghc-internal/src/GHC/Internal/Conc/Windows.hs
- libraries/ghc-internal/src/GHC/Internal/ConsoleHandler.hsc
- libraries/ghc-internal/src/GHC/Internal/Control/Monad.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Thread.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows/Thread.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Context.hs
- libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle.hs
- + libraries/ghc-internal/src/GHC/Internal/STM.hs
- libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- + libraries/ghc-internal/src/GHC/Internal/System/IO/OS.hs
- libraries/ghc-internal/tests/backtraces/all.T
- libraries/ghc-platform/src/GHC/Platform/ArchOS.hs
- libraries/ghci/GHCi/Server.hs
- libraries/haskeline
- + libraries/libffi-clib
- libraries/mtl
- linters/lint-codes/LintCodes/Static.hs
- − linters/lint-codes/Makefile
- − linters/lint-notes/Makefile
- llvm-passes
- − m4/find_ghc_bootstrap_prog.m4
- − m4/fp_copy_shellvar.m4
- + m4/fp_linker_supports_verbatim.m4
- − m4/fp_prog_ld_flag.m4
- − m4/fp_prog_sort.m4
- m4/ghc_select_file_extensions.m4
- m4/prep_target_file.m4
- mk/system-cxx-std-lib-1.0.conf.in
- − mk/win32-tarballs.md5sum
- packages
- rts/AllocArray.c
- rts/AllocArray.h
- rts/Apply.cmm
- rts/ClosureTable.c
- rts/Compact.cmm
- rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/Heap.c
- rts/Jumps.h
- − rts/Makefile
- rts/PrimOps.cmm
- rts/RtsFlags.c
- rts/RtsMessages.c
- rts/StgMiscClosures.cmm
- rts/StgStartup.cmm
- rts/Threads.c
- rts/Trace.c
- rts/Weak.c
- rts/configure.ac
- rts/include/Cmm.h
- − rts/include/Makefile
- rts/include/Stg.h
- rts/include/rts/Flags.h
- rts/include/rts/Messages.h
- rts/include/rts/ghc_ffi.h
- rts/include/stg/Ticky.h
- rts/linker/InitFini.c
- rts/prim/mulIntMayOflo.c
- rts/rts.buildinfo.in
- rts/rts.cabal
- rts/sm/Evac.c
- rts/sm/Evac_thr.c → rts/sm/Evac_par.c
- rts/sm/Sanity.c
- rts/sm/Scav_thr.c → rts/sm/Scav_par.c
- rts/sm/Storage.c
- − rts/win32/libHSffi.def
- − rts/win32/libHSghc-internal.def
- − rts/win32/libHSghc-prim.def
- + testsuite/driver/_elffile.py
- testsuite/driver/perf_notes.py
- testsuite/driver/runtests.py
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/driver/testutil.py
- testsuite/ghc-config/ghc-config.hs
- testsuite/mk/test.mk
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/deriving/should_fail/T8984.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail5.stderr
- testsuite/tests/diagnostic-codes/codes.stdout
- + testsuite/tests/dmdanal/should_run/T26748.hs
- + testsuite/tests/dmdanal/should_run/T26748.stdout
- testsuite/tests/dmdanal/should_run/all.T
- − testsuite/tests/driver/T24731.hs
- testsuite/tests/driver/all.T
- + testsuite/tests/driver/fully-static/Hello.hs
- + testsuite/tests/driver/fully-static/Makefile
- + testsuite/tests/driver/fully-static/all.T
- + testsuite/tests/driver/fully-static/fully-static.stdout
- + testsuite/tests/driver/fully-static/test/Test.hs
- + testsuite/tests/driver/fully-static/test/test.pkg
- + testsuite/tests/driver/mostly-static/Hello.hs
- + testsuite/tests/driver/mostly-static/Makefile
- + testsuite/tests/driver/mostly-static/all.T
- + testsuite/tests/driver/mostly-static/mostly-static.stdout
- + testsuite/tests/driver/mostly-static/test/test.c
- + testsuite/tests/driver/mostly-static/test/test.h
- + testsuite/tests/driver/mostly-static/test/test.pkg
- + testsuite/tests/driver/recomp26183/M.hs
- + testsuite/tests/driver/recomp26183/M2A.hs
- + testsuite/tests/driver/recomp26183/M2B.hs
- + testsuite/tests/driver/recomp26183/Makefile
- + testsuite/tests/driver/recomp26183/all.T
- + testsuite/tests/driver/recomp26183/recomp26183.stderr
- + testsuite/tests/driver/recomp26705/M.hs
- + testsuite/tests/driver/recomp26705/M2A.hs
- + testsuite/tests/driver/recomp26705/M2B.hs
- + testsuite/tests/driver/recomp26705/Makefile
- + testsuite/tests/driver/recomp26705/all.T
- + testsuite/tests/driver/recomp26705/recomp26705.stderr
- testsuite/tests/ghci/scripts/T8353.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/indexed-types/should_compile/CEqCanOccursCheck.hs
- testsuite/tests/indexed-types/should_fail/T12522a.hs
- testsuite/tests/indexed-types/should_fail/T26176.stderr
- 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
- testsuite/tests/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- testsuite/tests/jsffi/all.T
- + testsuite/tests/jsffi/bytearrayarg.hs
- + testsuite/tests/jsffi/bytearrayarg.mjs
- + testsuite/tests/jsffi/bytearrayarg.stdout
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/numeric/should_run/foundation.hs
- testsuite/tests/numeric/should_run/foundation.stdout
- testsuite/tests/overloadedrecflds/should_fail/DRFHoleFits.stderr
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail10.stderr
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail13.stderr
- testsuite/tests/parser/should_fail/T20654a.stderr
- testsuite/tests/patsyn/should_fail/all.T
- + testsuite/tests/patsyn/should_fail/import-syntax-no-ext.hs
- + testsuite/tests/patsyn/should_fail/import-syntax-no-ext.stderr
- testsuite/tests/perf/compiler/hard_hole_fits.stderr
- testsuite/tests/perf/should_run/all.T
- testsuite/tests/plugins/test-hole-plugin.stderr
- testsuite/tests/pmcheck/should_compile/T15753c.hs
- + testsuite/tests/pmcheck/should_compile/T15753c.stderr
- testsuite/tests/pmcheck/should_compile/T15753d.hs
- + testsuite/tests/pmcheck/should_compile/T15753d.stderr
- + testsuite/tests/pmcheck/should_compile/T22652.hs
- + testsuite/tests/pmcheck/should_compile/T22652a.hs
- + testsuite/tests/pmcheck/should_compile/T24867.hs
- + testsuite/tests/pmcheck/should_compile/T24867.stderr
- testsuite/tests/pmcheck/should_compile/all.T
- + testsuite/tests/polykinds/T13882.hs
- testsuite/tests/polykinds/all.T
- testsuite/tests/quantified-constraints/T15316A.stderr
- testsuite/tests/quantified-constraints/T17267.stderr
- testsuite/tests/quantified-constraints/T17267a.stderr
- testsuite/tests/quantified-constraints/T17267b.stderr
- testsuite/tests/quantified-constraints/T17267c.stderr
- testsuite/tests/quantified-constraints/T17267e.stderr
- testsuite/tests/quantified-constraints/T17458.stderr
- + testsuite/tests/rename/should_compile/T25901_sub_e.hs
- + testsuite/tests/rename/should_compile/T25901_sub_f.hs
- + testsuite/tests/rename/should_compile/T25901_sub_f.stderr
- + testsuite/tests/rename/should_compile/T25901_sub_g.hs
- + testsuite/tests/rename/should_compile/T25901_sub_g.stderr
- + testsuite/tests/rename/should_compile/T25901_sub_g_helper.hs
- testsuite/tests/rename/should_compile/all.T
- testsuite/tests/rename/should_fail/T23570b.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_a.hs
- + testsuite/tests/rename/should_fail/T25901_sub_a.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_b.hs
- + testsuite/tests/rename/should_fail/T25901_sub_b.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_c.hs
- + testsuite/tests/rename/should_fail/T25901_sub_c.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_c_helper.hs
- + testsuite/tests/rename/should_fail/T25901_sub_d.hs
- + testsuite/tests/rename/should_fail/T25901_sub_d.stderr
- + testsuite/tests/rename/should_fail/T25901_sub_d_helper.hs
- + testsuite/tests/rename/should_fail/T25901_sub_w.hs
- + testsuite/tests/rename/should_fail/T25901_sub_w.stderr
- testsuite/tests/rename/should_fail/all.T
- testsuite/tests/rts/Makefile
- testsuite/tests/rts/all.T
- testsuite/tests/rts/ipe/all.T
- testsuite/tests/rts/linker/rdynamic.hs
- + testsuite/tests/simd/should_run/T26411.hs
- + testsuite/tests/simd/should_run/T26411.stdout
- + testsuite/tests/simd/should_run/T26411b.hs
- + testsuite/tests/simd/should_run/T26411b.stdout
- testsuite/tests/simd/should_run/all.T
- testsuite/tests/simplCore/should_compile/T14003.stderr
- testsuite/tests/simplCore/should_compile/T18013.stderr
- testsuite/tests/simplCore/should_compile/T19672.stderr
- testsuite/tests/simplCore/should_compile/T21763.stderr
- testsuite/tests/simplCore/should_compile/T21763a.stderr
- + testsuite/tests/simplCore/should_compile/T26615.hs
- + testsuite/tests/simplCore/should_compile/T26615.stderr
- + testsuite/tests/simplCore/should_compile/T26615a.hs
- + testsuite/tests/simplCore/should_compile/T26681.hs
- + testsuite/tests/simplCore/should_compile/T26682.hs
- + testsuite/tests/simplCore/should_compile/T26682a.hs
- + testsuite/tests/simplCore/should_compile/T26709.hs
- + testsuite/tests/simplCore/should_compile/T26709.stderr
- + testsuite/tests/simplCore/should_compile/T26722.hs
- + testsuite/tests/simplCore/should_compile/T26722.stderr
- testsuite/tests/simplCore/should_compile/T4908.stderr
- testsuite/tests/simplCore/should_compile/all.T
- testsuite/tests/simplCore/should_compile/spec-inline.stderr
- testsuite/tests/simplStg/should_compile/all.T
- testsuite/tests/th/T15321.stderr
- testsuite/tests/th/TH_implicitParams.stdout
- testsuite/tests/typecheck/should_compile/T13050.stderr
- testsuite/tests/typecheck/should_compile/T14273.stderr
- testsuite/tests/typecheck/should_compile/T14590.stderr
- testsuite/tests/typecheck/should_compile/T16188.hs
- testsuite/tests/typecheck/should_compile/T25180.stderr
- + testsuite/tests/typecheck/should_compile/T26737.hs
- + testsuite/tests/typecheck/should_compile/T26746.hs
- testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/hole_constraints.stderr
- testsuite/tests/typecheck/should_compile/holes.stderr
- testsuite/tests/typecheck/should_compile/holes2.stderr
- testsuite/tests/typecheck/should_compile/holes3.stderr
- testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/type_in_type_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
- testsuite/tests/typecheck/should_compile/valid_hole_fits_interactions.stderr
- testsuite/tests/typecheck/should_fail/ContextStack1.stderr
- testsuite/tests/typecheck/should_fail/FD3.stderr
- testsuite/tests/typecheck/should_fail/FDsFromGivens2.stderr
- testsuite/tests/typecheck/should_fail/FunDepOrigin1b.stderr
- testsuite/tests/typecheck/should_fail/T13506.stderr
- testsuite/tests/typecheck/should_fail/T14884.stderr
- testsuite/tests/typecheck/should_fail/T15767.stderr
- testsuite/tests/typecheck/should_fail/T15801.stderr
- testsuite/tests/typecheck/should_fail/T19415.stderr
- testsuite/tests/typecheck/should_fail/T19415b.stderr
- testsuite/tests/typecheck/should_fail/T22924b.stderr
- + testsuite/tests/typecheck/should_fail/T23162b.hs
- + testsuite/tests/typecheck/should_fail/T23162b.stderr
- + testsuite/tests/typecheck/should_fail/T23162c.hs
- + testsuite/tests/typecheck/should_fail/T23162d.hs
- testsuite/tests/typecheck/should_fail/T25325.stderr
- testsuite/tests/typecheck/should_fail/T5236.stderr
- testsuite/tests/typecheck/should_fail/T5246.stderr
- testsuite/tests/typecheck/should_fail/T5978.stderr
- testsuite/tests/typecheck/should_fail/T9612.stderr
- testsuite/tests/typecheck/should_fail/TcCoercibleFail.hs
- testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_fail/tcfail143.stderr
- testsuite/tests/warnings/should_compile/DodgyExports03.stderr
- testsuite/tests/warnings/should_compile/DodgyImports.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports02.hs
- + testsuite/tests/warnings/should_compile/DodgyImports02.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports03.hs
- + testsuite/tests/warnings/should_compile/DodgyImports03.stderr
- + testsuite/tests/warnings/should_compile/DodgyImports03_helper.hs
- + testsuite/tests/warnings/should_compile/DodgyImports04.hs
- + testsuite/tests/warnings/should_compile/DodgyImports04.stderr
- testsuite/tests/warnings/should_compile/DodgyImports_hiding.stderr
- testsuite/tests/warnings/should_compile/all.T
- utils/check-exact/ExactPrint.hs
- utils/deriveConstants/Main.hs
- utils/genapply/Main.hs
- utils/ghc-pkg/Main.hs
- utils/ghc-toolchain/exe/Main.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Link.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- − utils/iserv/cbits/iservmain.c
- − utils/iserv/iserv.cabal.in
- − utils/iserv/src/Main.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/454b5730939635739f1d5a82b6288e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/454b5730939635739f1d5a82b6288e…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/andreask/ticked_joins] Allow join point Ids to occur below ticks & casts
by sheaf (@sheaf) 23 Jan '26
by sheaf (@sheaf) 23 Jan '26
23 Jan '26
sheaf pushed to branch wip/andreask/ticked_joins at Glasgow Haskell Compiler / GHC
Commits:
871a1207 by sheaf at 2026-01-23T13:36:01+01:00
Allow join point Ids to occur below ticks & casts
This commit classifies all join points into two categories:
- true join points
- quasi join points
A quasi join point is a join point in which one of the binders occurs
under more profiling ticks or casts than its binding site.
The only operational difference is that, for quasi join points, we
cannot perform the case-of-case transformation described in
Note [Join points and case-of-case] in GHC.Core.Opt.Simplify.Iteration.
All of this is explained in detail in Note [Quasi join points].
Fixes #26693 and #26642
Improves on #26157 and #26422, but doesn't entirely fix them because
in an ideal world casts & profiling ticks should not inhibit optimisations.
-------------------------
Metric Increase:
T21839c
T9961
-------------------------
- - - - -
13 changed files:
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Tickish.hs
- testsuite/tests/profiling/should_run/T2552.prof.sample
- testsuite/tests/profiling/should_run/ioprof.prof.sample
- testsuite/tests/profiling/should_run/scc001.prof.sample
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/871a1207c6f677988562b3df232bd3b…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/871a1207c6f677988562b3df232bd3b…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T25262] Use template-haskell-lift/quasiquoter in boot libraries
by Teo Camarasu (@teo) 23 Jan '26
by Teo Camarasu (@teo) 23 Jan '26
23 Jan '26
Teo Camarasu pushed to branch wip/T25262 at Glasgow Haskell Compiler / GHC
Commits:
e11d23eb by Teo Camarasu at 2026-01-23T12:34:26+00:00
Use template-haskell-lift/quasiquoter in boot libraries
- - - - -
19 changed files:
- compiler/ghc.cabal.in
- ghc/ghc-bin.cabal.in
- hadrian/hadrian.cabal
- libraries/Cabal
- libraries/bytestring
- libraries/containers
- libraries/exceptions
- libraries/filepath
- libraries/ghc-boot/ghc-boot.cabal.in
- libraries/ghc-compact/ghc-compact.cabal
- libraries/ghc-internal/tools/ucd2haskell/ucd2haskell.cabal
- libraries/ghci/ghci.cabal.in
- libraries/haskeline
- libraries/os-string
- libraries/parsec
- libraries/text
- libraries/time
- libraries/unix
- utils/iserv/iserv.cabal.in
Changes:
=====================================
compiler/ghc.cabal.in
=====================================
@@ -118,7 +118,7 @@ Library
deepseq >= 1.4 && < 1.6,
directory >= 1 && < 1.4,
process >= 1 && < 1.7,
- bytestring >= 0.11 && < 0.13,
+ bytestring >= 0.11 && < 0.14,
binary == 0.8.*,
time >= 1.4 && < 1.16,
containers >= 0.6.2.1 && < 0.9,
=====================================
ghc/ghc-bin.cabal.in
=====================================
@@ -36,7 +36,7 @@ Executable ghc
GHC.Driver.Session.Mode
Build-Depends: base >= 4 && < 5,
array >= 0.1 && < 0.6,
- bytestring >= 0.9 && < 0.13,
+ bytestring >= 0.9 && < 0.14,
directory >= 1 && < 1.4,
process >= 1 && < 1.7,
filepath >= 1.5 && < 1.6,
=====================================
hadrian/hadrian.cabal
=====================================
@@ -155,7 +155,7 @@ executable hadrian
, TypeFamilies
build-depends: Cabal >= 3.13 && < 3.17
, base >= 4.11 && < 5
- , bytestring >= 0.10 && < 0.13
+ , bytestring >= 0.10 && < 0.14
, containers >= 0.5 && < 0.9
-- N.B. directory >=1.3.9 as earlier versions are
-- afflicted by #24382.
=====================================
libraries/Cabal
=====================================
@@ -1 +1 @@
-Subproject commit d9b0904b49dc84e0bfc79062daf2bbdf9d22a422
+Subproject commit bf964ddcc8e9c3c0a3ae46ab88c020046ac5e402
=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit d984ad00644c0157bad04900434b9d36f23633c5
+Subproject commit 754b7a7741f050eb42706b8bbddbf21184a0f7d5
=====================================
libraries/containers
=====================================
@@ -1 +1 @@
-Subproject commit 801b06e5d4392b028e519d5ca116a2881d559721
+Subproject commit 8147f030783c23936f1e974f56e1b9b3993724f3
=====================================
libraries/exceptions
=====================================
@@ -1 +1 @@
-Subproject commit b6c4290124eb1138358bf04ad9f33e67f6c5c1d8
+Subproject commit 6268676cddc3dfc164896bcb981054fe49d6ba91
=====================================
libraries/filepath
=====================================
@@ -1 +1 @@
-Subproject commit cbcd0ccf92f47e6c10fb9cc513a7b26facfc19fe
+Subproject commit 14fb430d8c33948598226af83c120e02bb36ce32
=====================================
libraries/ghc-boot/ghc-boot.cabal.in
=====================================
@@ -77,7 +77,7 @@ Library
build-depends: base >= 4.7 && < 4.23,
binary == 0.8.*,
- bytestring >= 0.10 && < 0.13,
+ bytestring >= 0.10 && < 0.14,
containers >= 0.5 && < 0.9,
directory >= 1.2 && < 1.4,
filepath >= 1.3 && < 1.6,
=====================================
libraries/ghc-compact/ghc-compact.cabal
=====================================
@@ -40,7 +40,7 @@ library
CPP
build-depends: base >= 4.9.0 && < 4.23,
- bytestring >= 0.10.6.0 && <0.13
+ bytestring >= 0.10.6.0 && <0.14
ghc-options: -Wall
exposed-modules: GHC.Compact
=====================================
libraries/ghc-internal/tools/ucd2haskell/ucd2haskell.cabal
=====================================
@@ -53,7 +53,7 @@ executable ucd2haskell
Generator.WordEncoding
build-depends:
base >= 4.7 && < 5
- , bytestring >= 0.11 && < 0.13
+ , bytestring >= 0.11 && < 0.14
, directory >= 1.3.6 && < 1.4
, filepath >= 1.4.2 && < 1.6
, getopt-generics >= 0.13 && < 0.14
=====================================
libraries/ghci/ghci.cabal.in
=====================================
@@ -89,7 +89,7 @@ library
ghc-internal >= 9.1001.0 && <=@ProjectVersionForLib@.0,
ghc-prim >= 0.5.0 && < 0.14,
binary == 0.8.*,
- bytestring >= 0.10 && < 0.13,
+ bytestring >= 0.10 && < 0.14,
containers >= 0.5 && < 0.9,
deepseq >= 1.4 && < 1.6,
filepath >= 1.4 && < 1.6,
=====================================
libraries/haskeline
=====================================
@@ -1 +1 @@
-Subproject commit 991953cd5d3bb9e8057de4a0d8f2cae3455865d8
+Subproject commit c61650dc4cbbb4b7f5c8f96ccb23bb48dc5f580f
=====================================
libraries/os-string
=====================================
@@ -1 +1 @@
-Subproject commit 2e693aad07540173a0169971b27c9acac28eeff1
+Subproject commit cf53b19b2d5933b53d77abada1f08a88c455a8b7
=====================================
libraries/parsec
=====================================
@@ -1 +1 @@
-Subproject commit 552730e23e1fd2dae46a60d75138b8d173492462
+Subproject commit cbd35433d33a05676266d516e612b0aa31d5a5bc
=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit 5f343f668f421bfb30cead594e52d0ac6206ff67
+Subproject commit a1fd01da2bc44b255b3dd11f5a9cf098c388d6a1
=====================================
libraries/time
=====================================
@@ -1 +1 @@
-Subproject commit 507f50844802f1469ba6cadfeefd4e3fecee0416
+Subproject commit a6cb12065d8f52d6d3ef014ae580eb3a6ad82f09
=====================================
libraries/unix
=====================================
@@ -1 +1 @@
-Subproject commit c9b3e95b5c15b118e55522bd92963038c6a88160
+Subproject commit 2076de9eabaeeca54e6e5715f26798248abaf67d
=====================================
utils/iserv/iserv.cabal.in
=====================================
@@ -33,7 +33,7 @@ Executable iserv
Build-Depends: array >= 0.5 && < 0.6,
base >= 4 && < 5,
binary >= 0.7 && < 0.11,
- bytestring >= 0.10 && < 0.13,
+ bytestring >= 0.10 && < 0.14,
containers >= 0.5 && < 0.9,
deepseq >= 1.4 && < 1.6,
ghci == @ProjectVersionMunged@
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e11d23eb332209f0eaece746bbd6871…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e11d23eb332209f0eaece746bbd6871…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/torsten.schmits/mercury-mhu-transitive-th-deps] 18 commits: compiler: implement --show-iface-abi-hash major mode
by Torsten Schmits (@torsten.schmits) 23 Jan '26
by Torsten Schmits (@torsten.schmits) 23 Jan '26
23 Jan '26
Torsten Schmits pushed to branch wip/torsten.schmits/mercury-mhu-transitive-th-deps at Glasgow Haskell Compiler / GHC
Commits:
012af357 by Cheng Shao at 2024-12-09T09:46:45-08:00
compiler: implement --show-iface-abi-hash major mode
- - - - -
0f665588 by Cheng Shao at 2024-12-09T09:46:45-08:00
Oneshot bytecode linking
- - - - -
a54376cf by Torsten Schmits at 2024-12-09T09:46:45-08:00
Package deps bytecode linking
- - - - -
44c8c978 by Ian-Woo Kim at 2024-12-09T09:46:45-08:00
set extra_decls = Nothing in interpreter after interface generation
- - - - -
d695ed07 by Ian-Woo Kim at 2024-12-09T09:46:45-08:00
No in-memory resident mi_extra_decls in compilation.
They are transiently loaded and removed after byte-code generation.
- - - - -
27a4a8bc by Ben Gamari at 2024-12-09T10:20:35-08:00
rts: Tighten up invariants of PACK
- - - - -
0756f0b5 by Ben Gamari at 2024-12-09T10:20:40-08:00
StgToByteCode: Don't assume that data con workers are nullary
Previously StgToByteCode assumed that all data-con workers were of a
nullary representation. This is not a valid assumption, as seen
in #23210, where an unsaturated application of a unary data
constructor's worker resulted in invalid bytecode. Sadly, I have not yet
been able to reduce a minimal testcase for this.
Fixes #23210.
- - - - -
b335f856 by Cheng Shao at 2024-12-10T10:52:14-08:00
driver: fix hpc undefined symbol issue in TH with -fprefer-byte-code
This commit fixes an undefined symbol error in RTS linker when
attempting to compile home modules with -fhpc and
-fbyte-code-and-object-code/-fprefer-byte-code, see #25510 for
detailed description and analysis of the bug.
Also adds T25510/T25510c regression tests to test make mode/oneshot
mode of the bug.
backported to GHC 9.10.
- - - - -
2261e59e by Rebecca Turner at 2024-12-10T13:55:31-08:00
ghc-internal: No trailing whitespace in exceptions
This is a backport of the *behavior* in
https://gitlab.haskell.org/ghc/ghc/-/commit/bfe600f5bb3ecd2c8fa71c536c63d3c…
The commit upstream depends on a bunch of other changes to the exception
reporting infrastructure, so I've chosen to recreate its behavior here
rather than pulling in all the dependent patches.
This fixes a regression where GHC 9.10.1 adds a trailing newline to the
`displayException` implementation for `SomeException`. This has been
reverted in `master` but 9.10.2 isn't out yet and there's various
changes the upstream commit depends on, so this is a simple one-line
fix.
See: https://gitlab.haskell.org/ghc/ghc/-/issues/25052
- - - - -
68f4225c by Ian-Woo Kim at 2024-12-11T14:49:55-08:00
disabled stub dynamic object generation for one-shot byte-code linking.
- - - - -
97da9d9e by Torsten Schmits at 2024-12-25T08:52:35-08:00
refactor quadratic search in warnMissingHomeModules
- - - - -
ba330bbd by Rodrigo Mesquita at 2024-12-25T09:49:02-08:00
Improve reachability queries on ModuleGraph
Introduces `ReachabilityIndex`, an index constructed from a
`GHC.Data.Graph.Directed` `Graph` that supports fast reachability
queries (in $O(1)$). This abstract data structure is exposed from
`GHC.Data.Graph.Directed.Reachability`.
This index is constructed from the module graph nodes and cached in
`ModuleGraph`, enabling efficient reachability queries on the module
graph. Previously, we'd construct a Map of Set of ModuleGraph nodes
which used a lot of memory (`O(n^2)` in the number of nodes) and cache
that in the `ModuleGraph`. By using the reachability index we get rid of
this space leak in the module graph -- even though the index is still
quadratic in the number of modules, it is much, much more space
efficient due to its representation using an IntMap of IntSet as opposed
to the transitive closure we previously cached.
In a memory profile of MultiLayerModules with 100x100 modules, memory
usage improved from 6GB residency to 2.8GB, out of which roughly 1.8GB
are caused by a second space leak related to ModuleGraph. On the same
program, it brings compile time from 7.5s to 5.5s.
Note how we simplify `checkHomeUnitsClosed` in terms of
`isReachableMany` and by avoiding constructing a second graph with the
full transitive closure -- it suffices to answer the reachability query
on the full graph without collapsing the transitive closure completely
into nodes.
Unfortunately, solving this leak means we have to do a little bit more
work since we can no longer cache the result of turning vertex indices
into nodes. This results in a slight regression in MultiLayerModulesTH_Make,
but results in large performance and memory wins when compiling large
amounts of modules.
-------------------------
Metric Decrease:
mhu-perf
Metric Increase:
MultiLayerModulesTH_Make
-------------------------
- - - - -
53ecc06c by Ian-Woo Kim at 2024-12-25T16:45:39-08:00
dummy flag -fpackage-db-byte-code
- - - - -
3573c6fe by Ian-Woo Kim at 2025-01-08T06:58:32-08:00
similarize the parallel downsweep to GHC HEAD version.
- - - - -
9da11f8f by Matthew Pickering at 2025-01-08T08:29:47-08:00
Use deterministic names for temporary files
When there are multiple threads they can race to create a temporary
file, in some situations the thread will create ghc_1.c and in some it
will create ghc_2.c. This filename ends up in the debug info for object
files after compiling a C file, therefore contributes to object
nondeterminism.
In order to fix this we store a prefix in `TmpFs` which serves to
namespace temporary files. The prefix is populated from the counter in
TmpFs when the TmpFs is forked. Therefore the TmpFs must be forked
outside the thread which consumes it, in a deterministic order, so each
thread always receives a TmpFs with the same prefix.
This assumes that after the initial TmpFs is created, all other TmpFs
are created from forking the original TmpFs. Which should have been try
anyway as otherwise there would be file collisions and non-determinism.
Fixes #25224
- - - - -
3a484a7b by Ian-Woo Kim at 2025-01-08T14:47:34-08:00
monotonic FinderCache. missed part from parallel downsweep latest GHC HEAD patch
- - - - -
2c4d9f61 by Andreas Klebinger at 2025-02-28T15:04:43-08:00
SpecConstr: Introduce a separate argument limit for forced specs.
We used to put no limit at all on specializations forced via the SPEC
argument. This isn't always reasonable so we introduce a very high limit
that applies to forced specializations, a flag to control it, and we now
emit a warning if we fail a specialization because we exceed the
warning.
Fixes #25197
- - - - -
1c80ba27 by Torsten Schmits at 2025-10-30T17:58:26+01:00
Load TH deps from home unit states of the modules that import them
- - - - -
62 changed files:
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Data/Graph/Directed.hs
- + compiler/GHC/Data/Graph/Directed/Internal.hs
- + compiler/GHC/Data/Graph/Directed/Reachability.hs
- compiler/GHC/Driver/Config/StgToCmm.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Hooks.hs
- compiler/GHC/Driver/Main.hs
- + compiler/GHC/Driver/Main.hs-boot
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore/Coverage.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Linker/Deps.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Types.hs
- compiler/GHC/Stg/Utils.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/Config.hs
- compiler/GHC/StgToCmm/Hpc.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/ModGuts.hs
- compiler/GHC/Unit/Module/ModIface.hs
- compiler/GHC/Utils/TmpFs.hs
- compiler/ghc.cabal.in
- docs/users_guide/expected-undocumented-flags.txt
- docs/users_guide/phases.rst
- docs/users_guide/using-optimisation.rst
- ghc/Main.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
- rts/Interpreter.c
- rts/include/rts/storage/InfoTables.h
- + testsuite/tests/bytecode/T24634/T24634.stdout
- + testsuite/tests/bytecode/T25510/Makefile
- + testsuite/tests/bytecode/T25510/T25510A.hs
- + testsuite/tests/bytecode/T25510/T25510B.hs
- + testsuite/tests/bytecode/T25510/all.T
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/th/cross-package/Cross.hs
- + testsuite/tests/th/cross-package/CrossDep.hs
- + testsuite/tests/th/cross-package/CrossDepApi.hs
- + testsuite/tests/th/cross-package/CrossLocal.hs
- + testsuite/tests/th/cross-package/CrossNum.hs
- + testsuite/tests/th/cross-package/CrossNum.hs-boot
- + testsuite/tests/th/cross-package/CrossObj.hs
- + testsuite/tests/th/cross-package/CrossPackage.stdout
- + testsuite/tests/th/cross-package/Makefile
- + testsuite/tests/th/cross-package/all.T
- + testsuite/tests/th/cross-package/dep.conf
- + testsuite/tests/th/cross-package/obj.conf
- + testsuite/tests/th/cross-package/prep.bash
- + testsuite/tests/th/cross-package/run.bash
- + testsuite/tests/th/cross-package/unit1
- + testsuite/tests/th/cross-package/unit2
- testsuite/tests/wasm/should_run/control-flow/LoadCmmGroup.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e5fb170e47efa851ad43659899feb1…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e5fb170e47efa851ad43659899feb1…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/andreask/ticked_joins] Allow join point Ids to occur below ticks & casts
by sheaf (@sheaf) 23 Jan '26
by sheaf (@sheaf) 23 Jan '26
23 Jan '26
sheaf pushed to branch wip/andreask/ticked_joins at Glasgow Haskell Compiler / GHC
Commits:
9173ba44 by sheaf at 2026-01-23T12:09:07+01:00
Allow join point Ids to occur below ticks & casts
This commit classifies all join points into two categories:
- true join points
- quasi join points
A quasi join point is a join point in which one of the binders occurs
under more profiling ticks or casts than its binding site.
The only operational difference is that, for quasi join points, we
cannot perform the case-of-case transformation described in
Note [Join points and case-of-case] in GHC.Core.Opt.Simplify.Iteration.
All of this is explained in detail in Note [Quasi join points].
Fixes #26693 and #26642
Improves on #26157 and #26422, but doesn't entirely fix them because
in an ideal world casts & profiling ticks should not inhibit optimisations.
-------------------------
Metric Increase:
T21839c
T9961
-------------------------
- - - - -
13 changed files:
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Tickish.hs
- testsuite/tests/profiling/should_run/T2552.prof.sample
- testsuite/tests/profiling/should_run/ioprof.prof.sample
- testsuite/tests/profiling/should_run/scc001.prof.sample
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9173ba440567dfc7795c22a8567ccbe…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9173ba440567dfc7795c22a8567ccbe…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26805] 25 commits: base: don't expose GHC.Num.{BigNat, Integer, Natural}
by Simon Peyton Jones (@simonpj) 23 Jan '26
by Simon Peyton Jones (@simonpj) 23 Jan '26
23 Jan '26
Simon Peyton Jones pushed to branch wip/26805 at Glasgow Haskell Compiler / GHC
Commits:
30f442a9 by Teo Camarasu at 2026-01-20T13:57:26-05:00
base: don't expose GHC.Num.{BigNat, Integer, Natural}
We no longer expose GHC.Num.{BigNat, Integer, Natural} from base instead users should get these modules from ghc-bignum.
We make this change to insulate end users from changes to GHC's implementation of big numbers.
Implements CLC proposal 359: https://github.com/haskell/core-libraries-committee/issues/359
- - - - -
75a9053d by Teo Camarasu at 2026-01-20T13:58:07-05:00
base: deprecate GHC internals in GHC.Num
Implements CLC proposal: https://github.com/haskell/core-libraries-committee/issues/360
- - - - -
9534b032 by Andreas Klebinger at 2026-01-20T13:58:50-05:00
ghc-experimental: Update Changelog
I tried to reconstruct a high level overview of the changes and when
they were made since we introduced it.
Fixes #26506
Co-authored-by: Teo Camarasu <teofilcamarasu(a)gmail.com>
- - - - -
346f2f5a by Cheng Shao at 2026-01-20T13:59:30-05:00
hadrian: remove RTS options in ghc-in-ghci flavour
This patch removes the RTS options passed to ghc in ghc-in-ghci
flavour, to workaround command line argument handling issue in
hls/hie-boot that results in `-O64M` instead of `+RTS -O64M -RTS`
being passed to ghc. It's not a hadrian bug per se, since ghc's own
ghc-in-ghci multi repl works fine, but we should still make sure HLS
works. Closes #26801.
- - - - -
759fd15a by Andreas Klebinger at 2026-01-21T16:05:28-05:00
Don't build GHC with -Wcompat
Without bumping the boot compiler the warnings it produces are often not
actionable leading to pointless noise.
Fixes #26800
- - - - -
3172db94 by Torsten Schmits at 2026-01-21T16:06:11-05:00
Use the correct field of ModOrigin when formatting error message listing hidden reexports
- - - - -
485c12b2 by Cheng Shao at 2026-01-21T16:06:54-05:00
Revert "hadrian: handle findExecutable "" gracefully"
This reverts commit 1e5752f64a522c4025365856d92f78073a7b3bba. The
underlying issue has been fixed in
https://github.com/haskell/directory/commit/75828696e7145adc09179111a0d631b…
and present since 1.3.9.0, and hadrian directory lower bound is
1.3.9.0, so we can revert our own in house hack now.
- - - - -
5efb58dc by Cheng Shao at 2026-01-21T16:07:36-05:00
rts: fix typo in TICK_ALLOC_RTS
This patch fixes a typo in the `TICK_ALLOC_RTS` macro, the original
`bytes` argument was silently dropped. The Cmm code has its own
version of `TICK_ALLOC_RTS` not affected by this typo, it affected the
C RTS, and went unnoticed because the variable `n` happened to also be
available at its call site. But the number was incorrect. Also fixes
its call site since `WDS()` is not available in C.
- - - - -
c406ea69 by Cheng Shao at 2026-01-21T16:07:36-05:00
rts: remove broken & unused ALLOC_P_TICKY
This patch removes the `ALLOC_P_TICKY` macro from the rts, it's
unused, and its expanded code is already broken.
- - - - -
34a27e20 by Simon Peyton Jones at 2026-01-21T16:08:17-05:00
Make the implicit-parameter class have representational role
This MR addresses #26737, by making the built-in class IP
have a representational role for its second parameter.
See Note [IP: implicit parameter class] in
ghc-internal:GHC.Internal.Classes.IP
In fact, IP is (unfortunately, currently) exposed by
base:GHC.Base, so we ran a quick CLC proposal to
agree the change:
https://github.com/haskell/core-libraries-committee/issues/385
Some (small) compilations get faster because they only need to
load (small) interface file GHC.Internal.Classes.IP.hi,
rather than (large) GHC.Internal.Classes.hi.
Metric Decrease:
T10421
T12150
T12425
T24582
T5837
T5030
- - - - -
ca79475f by Cheng Shao at 2026-01-21T16:09:00-05:00
testsuite: avoid re.sub in favor of simple string replacements
This patch refactors the testsuite driver and avoids the usage of
re.sub in favor of simple string replacements when possible. The
changes are not comprehensive, and there are still a lot of re.sub
usages lingering around the tree, but this already addresses a major
performance bottleneck in the testsuite driver that might has to do
with quadratic or worse slowdown in cpython's regular expression
engine when handling certain regex patterns with large strings.
Especially on i386, and i386 jobs are the bottlenecks of all full-ci
validate pipelines!
Here are the elapsed times of testing x86_64/i386 with -j48 before
this patch:
x86_64: `Build completed in 6m06s`
i386: `Build completed in 1h36m`
And with this patch:
x86_64: `Build completed in 4m55s`
i386: `Build completed in 4m23s`
Fixes #26786.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
88c93796 by Zubin Duggal at 2026-01-21T16:09:42-05:00
ghc-toolchain: Also configure windres on non-windows platforms.
It may be needed for cross compilation.
Fixes #24588
- - - - -
9788c0ec by Cheng Shao at 2026-01-21T16:10:24-05:00
ghci: print external interpreter trace messages to stderr instead of stdout
This patch makes ghci print external interpreter trace messages to
stderr instead of stdout, which is a much saner choice for diagnostic
information. Closes #26807.
- - - - -
0491f08a by Sylvain Henry at 2026-01-22T03:44:26-05:00
GC: don't use CAS without PARALLEL_GC on
If we're not using the parallel GC, there is no reason to do a costly
CAS. This was flagged as taking time in a perf profile.
- - - - -
211a8f56 by Sylvain Henry at 2026-01-22T03:44:26-05:00
GC: suffix parallel GC with "par" instead of "thr"
Avoid some potential confusion (see discussion in !15351).
- - - - -
77a23cbd by fendor at 2026-01-22T03:45:08-05:00
Remove blanket ignore that covers libraries/
- - - - -
18bf7f5c by Léana Jiang at 2026-01-22T08:58:45-05:00
doc: update Flavour type in hadrian user-settings
- - - - -
3d5a1365 by Cheng Shao at 2026-01-22T08:59:28-05:00
hadrian: add missing notCross predicate for stage0 -O0
There are a few hard-coded hadrian args that pass -O0 when compiling
some heavy modules in stage0, which only makes sense when not
cross-compiling and when cross-compiling we need properly optimized
stage0 packages. So this patch adds the missing `notCross` predicate
in those places.
- - - - -
ee937134 by Matthew Pickering at 2026-01-22T09:00:10-05:00
Fix ghc-experimental GHC.Exception.Backtrace.Experimental module
This module wasn't added to the cabal file so it was never compiled or
included in the library.
- - - - -
1b490f5a by Zubin Duggal at 2026-01-22T09:00:53-05:00
hadrian: Add ghc-{experimental,internal}.cabal to the list of dependencies of the doc target
We need these files to detect the version of these libraries
Fixes #26738
- - - - -
cdb74049 by Cheng Shao at 2026-01-22T14:52:36-05:00
rts: avoid Cmm loop to initialize Array#/SmallArray#
Previously, `newArray#`/`newSmallArray#` called an RTS C function to
allocate the `Array#`/`SmallArray#`, then used a Cmm loop to
initialize the elements. Cmm doesn't have native for-loop so the code
is a bit awkward, and it's less efficient than a C loop, since the C
compiler can effectively vectorize the loop with optimizations.
So this patch moves the loop that initializes the elements to the C
side. `allocateMutArrPtrs`/`allocateSmallMutArrPtrs` now takes a new
`init` argument and initializes the elements if `init` is non-NULL.
- - - - -
4c784f00 by Cheng Shao at 2026-01-22T14:53:19-05:00
Fix testsuite run for +ipe flavour transformer
This patch makes the +ipe flavour transformer pass the entire
testsuite:
- An RTS debug option `-DI` is added, the IPE trace information is now
only printed with `-DI`. The test cases that do require IPE trace
are now run with `-DI`.
- The testsuite config option `ghc_with_ipe` is added, enabled when
running the testsuite with `+ipe`, which skips a few tests that are
sensitive to eventlog output, allocation patterns etc that can fail
under `+ipe`.
This is the first step towards #26799.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
be8e5236 by Ben Gamari at 2026-01-23T03:28:45-05:00
hadrian: Bump QuickCheck upper bound
This patch bumps QuickCheck upper bound to 2.18. selftest rule
manually tested to work with current latest QuickCheck-2.17.1.0.
- - - - -
5aa328fb by Zubin Duggal at 2026-01-23T03:29:30-05:00
Add genindex to index.rst. This adds a link to the index in the navigation bar.
Fixes #26437
- - - - -
4d024887 by Simon Peyton Jones at 2026-01-23T10:32:26+00:00
Fix two bugs in short-cut constraint solving
There are two main changes here:
* Use `isSolvedWC` rather than `isEmptyWC` in `tryShortCutSolver`
The residual constraint may have some fully-solved, but
still-there implications, and we don't want them to abort short
cut solving! That bug caused #26805.
* In the short-cut solver, we abandon the fully-solved residual
constraint; but we may thereby lose track of Givens that are
needed, and either report them as redundant or prune evidence
bindings that are in fact needed.
This bug stopped the `constraints` package from compiling;
see the trail in !15389.
The second bug led me to (another) significant refactoring
of the mechanism for tracking needed EvIds. See the new
Note [Tracking needed EvIds] in GHC.Tc.Solver.Solve
It's simpler and much less head-scratchy now.
Some particulars:
* An EvBindsVar now tracks NeededEvIds
* We deal with NeededEvIds for an implication only when it is
fully solved. Much simpler!
* `tryShortCutTcS` now takes a `TcM WantedConstraints` rather than
`TcM Bool`, so that is can plumb the needed EvIds correctly.
* Remove `ic_need` and `ic_need_implic` from Implication (hooray),
and add `ics_dm` and `ics_non_dm` to `IC_Solved`.
Pure refactor
* Shorten data constructor `CoercionHole` to `CH`, following
general practice in GHC.
* Rename `EvBindMap` to `EvBindsMap` for consistency
- - - - -
99 changed files:
- .gitignore
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCo/Tidy.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Utils/Trace.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.16.1-notes.rst
- docs/users_guide/index.rst
- docs/users_guide/runtime_control.rst
- hadrian/doc/user-settings.md
- hadrian/hadrian.cabal
- hadrian/src/Flavour.hs
- hadrian/src/Hadrian/Utilities.hs
- hadrian/src/Rules/Docspec.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Lint.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Builders/RunTest.hs
- hadrian/src/Settings/Flavours/GhcInGhci.hs
- hadrian/src/Settings/Packages.hs
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Data/Array/Byte.hs
- libraries/base/src/GHC/Num.hs
- − libraries/base/src/GHC/Num/BigNat.hs
- − libraries/base/src/GHC/Num/Integer.hs
- − libraries/base/src/GHC/Num/Natural.hs
- libraries/base/src/System/CPUTime/Utils.hs
- libraries/ghc-bignum/ghc-bignum.cabal
- libraries/ghc-compact/tests/all.T
- libraries/ghc-experimental/CHANGELOG.md
- libraries/ghc-experimental/ghc-experimental.cabal.in
- libraries/ghc-experimental/src/GHC/Exception/Backtrace/Experimental.hs
- libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Classes.hs
- + libraries/ghc-internal/src/GHC/Internal/Classes/IP.hs
- libraries/ghc-internal/tests/backtraces/all.T
- libraries/ghci/GHCi/Server.hs
- rts/AllocArray.c
- rts/AllocArray.h
- rts/ClosureTable.c
- rts/Heap.c
- rts/PrimOps.cmm
- rts/RtsFlags.c
- rts/Threads.c
- rts/Trace.c
- rts/Weak.c
- rts/include/Cmm.h
- rts/include/rts/Flags.h
- rts/include/stg/Ticky.h
- rts/rts.cabal
- rts/sm/Evac.c
- rts/sm/Evac_thr.c → rts/sm/Evac_par.c
- rts/sm/Scav_thr.c → rts/sm/Scav_par.c
- rts/sm/Storage.c
- testsuite/driver/runtests.py
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/driver/testutil.py
- 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
- testsuite/tests/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- testsuite/tests/rts/Makefile
- testsuite/tests/rts/all.T
- testsuite/tests/rts/ipe/all.T
- + testsuite/tests/simplCore/should_compile/T26805.hs
- + testsuite/tests/simplCore/should_compile/T26805.stderr
- testsuite/tests/simplCore/should_compile/all.T
- testsuite/tests/th/TH_implicitParams.stdout
- + testsuite/tests/typecheck/should_compile/T26737.hs
- testsuite/tests/typecheck/should_compile/all.T
- utils/ghc-toolchain/exe/Main.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/596c213508daa7976fb39fdb60cf71…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/596c213508daa7976fb39fdb60cf71…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/andreask/ticked_joins] Allow join point Ids to occur below ticks & casts
by sheaf (@sheaf) 23 Jan '26
by sheaf (@sheaf) 23 Jan '26
23 Jan '26
sheaf pushed to branch wip/andreask/ticked_joins at Glasgow Haskell Compiler / GHC
Commits:
190bc495 by sheaf at 2026-01-23T10:41:45+01:00
Allow join point Ids to occur below ticks & casts
This commit classifies all join points into two categories:
- true join points
- quasi join points
A quasi join point is a join point in which one of the binders occurs
under more profiling ticks or casts than its binding site.
The only operational difference is that, for quasi join points, we
cannot perform the case-of-case transformation described in
Note [Join points and case-of-case] in GHC.Core.Opt.Simplify.Iteration.
All of this is explained in detail in Note [Quasi join points].
Fixes #26693 and #26642
Improves on #26157 and #26422, but doesn't entirely fix them because
in an ideal world casts & profiling ticks should not inhibit optimisations.
-------------------------
Metric Increase:
T21839c
T9961
-------------------------
- - - - -
10 changed files:
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Tickish.hs
Changes:
=====================================
compiler/GHC/Core/Lint.hs
=====================================
@@ -672,7 +672,7 @@ lintRhs :: Id -> CoreExpr -> LintM (OutType, UsageEnv)
lintRhs bndr rhs
| JoinPoint arity <- idJoinPointHood bndr
= lintJoinLams arity (Just bndr) rhs
- | AlwaysTailCalled arity <- tailCallInfo (idOccInfo bndr)
+ | AlwaysTailCalled { tailCallArity = arity } <- tailCallInfo (idOccInfo bndr)
= lintJoinLams arity Nothing rhs
-- Allow applications of the data constructor @StaticPtr@ at the top
@@ -929,9 +929,12 @@ lintCoreExpr (Tick tickish expr)
= do { case tickish of
Breakpoint _ _ ids -> forM_ ids $ \id -> lintIdOcc id 0
_ -> return ()
- ; markAllJoinsBadIf block_joins $ lintCoreExpr expr }
+ ; expr_l <- lintCoreExpr expr
+ ; r <- markAllJoinsBadIf block_joins $ pure expr_l
+ -- ; when block_joins
+ ; pure r}
where
- block_joins = not (tickish `tickishScopesLike` SoftScope)
+ block_joins = 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/Arity.hs
=====================================
@@ -90,7 +90,6 @@ import GHC.Utils.Misc
import Data.List.NonEmpty ( nonEmpty )
import qualified Data.List.NonEmpty as NE
-import Data.Maybe( isJust )
{-
************************************************************************
@@ -2835,22 +2834,6 @@ tryEtaReduce rec_ids bndrs body eval_sd
ok_arg _ _ _ _ = Nothing
--- | Can we eta-reduce the given function
--- See Note [Eta reduction soundness], criteria (B), (J), and (W).
-cantEtaReduceFun :: Id -> Bool
-cantEtaReduceFun fun
- = hasNoBinding fun -- (B)
- -- Don't undersaturate functions with no binding.
-
- || isJoinId fun -- (J)
- -- Don't undersaturate join points.
- -- See Note [Invariants on join points] in GHC.Core, and #20599
-
- || (isJust (idCbvMarks_maybe fun)) -- (W)
- -- Don't undersaturate StrictWorkerIds.
- -- See Note [CBV Function Ids: overview] in GHC.Types.Id.Info.
-
-
{- *********************************************************************
* *
The "push rules"
=====================================
compiler/GHC/Core/Opt/OccurAnal.hs
=====================================
@@ -797,10 +797,10 @@ function call and a jump by looking at the occurrence (because the same pass
changes the 'IdDetails' and propagates the binders to their occurrence sites).
To track potential join points, we use the 'occ_tail' field of OccInfo. A value
-of `AlwaysTailCalled n` indicates that every occurrence of the variable is a
-tail call with `n` arguments (counting both value and type arguments). Otherwise
-'occ_tail' will be 'NoTailCallInfo'. The tail call info flows bottom-up with the
-rest of 'OccInfo' until it goes on the binder.
+of `AlwaysTailCalled { tailCallArity = n }` indicates that every occurrence of
+the variable is a tail call with `n` arguments (counting both value and type
+arguments). Otherwise 'occ_tail' will be 'NoTailCallInfo'. The tail call info
+flows bottom-up with the rest of 'OccInfo' until it goes on the binder.
Note [Join arity prediction based on joinRhsArity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2585,13 +2585,21 @@ But it is not necessary to gather CoVars from the types of other binders.
occAnal env (Tick tickish body)
= WUD usage' (Tick tickish body')
where
- WUD usage body' = occAnal env body
+ WUD usage body' = occAnal env' body
+
+ env' = case tickish of
+ -- setInsideProfTick: join points under profiling ticks turn
+ -- into quasi-join points. See Note [Quasi join points]
+ ProfNote {} -> setInsideProfTick env
+ _ -> env
usage'
- | tickish `tickishScopesLike` SoftScope
+ | tickishCanScopeJoin tickish
= usage -- For soft-scoped ticks (including SourceNotes) we don't want
-- to lose join-point-hood, so we don't mess with `usage` (#24078)
+ -- Similarly for cost centres. (#26157)
+
-- For a non-soft tick scope, we can inline lambdas only, so we
-- abandon tail calls, and do markAllInsideLam too: usage_lam
@@ -2613,11 +2621,12 @@ occAnal env (Tick tickish body)
-- See #14242.
occAnal env (Cast expr co)
- = let (WUD usage expr') = occAnal env expr
- usage1 = addManyOccs usage (coVarsOfCo co)
- -- usage2: see Note [Gather occurrences of coercion variables]
- usage2 = markAllNonTail usage1
- -- usage3: calls inside expr aren't tail calls any more
+ = let (WUD usage expr') = occAnal (setInsideCast env) expr
+ -- setInsideCast: join points inside casts turn into quasi join points
+ -- See Note [Quasi join points]
+ usage1 = addManyOccs usage (coVarsOfCo co)
+ -- usage2: see Note [Gather occurrences of coercion variables]
+ usage2 = markAllNonTail usage1
in WUD usage2 (Cast expr' co)
occAnal env app@(App _ _)
@@ -2927,6 +2936,8 @@ scrutinised y).
data OccEnv
= OccEnv { occ_encl :: !OccEncl -- Enclosing context information
+ , occ_prof_ticks :: !Int -- ^ How many profiling ticks are we under? See Note [Quasi join points]
+ , occ_casts :: !Int -- ^ How many casts are we under? See Note [Quasi join points]
, occ_one_shots :: !OneShots -- See Note [OneShots]
, occ_unf_act :: Id -> Bool -- Which Id unfoldings are active
, occ_rule_act :: ActivationGhc -> Bool -- Which rules are active
@@ -2992,6 +3003,8 @@ type OneShots = [OneShotInfo]
initOccEnv :: OccEnv
initOccEnv
= OccEnv { occ_encl = OccVanilla
+ , occ_prof_ticks = 0
+ , occ_casts = 0
, occ_one_shots = []
-- To be conservative, we say that all
@@ -3070,6 +3083,12 @@ setTailCtxt !env = env { occ_encl = OccVanilla }
-- Preserve occ_one_shots, occ_join points
-- Do not use OccRhs for the RHS of a join point (which is a tail ctxt):
+setInsideProfTick :: OccEnv -> OccEnv
+setInsideProfTick !env = env { occ_prof_ticks = 1 + occ_prof_ticks env }
+
+setInsideCast :: OccEnv -> OccEnv
+setInsideCast !env = env { occ_casts = 1 + occ_casts env }
+
mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv
-- See Note [The OccEnv for a right hand side]
-- For a join point:
@@ -3696,7 +3715,7 @@ type OccInfoEnv = IdEnv LocalOcc -- A finite map from an expression's
data LocalOcc -- See Note [LocalOcc]
= OneOccL { lo_n_br :: {-# UNPACK #-} !BranchCount -- Number of syntactic occurrences
, lo_tail :: !TailCallInfo
- -- Combining (AlwaysTailCalled 2) and (AlwaysTailCalled 3)
+ -- NB: combining 'TailCallInfo's with different arities
-- gives NoTailCallInfo
, lo_int_cxt :: !InterestingCxt }
@@ -3789,9 +3808,20 @@ mkOneOcc !env id int_cxt arity
= mkSimpleDetails (unitVarEnv id occ)
where
- occ = OneOccL { lo_n_br = 1
- , lo_int_cxt = int_cxt
- , lo_tail = AlwaysTailCalled arity }
+ occ =
+ OneOccL
+ { lo_n_br = 1
+ , lo_int_cxt = int_cxt
+ , lo_tail =
+ AlwaysTailCalled
+ { tailCallArity = arity
+
+ -- See Note [Quasi join points] for justification of these
+ -- two fields.
+ , tailCallUnderProfTicks = occ_prof_ticks env
+ , tailCallUnderCasts = occ_casts env
+ }
+ }
-- Add several occurrences, assumed not to be tail calls
add_many_occ :: Var -> OccInfoEnv -> OccInfoEnv
@@ -3844,13 +3874,14 @@ delBndrsFromUDs bndrs (UD { ud_env = env, ud_z_many = z_many
, ud_z_tail = z_tail `delVarEnvList` bndrs }
markAllMany, markAllInsideLam, markAllNonTail, markAllManyNonTail
- :: UsageDetails -> UsageDetails
+ :: HasDebugCallStack => UsageDetails -> UsageDetails
markAllMany ud@(UD { ud_env = env }) = ud { ud_z_many = env }
markAllInsideLam ud@(UD { ud_env = env }) = ud { ud_z_in_lam = env }
-markAllNonTail ud@(UD { ud_env = env }) = ud { ud_z_tail = env }
markAllManyNonTail = markAllMany . markAllNonTail -- effectively sets to noOccInfo
-markAllInsideLamIf, markAllNonTailIf :: Bool -> UsageDetails -> UsageDetails
+markAllNonTail ud@(UD { ud_env = env }) = ud { ud_z_tail = env }
+
+markAllInsideLamIf, markAllNonTailIf :: HasDebugCallStack => Bool -> UsageDetails -> UsageDetails
markAllInsideLamIf True ud = markAllInsideLam ud
markAllInsideLamIf False ud = ud
@@ -3947,7 +3978,7 @@ adjustNonRecRhs mb_join_arity (WTUD (TUD rhs_ja uds) rhs)
where
exact_join = mb_join_arity == JoinPoint rhs_ja
-adjustTailUsage :: Bool -- True <=> Exactly-matching join point; don't do markNonTail
+adjustTailUsage :: HasDebugCallStack => Bool -- True <=> Exactly-matching join point; don't do markNonTail
-> CoreExpr -- Rhs usage, AFTER occAnalLamTail
-> UsageDetails
-> UsageDetails
@@ -3959,7 +3990,7 @@ adjustTailUsage exact_join rhs uds
where
one_shot = isOneShotFun rhs
-adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails
+adjustTailArity :: HasDebugCallStack => JoinPointHood -> TailUsageDetails -> UsageDetails
adjustTailArity mb_rhs_ja (TUD ja usage)
= markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage
@@ -3993,7 +4024,7 @@ tagNonRecBinder :: TopLevelFlag -- At top level?
-- Precondition: OccInfo is not IAmDead
tagNonRecBinder lvl occ bndr
| okForJoinPoint lvl bndr tail_call_info
- , AlwaysTailCalled ar <- tail_call_info
+ , AlwaysTailCalled { tailCallArity = ar } <- tail_call_info
= (setBinderOcc occ bndr, JoinPoint ar)
| otherwise
= (setBinderOcc zapped_occ bndr, NotJoinPoint)
@@ -4080,7 +4111,7 @@ okForJoinPoint lvl bndr tail_call_info
= False
where
valid_join | NotTopLevel <- lvl
- , AlwaysTailCalled arity <- tail_call_info
+ , AlwaysTailCalled { tailCallArity = arity } <- tail_call_info
, -- Invariant 1 as applied to LHSes of rules
all (ok_rule arity) (idCoreRules bndr)
@@ -4097,9 +4128,9 @@ okForJoinPoint lvl bndr tail_call_info
lost_join | JoinPoint ja <- idJoinPointHood bndr
= not valid_join ||
- (case tail_call_info of -- Valid join but arity differs
- AlwaysTailCalled ja' -> ja /= ja'
- _ -> False)
+ (case tail_call_info of -- Valid join but arity differs
+ AlwaysTailCalled { tailCallArity = ja' } -> ja /= ja'
+ _ -> False)
| otherwise = False
ok_rule _ BuiltinRule{} = False -- only possible with plugin shenanigans
@@ -4121,7 +4152,7 @@ okForJoinPoint lvl bndr tail_call_info
, text "tc:" <+> ppr tail_call_info
, text "rules:" <+> ppr (idCoreRules bndr)
, case tail_call_info of
- AlwaysTailCalled arity ->
+ AlwaysTailCalled { tailCallArity = arity } ->
vcat [ text "ok_unf:" <+> ppr (ok_unfolding arity (realIdUnfolding bndr))
, text "ok_type:" <+> ppr (isValidJoinPointType arity (idType bndr)) ]
_ -> empty ]
@@ -4184,6 +4215,6 @@ orLocalOcc (OneOccL { lo_n_br = nbr1, lo_int_cxt = int_cxt1, lo_tail = tci1 })
orLocalOcc occ1 occ2 = andLocalOcc occ1 occ2
andTailCallInfo :: TailCallInfo -> TailCallInfo -> TailCallInfo
-andTailCallInfo info@(AlwaysTailCalled arity1) (AlwaysTailCalled arity2)
- | arity1 == arity2 = info
+andTailCallInfo (AlwaysTailCalled arity1 p1 c1) (AlwaysTailCalled arity2 p2 c2)
+ | arity1 == arity2 = AlwaysTailCalled arity1 (max p1 p2) (max c1 c2)
andTailCallInfo _ _ = NoTailCallInfo
=====================================
compiler/GHC/Core/Opt/Simplify/Env.hs
=====================================
@@ -201,6 +201,9 @@ data SimplEnv
, seCaseDepth :: !Int -- Depth of multi-branch case alternatives
+ , seProfTicks :: !Int -- Current depth of profiling ticks; see Note [Quasi join points]
+ , seCasts :: !Int -- Current depth of casts; see Note [Quasi join points]
+
, seInlineDepth :: !Int -- 0 initially, 1 when we inline an already-simplified
-- unfolding, and simplify again; and so on
-- See Note [Inline depth]
@@ -590,6 +593,8 @@ mkSimplEnv mode fam_envs
, seIdSubst = emptyVarEnv
, seRecIds = emptyUnVarSet
, seCaseDepth = 0
+ , seProfTicks = 0
+ , seCasts = 0
, seInlineDepth = 0 }
-- The top level "enclosing CC" is "SUBSUMED".
=====================================
compiler/GHC/Core/Opt/Simplify/Iteration.hs
=====================================
@@ -39,7 +39,7 @@ import GHC.Core.Opt.Arity ( ArityType, exprArity, arityTypeBotSigs_maybe
, pushCoTyArg, pushCoValArg, exprIsDeadEnd
, typeArity, arityTypeArity, etaExpandAT )
import GHC.Core.SimpleOpt ( exprIsConApp_maybe, joinPointBinding_maybe, joinPointBindings_maybe )
-import GHC.Core.FVs ( mkRuleInfo {- exprsFreeIds -} )
+import GHC.Core.FVs ( mkRuleInfo )
import GHC.Core.Rules ( lookupRule, getRules )
import GHC.Core.Multiplicity
@@ -57,6 +57,7 @@ import GHC.Types.Unique ( hasKey )
import GHC.Types.Basic
import GHC.Types.Tickish
import GHC.Types.Var ( isTyCoVar )
+
import GHC.Builtin.Types.Prim( realWorldStatePrimTy )
import GHC.Builtin.Names( runRWKey, seqHashKey )
@@ -1442,7 +1443,10 @@ simplTick env tickish expr cont
no_floating_past_tick =
do { let (inc,outc) = splitCont cont
- ; (floats, expr1) <- simplExprF env expr inc
+ env' = case tickish of
+ ProfNote {} -> env { seProfTicks = seProfTicks env + 1 }
+ _ -> env
+ ; (floats, expr1) <- simplExprF env' expr inc
; let expr2 = wrapFloats floats expr1
tickish' = simplTickish env tickish
; rebuild env (mkTick tickish' expr2) outc
@@ -1680,39 +1684,54 @@ optOutCoercion env co already_optimised
empty_subst = mkEmptySubst (seInScope env)
opts = seOptCoercionOpts env
+-- | Number of casts we are adding around an expression as we process a 'Cast'.
+--
+-- We need the cast depth to implement the logic of Note [Quasi join points].
+type NbCastsAdded = Int
+
simplCast :: SimplEnv -> InExpr -> InCoercion -> SimplCont
-> SimplM (SimplFloats, OutExpr)
simplCast env body co0 cont0
= do { co1 <- {-#SCC "simplCast-simplCoercion" #-} simplCoercion env co0
- ; cont1 <- {-#SCC "simplCast-addCoerce" #-}
- if isReflCo co1
- then return cont0 -- See Note [Optimising reflexivity]
- else addCoerce co1 True cont0
- -- True <=> co1 is optimised
- ; {-#SCC "simplCast-simplExprF" #-} simplExprF env body cont1 }
+ ; (cont1, nbAddedCasts) <- {-#SCC "simplCast-addCoerce" #-}
+ if isReflCo co1
+ then return (cont0, 0) -- See Note [Optimising reflexivity]
+ else addCoerce co1 True cont0
+ -- True <=> co1 is optimised
+
+ -- Keep track of how many casts we have added, because we need this
+ -- information for Note [Quasi join points].
+ ; let env' = env { seCasts = seCasts env + nbAddedCasts }
+ ; {-#SCC "simplCast-simplExprF" #-} simplExprF env' body cont1 }
where
-- If the first parameter is MRefl, then simplifying revealed a
-- reflexive coercion. Omit.
- addCoerceM :: MOutCoercion -> Bool -> SimplCont -> SimplM SimplCont
- addCoerceM MRefl _ cont = return cont
+ addCoerceM :: MOutCoercion -> Bool -> SimplCont -> SimplM (SimplCont, NbCastsAdded)
+ addCoerceM MRefl _ cont = return (cont, 0)
addCoerceM (MCo co) opt cont = addCoerce co opt cont
- addCoerce :: OutCoercion -> Bool -> SimplCont -> SimplM SimplCont
+ addCoerce :: OutCoercion -> Bool -> SimplCont -> SimplM (SimplCont, NbCastsAdded)
addCoerce co1 _ (CastIt { sc_co = co2, sc_cont = cont }) -- See Note [Optimising reflexivity]
- = addCoerce (mkTransCo co1 co2) False cont
- -- False: (mkTransCo co1 co2) is not fully optimised
- -- See Note [Avoid re-simplifying coercions]
+ = do { (cont', nbCastsAdded) <- addCoerce (mkTransCo co1 co2) False cont
+ -- False: (mkTransCo co1 co2) is not fully optimised
+ -- See Note [Avoid re-simplifying coercions]
+ ; return (cont', nbCastsAdded - 1)
+ -- -1: the coercion coalesced with an existing coercion.
+ }
addCoerce co co_is_opt (ApplyToTy { sc_arg_ty = arg_ty, sc_cont = tail })
| Just (arg_ty', m_co') <- pushCoTyArg co arg_ty
= {-#SCC "addCoerce-pushCoTyArg" #-}
- do { tail' <- addCoerceM m_co' co_is_opt tail
- ; return (ApplyToTy { sc_arg_ty = arg_ty'
- , sc_cont = tail'
- , sc_hole_ty = coercionLKind co }) }
- -- NB! As the cast goes past, the
- -- type of the hole changes (#16312)
+ do { (tail', nbCastsAdded) <- addCoerceM m_co' co_is_opt tail
+ ; return ( ApplyToTy { sc_arg_ty = arg_ty'
+ , sc_cont = tail'
+ , sc_hole_ty = coercionLKind co }
+ -- NB! As the cast goes past, the
+ -- type of the hole changes (#16312)
+ , nbCastsAdded )
+ }
+
-- (f |> co) e ===> (f (e |> co1)) |> co2
-- where co :: (s1->s2) ~ (t1->t2)
-- co1 :: t1 ~ s1
@@ -1725,10 +1744,12 @@ simplCast env body co0 cont0
| Just (m_co1, m_co2) <- pushCoValArg co
= {-#SCC "addCoerce-pushCoValArg" #-}
- do { tail' <- addCoerceM m_co2 co_is_opt tail
+ do { (tail', nbCastsAdded) <- addCoerceM m_co2 co_is_opt tail
; case m_co1 of {
- MRefl -> return (cont { sc_cont = tail'
- , sc_hole_ty = coercionLKind co }) ;
+ MRefl -> return
+ ( cont { sc_cont = tail'
+ , sc_hole_ty = coercionLKind co }
+ , nbCastsAdded ) ;
-- See Note [Avoiding simplifying repeatedly]
MCo co1 ->
@@ -1738,17 +1759,23 @@ simplCast env body co0 cont0
-- to make it all consistent. It's a bit messy.
-- But it isn't a common case.
-- Example of use: #995
- ; return (ApplyToVal { sc_arg = mkCast arg' co1
- , sc_env = arg_se'
- , sc_dup = dup'
- , sc_cont = tail'
- , sc_hole_ty = coercionLKind co }) } } }
+ ; return
+ ( ApplyToVal { sc_arg = mkCast arg' co1
+ , sc_env = arg_se'
+ , sc_dup = dup'
+ , sc_cont = tail'
+ , sc_hole_ty = coercionLKind co }
+ , nbCastsAdded ) } } }
addCoerce co co_is_opt cont
- | isReflCo co = return cont -- Having this at the end makes a huge
- -- difference in T12227, for some reason
- -- See Note [Optimising reflexivity]
- | otherwise = return (CastIt { sc_co = co, sc_opt = co_is_opt, sc_cont = cont })
+ | isReflCo co = return (cont, 0 :: NbCastsAdded )
+ -- Having this at the end makes a huge
+ -- difference in T12227, for some reason
+ -- See Note [Optimising reflexivity]
+ | otherwise =
+ return
+ ( CastIt { sc_co = co, sc_opt = co_is_opt, sc_cont = cont }
+ , 1 :: NbCastsAdded )
simplLazyArg :: SimplEnvIS -- ^ Used only for its InScopeSet
-> DupFlag
@@ -2051,8 +2078,8 @@ simplNonRecJoinPoint :: SimplEnv -> InId -> InExpr
-> InExpr -> SimplCont
-> SimplM (SimplFloats, OutExpr)
simplNonRecJoinPoint env bndr rhs body cont
- = assert (isJoinId bndr ) $
- wrapJoinCont env cont $ \ env cont ->
+ = assert (isJoinId bndr) $
+ 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
@@ -2062,14 +2089,17 @@ simplNonRecJoinPoint env bndr rhs body cont
; (floats1, env3) <- simplJoinBind NonRecursive cont (bndr,env) (bndr2,env2) (rhs,env)
; (floats2, body') <- simplExprF env3 body cont
; return (floats1 `addFloats` floats2, body') }
+ where
+ do_case_case =
+ if isTrueJoinPoint env bndr
+ then seCaseCase env
+ else False
-
-------------------
simplRecJoinPoint :: SimplEnv -> [(InId, InExpr)]
-> InExpr -> SimplCont
-> SimplM (SimplFloats, OutExpr)
simplRecJoinPoint env pairs body cont
- = wrapJoinCont env cont $ \ env cont ->
+ = wrapJoinCont do_case_case env cont $ \ env cont ->
do { let bndrs = map fst pairs
mult = contHoleScaling cont
res_ty = contResultType cont
@@ -2079,30 +2109,53 @@ simplRecJoinPoint env pairs body cont
; (floats1, env2) <- simplRecBind env1 (BC_Join Recursive cont) pairs
; (floats2, body') <- simplExprF env2 body cont
; return (floats1 `addFloats` floats2, body') }
+ where
+ do_case_case =
+ if all (isTrueJoinPoint env . fst) pairs
+ then seCaseCase env
+ else False
+
+-- | Is this a true join point, or only a quasi join point?
+--
+-- See Note [Quasi join points]
+isTrueJoinPoint :: SimplEnv -> InId -> Bool
+isTrueJoinPoint env id
+ | Just occMaxProfTicks <- occursUnderProfTicks (idOccInfo id)
+ , occMaxProfTicks > seProfTicks env
+ -- The join point occurs under more profiling ticks that its binding.
+ = False
+ | Just occMaxCasts <- occursUnderCasts (idOccInfo id)
+ , occMaxCasts > seCasts env
+ -- The join point occurs under more casts than its binding.
+ = False
+ | otherwise
+ = True
--------------------
-wrapJoinCont :: SimplEnv -> SimplCont
+wrapJoinCont :: Bool
+ -> SimplEnv -> SimplCont
-> (SimplEnv -> SimplCont -> SimplM (SimplFloats, OutExpr))
-> SimplM (SimplFloats, OutExpr)
-- Deal with making the continuation duplicable if necessary,
-- and with the no-case-of-case situation.
-wrapJoinCont env cont thing_inside
+wrapJoinCont do_case_case env cont thing_inside
| contIsStop cont -- Common case; no need for fancy footwork
= thing_inside env cont
- | not (seCaseCase env)
- -- See Note [Join points with -fno-case-of-case]
- = do { (floats1, expr1) <- thing_inside env (mkBoringStop (contHoleType cont))
- ; let (floats2, expr2) = wrapJoinFloatsX floats1 expr1
- ; (floats3, expr3) <- rebuild (env `setInScopeFromF` floats2) expr2 cont
- ; return (floats2 `addFloats` floats3, expr3) }
-
- | otherwise
- -- Normal case; see Note [Join points and case-of-case]
+ | do_case_case
+ -- Normal situation: do the "case-of-case" transformation.
+ -- See Note [Join points and case-of-case].
= do { (floats1, cont') <- mkDupableCont env cont
; (floats2, result) <- thing_inside (env `setInScopeFromF` floats1) cont'
; return (floats1 `addFloats` floats2, result) }
+ | otherwise
+ -- No "case-of-case" transformation.
+ -- See Note [Join points with -fno-case-of-case].
+ = do { (floats1, expr1) <- thing_inside env (mkBoringStop (contHoleType cont))
+ ; let (floats2, expr2) = wrapJoinFloatsX floats1 expr1
+ ; (floats3, expr3) <- rebuild (env `setInScopeFromF` floats2) expr2 cont
+ ; return (floats2 `addFloats` floats3, expr3) }
--------------------
trimJoinCont :: Id -- Used only in error message
@@ -2151,15 +2204,18 @@ evaluation context E):
As is evident from the example, there are two components to this behavior:
- 1. When entering the RHS of a join point, copy the context inside.
- 2. When a join point is invoked, discard the outer context.
+ (wrapJoinCont) When entering the RHS of a join point, copy the context inside.
+ (trimJoinCont) When a join point is invoked, discard the outer context.
We need to be very careful here to remain consistent---neither part is
optional!
-We need do make the continuation E duplicable (since we are duplicating it)
+We need to make the continuation E duplicable (since we are duplicating it)
with mkDupableCont.
+Note that not all join points support this transformation:
+see Note [Quasi join points].
+
Note [Join points with -fno-case-of-case]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2184,7 +2240,8 @@ case-of-case we may then end up with this totally bogus result
This would be OK in the language of the paper, but not in GHC: j is no longer
a join point. We can only do the "push continuation into the RHS of the
join point j" if we also push the continuation right down to the /jumps/ to
-j, so that it can evaporate there. If we are doing case-of-case, we'll get to
+j, so that it can evaporate there (trimJoinCont). Then, if we are doing
+case-of-case, we'll get to
join x = case <j-rhs> of <outer-alts> in
case y of
@@ -2199,6 +2256,105 @@ inwards altogether at any join point. Instead simplify the (join ... in ...)
with a Stop continuation, and wrap the original continuation around the
outside. Surprisingly tricky!
+Note [Quasi join points]
+~~~~~~~~~~~~~~~~~~~~~~~~
+We currently classify join points into two separate categories
+
+ - true join points
+ - quasi join points
+
+Definition:
+ A join point binding defines a *quasi* join point if any of the join point
+ binders occur under profiling ticks or casts.
+
+ If a join point binding is not a quasi join point, it is a *true* join point.
+
+We can push continuations into true join points, as described in
+Note [Join points and case-of-case]:
+
+ K[ join j = rhs in body ] --> join j = K[ rhs ] in K[ body ]
+
+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
+
+For example, consider (a minimisation of) the program in #26693:
+
+ join { j :: Bool -> IO (); j _ = guts }
+ in case pass of
+ False -> scctick<foo> jump j True
+ True -> jump j False
+
+Let's try to push the application to an argument 'arg' into this expression.
+As per Note [Join points and case-of-case], we proceed by first applying the
+argument to both the join point RHS and the case alternatives:
+
+ join { j :: Bool -> IO (); j _ = guts arg ] }
+ in case pass of
+ False -> (scctick<foo> jump j True) arg
+ True -> jump j False arg
+
+Then we rely on 'trimJoinCont' to remove the argument. In this case, this fails
+for the first branch, because 'trimJoinCont' doesn't look through profiling
+ticks. Were we to address this, it's still not clear what code we would want to
+end up with, as we don't want to misattribute profiling costs.
+We could plausibly transform to the following:
+
+ join { j :: Bool -> IO (); j scc_or_null _ = (setSCC# scc_or_null guts) arg ] }
+ in case pass of
+ False -> jump j <foo> True
+ True -> jump j null False
+
+where `setSCC#` is a new primop that would set the current cost centre pointer
+(or no-op if the given pointer is null).
+However:
+ - this primop doesn't exist today,
+ - it requires adding an argument to the join point (hence changing its arity)
+So instead, for now, we simply disallow the case-of-case transformation for 'j'.
+
+Similarly for casts:
+
+ join { j = blah }
+ in case e of
+ False -> j True |> co1
+ True -> j False |> co2
+
+if we want to apply this to an argument 'arg', we would need to perform the
+following transformation:
+
+ join { j co = ( blah |> co ) arg }
+ in case e of
+ False -> j co1 True
+ True -> j co2 False
+
+in which we add a coercion argument to the join point. Again, this is not a
+transformation we currently implement, so we instead prevent case-of-case for
+such join points.
+
+To figure out whether a join point is a true join point or a quasi join point,
+we proceed as follows:
+
+ 1. In occurrence analysis, we compute how many profiling ticks/casts each
+ join point Id occurs under.
+
+ This is stored in the 'tailCallUnderProfTicks' and 'tailCallUnderCasts'
+ fields of 'TailCallInfo', and populated by keeping track of how many
+ profiling ticks and casts we are under when doing occurrence analysis
+ (see 'occ_prof_ticks' and 'occ_casts').
+
+ 2. In the simplifier, we keep track of how many profiling ticks/casts we are
+ currently inside. See 'seProfTicks' and 'seCasts', which are updated
+ in 'simplTick' and 'simplCast', respectively.
+
+ 3. In the simplifier, when we come across a join point binding (in either
+ 'simplNonRecJoinPoint' or 'simplRecJoinPoint'), we compare the current
+ cast depth/profiling tick depth with the cast depth/profiling tick depth
+ of the occurrences of the join point binders.
+
+ If a join point binder occurs under more profiling ticks/casts than its
+ binding site, then it is a quasi join point and we switch off the
+ case-of-case transformation.
************************************************************************
* *
=====================================
compiler/GHC/Core/SimpleOpt.hs
=====================================
@@ -1076,7 +1076,7 @@ joinPointBinding_maybe bndr rhs
| isJoinId bndr
= Just (bndr, rhs)
- | AlwaysTailCalled join_arity <- tailCallInfo (idOccInfo bndr)
+ | AlwaysTailCalled { tailCallArity = join_arity } <- 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
=====================================
compiler/GHC/Core/Utils.hs
=====================================
@@ -35,6 +35,7 @@ module GHC.Core.Utils (
exprIsTopLevelBindable,
exprIsUnaryClassFun, isUnaryClassId,
altsAreExhaustive, etaExpansionTick,
+ cantEtaReduceFun,
-- * Equality
cheapEqExpr, cheapEqExpr', diffBinds,
@@ -2081,9 +2082,24 @@ altsAreExhaustive (Alt con1 _ _ : alts)
-- Takes the function we are applying as argument.
etaExpansionTick :: Id -> GenTickish pass -> Bool
etaExpansionTick id t
- = hasNoBinding id &&
+ = ( cantEtaReduceFun id ) &&
( tickishFloatable t || isProfTick t )
+-- | Can we eta-reduce the given function?
+-- See Note [Eta reduction soundness], criteria (B), (J), and (W).
+cantEtaReduceFun :: Id -> Bool
+cantEtaReduceFun fun
+ = hasNoBinding fun -- (B)
+ -- Don't undersaturate functions with no binding.
+
+ || isJoinId fun -- (J)
+ -- Don't undersaturate join points.
+ -- See Note [Invariants on join points] in GHC.Core, and #20599
+
+ || isJust (idCbvMarks_maybe fun) -- (W)
+ -- Don't undersaturate StrictWorkerIds.
+ -- See Note [CBV Function Ids] in GHC.Types.Id.Info.
+
{- Note [exprOkForSpeculation and type classes]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider (#22745, #15205)
=====================================
compiler/GHC/CoreToStg/Prep.hs
=====================================
@@ -1130,7 +1130,10 @@ cpeApp top_env expr
hd = getIdFromTrivialExpr_maybe e2
-- Determine number of required arguments. See Note [Ticks and mandatory eta expansion]
min_arity = case hd of
- Just v_hd -> if hasNoBinding v_hd then Just $! (idArity v_hd) else Nothing
+ Just v_hd ->
+ if cantEtaReduceFun v_hd
+ then Just $! idArity v_hd
+ else Nothing
Nothing -> Nothing
-- ; pprTraceM "cpe_app:stricts:" (ppr v <+> ppr args $$ ppr stricts $$ ppr (idCbvMarks_maybe v))
; (app, floats, unsat_ticks) <- rebuild_app env args e2 emptyFloats stricts min_arity
=====================================
compiler/GHC/Types/Basic.hs
=====================================
@@ -70,7 +70,7 @@ module GHC.Types.Basic (
BranchCount, oneBranch,
InterestingCxt(..),
TailCallInfo(..), tailCallInfo, zapOccTailCallInfo,
- isAlwaysTailCalled,
+ isAlwaysTailCalled, occursUnderProfTicks, occursUnderCasts,
EP(..),
@@ -1149,8 +1149,14 @@ instance Monoid InsideLam where
mappend = (Semi.<>)
-----------------
+
+-- | See Note [TailCallInfo]
data TailCallInfo
- = AlwaysTailCalled {-# UNPACK #-} !JoinArity -- See Note [TailCallInfo]
+ = AlwaysTailCalled
+ { tailCallArity :: {-# UNPACK #-} !JoinArity
+ , tailCallUnderProfTicks :: !Int -- See Note [Quasi join points]
+ , tailCallUnderCasts :: !Int -- See Note [Quasi join points]
+ }
| NoTailCallInfo
deriving (Eq)
@@ -1167,9 +1173,26 @@ isAlwaysTailCalled occ
= case tailCallInfo occ of AlwaysTailCalled{} -> True
NoTailCallInfo -> False
+-- | If this 'Id' is always tail called, how many profiling ticks does
+-- it occur under? See Note [Quasi join points].
+occursUnderProfTicks :: OccInfo -> Maybe Int
+occursUnderProfTicks occ =
+ case tailCallInfo occ of
+ AlwaysTailCalled { tailCallUnderProfTicks = nb } -> Just nb
+ NoTailCallInfo -> Nothing
+
+-- | If this 'Id' is always tail called, how many casts does
+-- it occur under? See Note [Quasi join points].
+occursUnderCasts :: OccInfo -> Maybe Int
+occursUnderCasts occ =
+ case tailCallInfo occ of
+ AlwaysTailCalled { tailCallUnderCasts = nb } -> Just nb
+ NoTailCallInfo -> Nothing
+
instance Outputable TailCallInfo where
- ppr (AlwaysTailCalled ar) = sep [ text "Tail", int ar ]
- ppr _ = empty
+ ppr (AlwaysTailCalled ar p c) =
+ sep [ text "Tail", brackets (int p <> comma <> int c), int ar ]
+ ppr NoTailCallInfo = text "NoTailCallInfo"
-----------------
strongLoopBreaker, weakLoopBreaker :: OccInfo
@@ -1217,7 +1240,10 @@ instance Outputable OccInfo where
pp_tail = pprShortTailCallInfo tail_info
pprShortTailCallInfo :: TailCallInfo -> SDoc
-pprShortTailCallInfo (AlwaysTailCalled ar) = char 'T' <> brackets (int ar)
+pprShortTailCallInfo (AlwaysTailCalled ar p c)
+ = char 'T' <> (brackets (text "P" <+> int p))
+ <> (brackets (text "C" <+> int c))
+ <> brackets (int ar)
pprShortTailCallInfo NoTailCallInfo = empty
{-
@@ -1251,6 +1277,9 @@ point can also be invoked from other join points, not just from case branches:
Here both 'j1' and 'j2' will get marked AlwaysTailCalled, but j1 will get
ManyOccs and j2 will get `OneOcc { occ_n_br = 2 }`.
+We also store how many profiling ticks and casts the join point occurs under.
+The rationale is described in Note [Quasi join points].
+
************************************************************************
* *
Default method specification
=====================================
compiler/GHC/Types/Tickish.hs
=====================================
@@ -11,6 +11,7 @@ module GHC.Types.Tickish (
tickishScopesLike,
tickishFloatable,
tickishCanSplit,
+ tickishCanScopeJoin,
mkNoCount,
mkNoScope,
tickishIsCode,
@@ -326,6 +327,14 @@ tickishCanSplit ProfNote{profNoteScope = True, profNoteCount = True}
= True
tickishCanSplit _ = False
+-- | Is @join f x in <tick> jump f x@ valid?
+tickishCanScopeJoin :: GenTickish pass -> Bool
+tickishCanScopeJoin tick = case tick of
+ ProfNote{} -> True
+ HpcTick{} -> False
+ Breakpoint{} -> False
+ SourceNote{} -> True
+
mkNoCount :: GenTickish pass -> GenTickish pass
mkNoCount n | not (tickishCounts n) = n
| not (tickishCanSplit n) = panic "mkNoCount: Cannot split!"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/190bc4951c50301c36d1af84343f469…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/190bc4951c50301c36d1af84343f469…
You're receiving this email because of your account on gitlab.haskell.org.
1
0