[Git][ghc/ghc][wip/mangoiv/ci-stages] Deleted 1 commit: fixup! ci: build and test stage
by Magnus (@MangoIV) 18 Aug '26
by Magnus (@MangoIV) 18 Aug '26
18 Aug '26
Magnus pushed to branch wip/mangoiv/ci-stages at Glasgow Haskell Compiler / GHC
WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.
Deleted commits:
1e8d4d42 by mangoiv at 2026-08-17T16:28:28+02:00
fixup! ci: build and test stage
- - - - -
1 changed file:
- .gitlab/ci.sh
Changes:
=====================================
.gitlab/ci.sh
=====================================
@@ -697,9 +697,9 @@ function test_hadrian() {
return
# If we have set CROSS_EMULATOR, then can't test using normal testsuite.
elif [ -n "${CROSS_EMULATOR:-}" ] && [[ "${CROSS_TARGET:-}" != *"wasm"* ]]; then
- local instdir="$TOP/_build/install"
- local test_compiler="$instdir/bin/${cross_prefix}ghc$exe"
- install_bindist $dist_dir/ghc-*/ "$instdir"
+ # local instdir="$TOP/_build/install"
+ local test_compiler="$dist_dir/bin/${cross_prefix}ghc$exe"
+ # install_bindist $dist_dir/ghc-*/ "$instdir"
echo 'main = putStrLn "hello world"' > expected
run "$test_compiler" -package ghc "$TOP/.gitlab/hello.hs" -o hello
@@ -731,9 +731,9 @@ function test_hadrian() {
"runtest.opts+=--unexpected-output-dir=$TOP/unexpected-test-output" \
|| fail "hadrian cabal-install test"
else
- local instdir="$TOP/_build/install"
- local test_compiler="$instdir/bin/${cross_prefix}ghc$exe"
- install_bindist $dist_dir/ghc-*/ "$instdir"
+ # local instdir="$TOP/_build/install"
+ local test_compiler="$dist_dir/bin/${cross_prefix}ghc$exe"
+ # install_bindist $dist_dir/ghc-*/ "$instdir"
# if [[ "${CI_JOB_NAME}" != *"windows"* ]] && [ -z "${CROSS_TARGET:-}" ]
# then
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1e8d4d426981da8042afabaf69a4275…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1e8d4d426981da8042afabaf69a4275…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/jeltsch/improve-closure-property-check] Improve documentation related to the closure property
by Wolfgang Jeltsch (@jeltsch) 18 Aug '26
by Wolfgang Jeltsch (@jeltsch) 18 Aug '26
18 Aug '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/improve-closure-property-check at Glasgow Haskell Compiler / GHC
Commits:
af6db0b6 by Wolfgang Jeltsch at 2026-08-18T15:03:19+03:00
Improve documentation related to the closure property
- - - - -
2 changed files:
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Unit/Env.hs
Changes:
=====================================
compiler/GHC/Driver/Downsweep.hs
=====================================
@@ -933,10 +933,8 @@ rootSummariesParallel n_jobs hsc_env diag_wrapper msg get_summary = do
-- * Check/validate properties and error out
--------------------------------------------------------------------------------
--- | This function checks then important property that if both p and q are home units
--- then any dependency of p, which transitively depends on q is also a home unit.
---
--- See Note [Multiple Home Units], section 'Closure Property'.
+-- | Checks whether the given unit environment has the closure property. See
+-- the section “Closure Property” in @Note [Multiple Home Units]@.
checkHomeUnitsClosed :: UnitEnv -> [DriverMessages]
checkHomeUnitsClosed ue
| Set.null bad_unit_ids = []
=====================================
compiler/GHC/Unit/Env.hs
=====================================
@@ -443,13 +443,11 @@ The flow:
Closure Property
----------------
-You must perform a clean cut of the dependency graph.
-
-> Any dependency which is not a home unit must not (transitively) depend on a home unit.
-
-For example, if you have three packages p, q and r, then if p depends on q which
-depends on r then it is illegal to load both p and r as home units but not q,
-because q is a dependency of the home unit p which depends on another home unit r.
+A unit environment must have the closure property, which means that, whenever
+some units @h₁@ and @h₂@ have been loaded as home units, @h₁@ does not directly
+or indirectly depend on an external unit that directly or indirectly depends
+on @h₂@. 'GHC.Driver.Downsweep.checkHomeUnitsClosed' checks whether a given unit
+environment indeed has this property.
Offsetting Paths
----------------
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/af6db0b6b81b12ddcbd35644c836be3…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/af6db0b6b81b12ddcbd35644c836be3…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 6 commits: Fix a number of incorrect module references:
by Marge Bot (@marge-bot) 18 Aug '26
by Marge Bot (@marge-bot) 18 Aug '26
18 Aug '26
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
93a2b20f by Andreas Klebinger at 2026-08-18T04:31:04-04:00
Fix a number of incorrect module references:
Fix module reference in Note [DataCon wrappers are conlike].
Fix module reference in Note [Detailed InertCans Invariants].
Fix module reference in Note [GHC's data format representations].
Fix module reference in Note [Grand plan for static forms].
Fix module reference in Note [How tuples work].
Fix module reference in Note [Solved dictionaries].
Fix module reference in Note [Stacktraces from Info Table Provenance Entries (IPE based stack unwinding)].
Fix module reference in Note [The VarBndr type and its uses].
Found the incorrect references with a llm.
- - - - -
eb0dfb01 by Simon Jakobi at 2026-08-18T04:31:44-04:00
ci: Run stack-hadrian-build only in full-ci pipelines
The job exists to catch changes that break hadrian/build-stack (#18726),
but nothing in the pipeline depends on it, and it can only break when
hadrian's dependencies change. Restricting it to full-ci (like
hadrian-multi) still covers marge-bot merge batches, so such breakage
cannot reach master unnoticed, while ordinary validate pipelines skip
the job.
Assisted-by: Claude Fable 5
- - - - -
4ef2b850 by Simon Jakobi at 2026-08-18T07:42:17-04:00
testsuite: Show baseline sample count and range in perf failures
A perf baseline is the mean of all samples recorded for a commit, and
it prints as a single number, hiding how far the samples spread. When
the spread is wide, this can indicate an unstable metric that isn't
actually useful as a signal for the perf tests.
For example, in #27602, T27336's peak_megabytes_allocated baseline
showed as 757 when the underlying samples were 605 and 909.
When the baseline is averaged from more than one sample, say so in the
failure output: the one-line stat-failure reason shows the sample
range, and the detail block lists the raw samples. Single-sample
baselines print exactly as before.
Context: #27602
Assisted-by: Claude Fable 5
- - - - -
3117ea9e by Simon Jakobi at 2026-08-18T07:42:17-04:00
testsuite: Fold Baseline into CommitMetric
A Baseline was just a CommitMetric plus the commit it came from, built
by copying fields across. Since get_commit_metric already knows that
commit, record it on CommitMetric itself and drop Baseline. This also
collapses both branches of find_baseline into plain returns.
Assisted-by: Claude Fable 5
- - - - -
dd5bdc95 by Simon Jakobi at 2026-08-18T07:42:17-04:00
ci: Clarify comment on pushing perf notes after failures
Context: #27602
Assisted-by: Claude Fable 5
- - - - -
bb63527b by Alan Zimmerman at 2026-08-18T07:42:18-04:00
EPA: Remove LocatedBC / SrcSpanBF
The custom annotations are now in the BooleanFormula TTG extension
points, so LBooleanFormula can now use the standard LocatedA.
- - - - -
20 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- compiler/GHC/Builtin/WiredIn/Types.hs
- compiler/GHC/CmmToAsm/Format.hs
- compiler/GHC/Data/BooleanFormula.hs
- compiler/GHC/Driver/GenerateCgIPEStub.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy/StaticPtrTable.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Var.hs
- testsuite/driver/perf_notes.py
- testsuite/driver/testglobals.py
- utils/check-exact/ExactPrint.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -552,6 +552,8 @@ stack-hadrian-build:
- . .gitlab/ci.sh setup
- . .gitlab/ci.sh configure
- hadrian/build-stack --version
+ rules:
+ - *full-ci
####################################
# Testing reinstallable ghc codepath
=====================================
.gitlab/ci.sh
=====================================
@@ -1120,9 +1120,10 @@ case ${1:-help} in
setup) setup && cleanup_submodules ;;
configure) time_it "configure" configure ;;
build_hadrian) time_it "build" build_hadrian ;;
- # N.B. Always push notes, even if the build fails. This is okay to do as the
- # testsuite driver doesn't record notes for tests that fail due to
- # correctness.
+ # N.B. Always push notes, even if the build fails. Metrics from runs failing
+ # a perf stat check are deliberately recorded too — discarding them would
+ # bias the baseline towards whichever sample came first. Only correctness
+ # failures record nothing.
test_hadrian)
fetch_perf_notes
res=0
=====================================
compiler/GHC/Builtin/WiredIn/Types.hs
=====================================
@@ -783,7 +783,7 @@ typeSymbolKind = mkTyConTy typeSymbolKindCon
Note [How tuples work]
~~~~~~~~~~~~~~~~~~~~~~
* There are three families of tuple TyCons and corresponding
- DataCons, expressed by the type BasicTypes.TupleSort:
+ DataCons, expressed by the type GHC.Types.Basic.TupleSort:
data TupleSort = BoxedTuple | UnboxedTuple | ConstraintTuple
* All three families are AlgTyCons, whose AlgTyConRhs is TupleTyCon
@@ -818,7 +818,7 @@ Note [How tuples work]
stores them in the context field of types like HsQualTy.
* In quite a lot of places things are restricted just to
- BoxedTuple/UnboxedTuple, and then we used BasicTypes.Boxity to distinguish
+ BoxedTuple/UnboxedTuple, and then we used GHC.Types.Basic.Boxity to distinguish
E.g. tupleTyCon has a Boxity argument
* When looking up an OccName in the original-name cache
=====================================
compiler/GHC/CmmToAsm/Format.hs
=====================================
@@ -52,20 +52,20 @@ import GHC.Utils.Panic
GHC has severals types that represent various aspects of data format.
These include:
- * 'CmmType.CmmType': The data classification used throughout the C--
+ * 'GHC.Cmm.Type.CmmType': The data classification used throughout the C--
pipeline. This is a pair of a CmmCat and a Width.
- * 'CmmType.CmmCat': What the bits in a C-- value mean (e.g. a pointer, integer, or floating-point value)
+ * 'GHC.Cmm.Type.CmmCat': What the bits in a C-- value mean (e.g. a pointer, integer, or floating-point value)
- * 'CmmType.Width': The width of a C-- value.
+ * 'GHC.Cmm.Type.Width': The width of a C-- value.
- * 'CmmType.Length': The width (measured in number of scalars) of a vector value.
+ * 'GHC.Cmm.Type.Length': The width (measured in number of scalars) of a vector value.
* 'Format.Format': The data format representation used by much of the backend.
- * 'Format.ScalarFormat': The format of a 'Format.VecFormat'\'s scalar.
+ * 'GHC.CmmToAsm.Format.ScalarFormat': The format of a 'GHC.CmmToAsm.Format.VecFormat'\'s scalar.
- * 'RegClass.RegClass': Whether a register is an integer or a floating point/vector register.
+ * 'GHC.Platform.Reg.Class.RegClass': Whether a register is an integer or a floating point/vector register.
-}
-- It looks very like the old MachRep, but it's now of purely local
=====================================
compiler/GHC/Data/BooleanFormula.hs
=====================================
@@ -25,7 +25,7 @@ import GHC.Types.Unique
import GHC.Types.Unique.Set
import GHC.Types.SrcLoc (unLoc)
import GHC.Utils.Outputable
-import GHC.Parser.Annotation ( SrcSpanAnnBF )
+import GHC.Parser.Annotation ( SrcSpanAnnA, EpToken(..) )
import GHC.Hs.Extension (GhcPass (..), OutputableBndrId)
import Language.Haskell.Syntax.Extension (Anno, LIdP, IdP,
noExtField, NoExtField, DataConCantHappen,
@@ -38,12 +38,12 @@ import Language.Haskell.Syntax.BooleanFormula
-- Boolean formula type and smart constructors
----------------------------------------------------------------------
-type instance Anno (BooleanFormula (GhcPass p)) = SrcSpanAnnBF
+type instance Anno (BooleanFormula (GhcPass p)) = SrcSpanAnnA
type instance XBFVar (GhcPass _) = NoExtField
type instance XBFAnd (GhcPass _) = NoExtField
type instance XBFOr (GhcPass _) = NoExtField
-type instance XBFParens (GhcPass _) = NoExtField
+type instance XBFParens (GhcPass _) = (EpToken "(", EpToken ")")
type instance XXBooleanFormula (GhcPass _) = DataConCantHappen
instance BooleanFormulaDefault (GhcPass p) where
=====================================
compiler/GHC/Driver/GenerateCgIPEStub.hs
=====================================
@@ -62,7 +62,7 @@ looking up source locations for stack info tables in the map generated during th
The rest of this note will document exactly how the first pass generates the map from labels to
estimated source positions. The algorithms are different depending on whether tables-next-to-code
-is on or off. Both algorithms have in common that we are looking for a `CmmNode.CmmTick`
+is on or off. Both algorithms have in common that we are looking for a `GHC.Cmm.Node.CmmTick`
(containing a `SourceNote`) that is near what we estimate to be the label of a return stack frame.
With tables-next-to-code
@@ -112,14 +112,14 @@ open or closed on exit (one can fallthrough from them to the next node).
Please refer to the paper "Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation"
for a detailed explanation.
-Here we use the fact, that calls (represented by `CmmNode.CmmCall`) are always closed on exit
+Here we use the fact, that calls (represented by `GHC.Cmm.Node.CmmCall`) are always closed on exit
(`CmmNode O C`, `O` means open, `C` closed). In other words, they are always at the end of a block.
So, given a `CmmGraph`:
- - Look at the end of every block: If it is a `CmmNode.CmmCall` returning to some label, lookup
- the nearest `CmmNode.CmmTick` by traversing the middle part of the block backwards (from end to
+ - Look at the end of every block: If it is a `GHC.Cmm.Node.CmmCall` returning to some label, lookup
+ the nearest `GHC.Cmm.Node.CmmTick` by traversing the middle part of the block backwards (from end to
beginning).
- - Take the first `CmmNode.CmmTick` that contains a `Tickish.SourceNote` and map the label we
+ - Take the first `GHC.Cmm.Node.CmmTick` that contains a `Tickish.SourceNote` and map the label we
found to it's payload as an `IpeSourceLocation`. (There are other `Tickish` constructors like
`ProfNote` or `HpcTick`, these are ignored.)
=====================================
compiler/GHC/Hs/Dump.hs
=====================================
@@ -97,7 +97,6 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0
`ext2Q` located
`extQ` srcSpanAnnA
`extQ` srcSpanAnnN
- `extQ` srcSpanAnnBF
where generic :: Data a => a -> SDoc
generic t = parens $ text (showConstr (toConstr t))
@@ -396,10 +395,6 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0
srcSpanAnnN :: EpAnn NameAnn -> SDoc
srcSpanAnnN = locatedAnn'' (text "SrcSpanAnnN")
- srcSpanAnnBF :: EpAnn AnnBooleanFormula -> SDoc
- srcSpanAnnBF = locatedAnn'' (text "SrcSpanAnnBF")
-
-
locatedAnn'' :: forall a. (Typeable a, Data a)
=> SDoc -> EpAnn a -> SDoc
locatedAnn'' tag ss = parens $
=====================================
compiler/GHC/Iface/Ext/Ast.hs
=====================================
@@ -2081,7 +2081,7 @@ instance ToHie PendingRnSplice where
toHie (PendingRnSplice _ e) = toHie e
instance (HiePass p, Data (IdGhcP p))
- => ToHie (GenLocated SrcSpanAnnBF (BooleanFormula (GhcPass p))) where
+ => ToHie (GenLocated SrcSpanAnnA (BooleanFormula (GhcPass p))) where
toHie (L span form) = concatM $ makeNode form (locA span) : case form of
Var _ a ->
[ toHie $ C Use a
=====================================
compiler/GHC/Iface/Syntax.hs
=====================================
@@ -1330,7 +1330,7 @@ pprIfaceDecl ss decl@(IfaceClass { ifName = clas
fromIfaceBooleanFormula (IfVar nm ) = Var noExtField $ noLocA . mkUnboundName . mkVarOccFS . ifLclNameFS $ nm
fromIfaceBooleanFormula (IfAnd bfs ) = And noExtField $ map (noLocA . fromIfaceBooleanFormula) bfs
fromIfaceBooleanFormula (IfOr bfs ) = Or noExtField $ map (noLocA . fromIfaceBooleanFormula) bfs
- fromIfaceBooleanFormula (IfParens bf) = Parens noExtField $ (noLocA . fromIfaceBooleanFormula) bf
+ fromIfaceBooleanFormula (IfParens bf) = Parens noAnn $ (noLocA . fromIfaceBooleanFormula) bf
-- See Note [Suppressing binder signatures] in GHC.Iface.Type
=====================================
compiler/GHC/Iface/Tidy/StaticPtrTable.hs
=====================================
@@ -82,7 +82,7 @@ Here is a running example:
(SF4) The desugarer replaces a nested expression (static e) with a top-level
binding for an application of the function 'makeStatic' (defined in module
- GHC.StaticPtr.Internal of base). So we get
+ GHC.Internal.StaticPtr.Internal of base). So we get
s = /\abc. makeStatic location e
f x = ...(fromStaticPtr s)...
=====================================
compiler/GHC/IfaceToCore.hs
=====================================
@@ -121,7 +121,7 @@ import GHC.Types.Tickish
import GHC.Types.TyThing
import GHC.Types.Error
-import GHC.Parser.Annotation (noLocA)
+import GHC.Parser.Annotation (noLocA, noAnn)
import GHC.Fingerprint
@@ -885,7 +885,7 @@ tc_iface_decl _parent ignore_prags
tc_boolean_formula :: IfaceBooleanFormula -> IfL (BooleanFormula GhcRn)
tc_boolean_formula (IfAnd ibfs ) = BF.And NoExtField . map noLocA <$> traverse tc_boolean_formula ibfs
tc_boolean_formula (IfOr ibfs ) = BF.Or NoExtField . map noLocA <$> traverse tc_boolean_formula ibfs
- tc_boolean_formula (IfParens ibf) = BF.Parens NoExtField . noLocA <$> tc_boolean_formula ibf
+ tc_boolean_formula (IfParens ibf) = BF.Parens noAnn . noLocA <$> tc_boolean_formula ibf
tc_boolean_formula (IfVar nm ) = BF.Var NoExtField . noLocA <$> (lookupIfaceTop . mkVarOccFS . ifLclNameFS $ nm)
mk_sc_doc pred = text "Superclass" <+> ppr pred
=====================================
compiler/GHC/Parser.y
=====================================
@@ -3820,7 +3820,7 @@ name_boolformula_opt :: { LBooleanFormula GhcPs }
name_boolformula :: { LBooleanFormula GhcPs }
: name_boolformula_and { $1 }
| name_boolformula_and '|' name_boolformula
- {% do { h <- addTrailingVbarBF $1 (epTok $2)
+ {% do { h <- addTrailingVbarA $1 (epTok $2)
; return (sLLa $1 $> (Or noExtField [h,$3])) } }
name_boolformula_and :: { LBooleanFormula GhcPs }
@@ -3830,12 +3830,11 @@ name_boolformula_and :: { LBooleanFormula GhcPs }
name_boolformula_and_list :: { NonEmpty (LBooleanFormula GhcPs) }
: name_boolformula_atom { NE.singleton $1 }
| name_boolformula_atom ',' name_boolformula_and_list
- {% do { h <- addTrailingCommaBF $1 (epTok $2)
+ {% do { h <- addTrailingCommaA $1 (epTok $2)
; return (h NE.<| $3) } }
name_boolformula_atom :: { LBooleanFormula GhcPs }
- : '(' name_boolformula ')' {% amsr (sLL $1 $> (Parens noExtField $2))
- (AnnBooleanFormula (epTok $1) (epTok $3) []) }
+ : '(' name_boolformula ')' {% amsA' (sLL $1 $> (Parens (epTok $1, epTok $3) $2)) }
| name_var { sL1a $1 (Var noExtField $1) }
namelist :: { Located [LocatedN RdrName] }
@@ -4794,20 +4793,6 @@ addTrailingAnnA (L anns a) tok ta = do
-- -------------------------------------
-addTrailingVbarBF :: MonadP m => LocatedBF a -> EpToken "|" -> m (LocatedBF a)
-addTrailingVbarBF la tok = addTrailingAnnBF la (AddVbarAnn tok)
-
-addTrailingCommaBF :: MonadP m => LocatedBF a -> EpToken "," -> m (LocatedBF a)
-addTrailingCommaBF la tok = addTrailingAnnBF la (AddCommaAnn tok)
-
-addTrailingAnnBF :: MonadP m => LocatedBF a -> TrailingAnn -> m (LocatedBF a)
-addTrailingAnnBF (L anns a) ta = do
- !cs <- getCommentsFor (locA anns)
- let anns' = addTrailingAnnToBF ta cs anns
- return (L anns' a)
-
--- -------------------------------------
-
-- Mostly use to add AnnComma, special case it to NOP if adding a zero-width annotation
addTrailingCommaN :: MonadP m => LocatedN a -> SrcSpan -> m (LocatedN a)
addTrailingCommaN (L anns a) span = do
=====================================
compiler/GHC/Parser/Annotation.hs
=====================================
@@ -28,23 +28,19 @@ module GHC.Parser.Annotation (
-- ** Annotations in 'GenLocated'
LocatedA, LocatedN, LocatedAn,
- LocatedBF,
SrcSpanAnnA, SrcSpanAnnN,
- SrcSpanAnnBF,
-- ** Annotation data types used in 'GenLocated'
AnnList(..), AnnListBrackets(..),
AnnParen(..),
AnnCType(..),AnnWarningTxt(..),AnnOverlap(..),AnnAnnDecl(..),AnnPragSCC(..),
- AnnBooleanFormula(..),
NameAnn(..), NameAdornment(..),
NoEpAnns(..),
-- ** Trailing annotations in lists
TrailingAnn(..), ta_location,
addTrailingAnnToA, addTrailingCommaToN,
- addTrailingAnnToBF,
noTrailingN,
-- ** Utilities for converting between different 'GenLocated' when
@@ -430,8 +426,6 @@ emptyComments = EpaComments []
type LocatedA = GenLocated SrcSpanAnnA
type LocatedN = GenLocated SrcSpanAnnN
-type LocatedBF = GenLocated SrcSpanAnnBF
-
-- | Annotation for items appearing in a list. They can have one or
-- more trailing punctuations items, such as commas or semicolons.
type SrcSpanAnnA = EpAnn [TrailingAnn]
@@ -440,8 +434,6 @@ type SrcSpanAnnA = EpAnn [TrailingAnn]
-- on the context, such as backticks.
type SrcSpanAnnN = EpAnn NameAnn
-type SrcSpanAnnBF = EpAnn AnnBooleanFormula
-
-- | General representation of a 'GenLocated' type carrying a
-- parameterised annotation type.
type LocatedAn an = GenLocated (EpAnn an)
@@ -551,17 +543,6 @@ data AnnParen
| AnnParensHash (EpToken "(#") (EpToken "#)") -- ^ '(#', '#)'
deriving Data
--- ---------------------------------------------------------------------
--- | Exact print annotation for the 'BooleanFormula' data type.
-
-data AnnBooleanFormula
- = AnnBooleanFormula {
- abf_open :: (EpToken "("), -- ^ opening parenthesis.
- abf_close :: (EpToken ")"), -- ^ closing parenthesis.
- abf_trailing :: ![TrailingAnn] -- ^ items appearing after the
- -- item, such as '|', ','
- } deriving (Data,Eq)
-
-- ---------------------------------------------------------------------
-- Annotations for names
-- ---------------------------------------------------------------------
@@ -669,14 +650,6 @@ data AnnPragSCC
-- ---------------------------------------------------------------------
-addTrailingAnnToBF :: TrailingAnn -> EpAnnComments
- -> EpAnn AnnBooleanFormula -> EpAnn AnnBooleanFormula
-addTrailingAnnToBF t cs n = n { anns = addTrailing (anns n)
- , comments = comments n <> cs }
- where
- -- See Note [list append in addTrailing*]
- addTrailing n = n { abf_trailing = abf_trailing n ++ [t]}
-
-- | Helper function used in the parser to add a 'TrailingAnn' items
-- to an existing annotation.
addTrailingAnnToA :: TrailingAnn -> EpAnnComments
@@ -1030,9 +1003,6 @@ instance (NoAnn ann) => NoAnn (EpAnn ann) where
instance NoAnn NoEpAnns where
noAnn = NoEpAnns
-instance NoAnn AnnBooleanFormula where
- noAnn = AnnBooleanFormula noAnn noAnn []
-
instance NoAnn AnnList where
noAnn = AnnList Nothing ListNone noAnn
=====================================
compiler/GHC/Tc/Solver/InertSet.hs
=====================================
@@ -460,7 +460,7 @@ In implementation terms
- It is only called when applying an instance decl,
in GHC.Tc.Solver.Dict.tryInstances
- - ClsInst.InstanceWhat says what kind of instance was
+ - GHC.Tc.Instance.Class.InstanceWhat says what kind of instance was
used to solve the constraint. In particular
* LocalInstance identifies quantified constraints
* BuiltinEqInstance identifies the strange built-in
@@ -800,7 +800,7 @@ The InertCans represents a collection of constraints with the following properti
eg a wanted cannot rewrite a given)
* CEqCan equalities: see Note [inert_eqs: the inert equalities]
- Also see documentation in Constraint.Ct for a list of invariants
+ Also see documentation in GHC.Tc.Types.Constraint.Ct for a list of invariants
Note [inert_eqs: the inert equalities]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=====================================
compiler/GHC/Types/Id/Make.hs
=====================================
@@ -987,7 +987,7 @@ until the final simplifier phase; see Note [Activation for data
constructor wrappers].
For further reading, see:
- * (IA1) in Note [Interesting arguments] in GHC.Core.Op.Simplify.Utils
+ * (IA1) in Note [Interesting arguments] in GHC.Core.Opt.Simplify.Utils
* Note [Lone variables] in GHC.Core.Unfold
* Note [exprIsConApp_maybe on data constructors with wrappers]
in GHC.Core.SimpleOpt
=====================================
compiler/GHC/Types/Var.hs
=====================================
@@ -621,27 +621,27 @@ Note [Types for coercions, predicates, and evidence]
VarBndr is polymorphic in both var and visibility fields.
Currently there are nine different uses of 'VarBndr':
-* Var.ForAllTyBinder = VarBndr TyCoVar ForAllTyFlag
+* GHC.Types.Var.ForAllTyBinder = VarBndr TyCoVar ForAllTyFlag
Binder of a forall-type; see ForAllTy in GHC.Core.TyCo.Rep
-* Var.TyVarBinder = VarBndr TyVar ForAllTyFlag
+* GHC.Types.Var.TyVarBinder = VarBndr TyVar ForAllTyFlag
Subset of ForAllTyBinder when we are sure the binder is a TyVar
-* Var.InvisTVBinder = VarBndr TyVar Specificity
+* GHC.Types.Var.InvisTVBinder = VarBndr TyVar Specificity
Specialised form of TyVarBinder, when ForAllTyFlag = Invisible s
See GHC.Core.Type.splitForAllInvisTVBinders
-* Var.ReqTVBinder = VarBndr TyVar ()
+* GHC.Types.Var.ReqTVBinder = VarBndr TyVar ()
Specialised form of TyVarBinder, when ForAllTyFlag = Required
See GHC.Core.Type.splitForAllReqTVBinders
This one is barely used
-* TyCon.TyConBinder = VarBndr TyVar TyConBndrVis
+* GHC.Core.TyCon.TyConBinder = VarBndr TyVar TyConBndrVis
Binders of a TyCon; see TyCon in GHC.Core.TyCon
-* IfaceType.IfaceForAllBndr = VarBndr IfaceBndr ForAllTyFlag
-* IfaceType.IfaceForAllSpecBndr = VarBndr IfaceBndr Specificity
-* IfaceType.IfaceTyConBinder = VarBndr IfaceBndr TyConBndrVis
+* GHC.Iface.Type.IfaceForAllBndr = VarBndr IfaceBndr ForAllTyFlag
+* GHC.Iface.Type.IfaceForAllSpecBndr = VarBndr IfaceBndr Specificity
+* GHC.Iface.Type.IfaceTyConBinder = VarBndr IfaceBndr TyConBndrVis
-}
data VarBndr var argf = Bndr var argf
=====================================
testsuite/driver/perf_notes.py
=====================================
@@ -83,9 +83,13 @@ PerfStat = NamedTuple('PerfStat', [('test_env', TestEnv),
('metric', MetricName),
('value', float)])
-# A baseline recovered form stored metrics.
-Baseline = NamedTuple('Baseline', [('perfStat', PerfStat),
- ('commit', GitHash)])
+# A test's metric recovered from a commit's git note: the raw sample values
+# recorded there, and a PerfStat whose value is their mean. Serves as the
+# baseline when comparing a test run against an earlier commit.
+class CommitMetric(NamedTuple):
+ perfStat: PerfStat
+ commit: GitHash
+ samples: List[float]
# The type of exceptions which are thrown when computing the current stat value
# fails.
@@ -460,10 +464,10 @@ def get_allowed_changes(baseline_ref: Optional[GitRef]) -> Dict[TestName, List[A
else:
return get_allowed_perf_changes()
-# Cache of baseline values. This is a dict of dicts indexed on:
-# (useCiNamespace, commit) -> (test_env, test, metric, way) -> baseline
-# (bool , str ) -> (str , str , str , str) -> float
-_commit_metric_cache = {} # type: ignore
+# Cache of commit metrics.
+_commit_metric_cache: Dict[Tuple[NoteNamespace, GitHash],
+ Dict[Tuple[TestEnv, TestName, MetricName, WayName],
+ CommitMetric]] = {}
# Get the baseline of a test at a given commit. This is the expected value
# *before* the commit is applied (i.e. on the parent commit).
@@ -477,7 +481,7 @@ _commit_metric_cache = {} # type: ignore
# instead when looking for ci results)
# metric: str - test metric
# way: str - test way
-# returns: the Baseline or None if no metric was found within
+# returns: the baseline CommitMetric or None if no metric was found within
# BaselineSearchDepth commits and since the last expected change
# (ignoring any expected change in the given commit).
def baseline_metric(commit: GitHash,
@@ -486,7 +490,7 @@ def baseline_metric(commit: GitHash,
metric: MetricName,
way: WayName,
baseline_ref: Optional[GitRef]
- ) -> Optional[Baseline]:
+ ) -> Optional[CommitMetric]:
# For performance reasons (in order to avoid calling commit_hash), we assert
# commit is already a commit hash.
assert is_commit_hash(commit)
@@ -502,20 +506,16 @@ def baseline_metric(commit: GitHash,
# Searches through previous commits trying local then ci for each commit in.
def find_baseline(namespace: NoteNamespace,
test_env: TestEnv
- ) -> Optional[Baseline]:
+ ) -> Optional[CommitMetric]:
if baseline_commit is not None:
- current_metric = get_commit_metric(namespace, baseline_commit, test_env, name, metric, way)
- if current_metric is not None:
- return Baseline(current_metric, baseline_commit)
- else:
- return None
+ return get_commit_metric(namespace, baseline_commit, test_env, name, metric, way)
for depth, current_commit in list(enumerate(commit_hashes)):
if current_commit == commit: continue
# Check for a metric on this commit.
current_metric = get_commit_metric(namespace, current_commit, test_env, name, metric, way)
if current_metric is not None:
- return Baseline(current_metric, current_commit)
+ return current_metric
# Stop if there is an expected change at this commit. In that case
# metrics on ancestor commits will not be a valid baseline.
@@ -527,7 +527,7 @@ def baseline_metric(commit: GitHash,
# Test environment to use when comparing against CI namespace
ci_test_env = best_fit_ci_test_env()
- baseline = find_baseline(LocalNamespace, test_env) # type: Optional[Baseline]
+ baseline = find_baseline(LocalNamespace, test_env) # type: Optional[CommitMetric]
if baseline is None and ci_test_env is not None:
baseline = find_baseline(CiNamespace, ci_test_env)
@@ -545,23 +545,23 @@ def get_commit_metric_value_str_or_none(gitNoteRef,
result = get_commit_metric(gitNoteRef, commit, test_env, name, metric, way)
if result is None:
return None
- return str(result.value)
+ return str(result.perfStat.value)
-# gets the average commit metric from git notes.
+# gets the commit metric (average and raw samples) from git notes.
# gitNoteRef: git notes ref space e.g. "perf" or "ci/perf"
# ref: git commit
# test_env: test environment
# name: test name
# metric: test metric
# way: test way
-# returns: PerfStat | None if stats don't exist for the given input
+# returns: CommitMetric | None if stats don't exist for the given input
def get_commit_metric(gitNoteRef,
ref: Union[GitRef, GitHash],
test_env: TestEnv,
name: TestName,
metric: MetricName,
way: WayName
- ) -> Optional[PerfStat]:
+ ) -> Optional[CommitMetric]:
global _commit_metric_cache
assert test_env != None
commit = commit_hash(ref)
@@ -573,9 +573,9 @@ def get_commit_metric(gitNoteRef,
return _commit_metric_cache[cacheKeyA].get(cacheKeyB)
# Cache miss.
- # Calculate baselines from the current commit's git note.
+ # Calculate metrics from the current commit's git note.
# Note that the git note may contain data for other tests. All tests'
- # baselines will be collected and cached for future use.
+ # metrics will be collected and cached for future use.
allCommitMetrics = get_perf_stats(ref, gitNoteRef)
# Collect recorded values by cacheKeyB.
@@ -586,22 +586,32 @@ def get_commit_metric(gitNoteRef,
currentValues = values_by_cache_key_b.setdefault(currentCacheKey, [])
currentValues.append(float(perfStat.value))
- # Calculate and baseline (average of values) by cacheKeyB.
- baseline_by_cache_key_b = {}
+ # Calculate the metric (average of values, plus the values themselves)
+ # by cacheKeyB.
+ metric_by_cache_key_b = {}
for currentCacheKey, currentValues in values_by_cache_key_b.items():
- baseline_by_cache_key_b[currentCacheKey] = PerfStat( \
- currentCacheKey[0],
- currentCacheKey[1],
- currentCacheKey[3],
- currentCacheKey[2],
- sum(currentValues) / len(currentValues))
-
- # Save baselines to the cache.
- _commit_metric_cache[cacheKeyA] = baseline_by_cache_key_b
- return baseline_by_cache_key_b.get(cacheKeyB)
+ metric_by_cache_key_b[currentCacheKey] = CommitMetric(
+ PerfStat(
+ currentCacheKey[0],
+ currentCacheKey[1],
+ currentCacheKey[3],
+ currentCacheKey[2],
+ sum(currentValues) / len(currentValues)),
+ commit,
+ currentValues)
+
+ # Save metrics to the cache.
+ _commit_metric_cache[cacheKeyA] = metric_by_cache_key_b
+ return metric_by_cache_key_b.get(cacheKeyB)
+
+def format_sample(s: float) -> str:
+ return str(int(s)) if s == int(s) else str(s)
+
+def format_samples(samples: List[float]) -> str:
+ return ', '.join(format_sample(s) for s in samples)
def check_stats_change(actual: PerfStat,
- baseline: Baseline,
+ baseline: CommitMetric,
acceptance_window: MetricAcceptanceWindow,
allowed_perf_changes: Dict[TestName, List[AllowedPerfChange]] = {},
force_print = False
@@ -611,8 +621,8 @@ def check_stats_change(actual: PerfStat,
Parameters:
actual: the PerfStat with actual value
- baseline: the expected Baseline value (this should generally be derived
- from baseline_metric())
+ baseline: the CommitMetric to compare against (this should generally be
+ derived from baseline_metric())
acceptance_window: allowed deviation of the actual value from the expected
value.
allowed_perf_changes: allowed changes in stats. This is a dictionary as
@@ -654,9 +664,17 @@ def check_stats_change(actual: PerfStat,
' baseline @ %s' % baseline.commit
print(actual.metric, error + ':')
dev = 100.0 if expected_val == 0 else round(((float(actual.value) * 100) / int(expected_val)) - 100, 1)
+ # Show the sample spread so unreliable baselines become visible (#27602).
+ if len(baseline.samples) > 1:
+ samples_note = ('; baseline is mean of %d samples spanning %s..%s'
+ % (len(baseline.samples),
+ format_sample(min(baseline.samples)),
+ format_sample(max(baseline.samples))))
+ else:
+ samples_note = ''
change_line = (f'{actual.metric} {change.value} from {baseline.perfStat.test_env} '
f'baseline @ {baseline.commit[:7]}: {expected_val} -> {actual.value} '
- f'({dev:+g}%, allowed {acceptance_window.describe()})')
+ f'({dev:+g}%, allowed {acceptance_window.describe()}{samples_note})')
result = failBecause('stat ' + change_line, tag='stat')
if not change_allowed or force_print:
@@ -666,6 +684,10 @@ def check_stats_change(actual: PerfStat,
print(descr, str(val).rjust(length), extra)
display(' Expected ' + full_name + ' ' + actual.metric + ':', expected_val, acceptance_window.describe())
+ if len(baseline.samples) > 1:
+ display(' Samples ' + full_name + ' ' + actual.metric + ':',
+ len(baseline.samples),
+ '(' + format_samples(baseline.samples) + ')')
display(' Lower bound ' + full_name + ' ' + actual.metric + ':', lowerBound, '')
display(' Upper bound ' + full_name + ' ' + actual.metric + ':', upperBound, '')
display(' Actual ' + full_name + ' ' + actual.metric + ':', actual.value, '')
@@ -866,7 +888,7 @@ def main() -> None:
# HEAD~2 21234 21234
# HEAD~3 20000 20000
def strMetric(x):
- return '{:.2f}'.format(x.value) if x != None else ""
+ return '{:.2f}'.format(x.perfStat.value) if x != None else ""
# Data is in column major format, so transpose and pass to print_table.
T = TypeVar('T')
def transpose(xss: List[List[T]]) -> List[List[T]]:
=====================================
testsuite/driver/testglobals.py
=====================================
@@ -4,7 +4,7 @@
from my_typing import *
from pathlib import Path
-from perf_notes import MetricChange, PerfStat, Baseline, GitRef
+from perf_notes import MetricChange, PerfStat, CommitMetric, GitRef
from datetime import datetime
# -----------------------------------------------------------------------------
@@ -312,7 +312,7 @@ class TestResult:
PerfMetric = NamedTuple('PerfMetric',
[('change', MetricChange),
('stat', PerfStat),
- ('baseline', Optional[Baseline]) ])
+ ('baseline', Optional[CommitMetric]) ])
class TestRun:
def __init__(self) -> None:
=====================================
utils/check-exact/ExactPrint.hs
=====================================
@@ -353,10 +353,6 @@ instance HasTrailing (EpToken "{", EpToken "}") where
trailing _ = []
setTrailing a _ = a
-instance HasTrailing (AnnBooleanFormula) where
- trailing bf = abf_trailing bf
- setTrailing a ts = a { abf_trailing = ts }
-
-- ---------------------------------------------------------------------
fromAnn' :: (HasEntry a) => a -> Entry
@@ -2731,9 +2727,11 @@ instance ExactPrint (BF.BooleanFormula GhcPs) where
exact (BF.And e ls) = do
ls' <- mapM markAnnotated ls
return (BF.And e ls')
- exact (BF.Parens e x) = do
+ exact (BF.Parens (o,c) x) = do
+ o' <- markEpToken o
x' <- markAnnotated x
- return (BF.Parens e x')
+ c' <- markEpToken c
+ return (BF.Parens (o',c') x')
-- ---------------------------------------------------------------------
@@ -4474,17 +4472,6 @@ instance ExactPrint [LocatedA (StmtLR GhcPs GhcPs (LocatedA (HsCmd GhcPs)))] whe
stmts' <- markAnnotated stmts
return stmts'
-instance ExactPrint (LocatedBF (BF.BooleanFormula GhcPs)) where
- getAnnotationEntry = entryFromLocatedA
- setAnnotationAnchor = setAnchorAn
- exact (L an bf) = do
- debugM $ "LocatedCB [LBooleanFormula"
- let (AnnBooleanFormula op cp ta) = anns an
- op' <- markEpToken op
- bf' <- markAnnotated bf
- cp' <- markEpToken cp
- return (L (an {anns = AnnBooleanFormula op' cp' ta}) bf')
-
instance ExactPrint [Located HsDocStringChunk] where
getAnnotationEntry _ = NoEntryVal
setAnnotationAnchor a _ _ _ = a
=====================================
utils/haddock/haddock-api/src/Haddock/Types.hs
=====================================
@@ -834,7 +834,7 @@ type instance Anno (HsDecl DocNameI) = SrcSpanAnnA
type instance Anno (FamilyResultSig DocNameI) = EpAnn NoEpAnns
type instance Anno (HsOuterTyVarBndrs Specificity DocNameI) = SrcSpanAnnA
type instance Anno (HsSigType DocNameI) = SrcSpanAnnA
-type instance Anno (BooleanFormula DocNameI) = SrcSpanAnnBF
+type instance Anno (BooleanFormula DocNameI) = SrcSpanAnnA
type instance Anno (OverlapMode DocNameI) = SrcSpanAnnA
type instance Anno (CType DocNameI) = SrcSpanAnnA
type instance Anno (Header DocNameI) = SrcSpanAnnA
@@ -1041,7 +1041,7 @@ type instance XXHsContextDetails DocNameI = DataConCantHappen
type instance XBFVar DocNameI = NoExtField
type instance XBFAnd DocNameI = NoExtField
type instance XBFOr DocNameI = NoExtField
-type instance XBFParens DocNameI = NoExtField
+type instance XBFParens DocNameI = (EpToken "(", EpToken ")")
type instance XXBooleanFormula DocNameI = DataConCantHappen
-----------------------------------------------------------------------------
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bb344b5fc94b4472864f5013db8d10…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bb344b5fc94b4472864f5013db8d10…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][master] Fix a number of incorrect module references:
by Marge Bot (@marge-bot) 18 Aug '26
by Marge Bot (@marge-bot) 18 Aug '26
18 Aug '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
93a2b20f by Andreas Klebinger at 2026-08-18T04:31:04-04:00
Fix a number of incorrect module references:
Fix module reference in Note [DataCon wrappers are conlike].
Fix module reference in Note [Detailed InertCans Invariants].
Fix module reference in Note [GHC's data format representations].
Fix module reference in Note [Grand plan for static forms].
Fix module reference in Note [How tuples work].
Fix module reference in Note [Solved dictionaries].
Fix module reference in Note [Stacktraces from Info Table Provenance Entries (IPE based stack unwinding)].
Fix module reference in Note [The VarBndr type and its uses].
Found the incorrect references with a llm.
- - - - -
7 changed files:
- compiler/GHC/Builtin/WiredIn/Types.hs
- compiler/GHC/CmmToAsm/Format.hs
- compiler/GHC/Driver/GenerateCgIPEStub.hs
- compiler/GHC/Iface/Tidy/StaticPtrTable.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Var.hs
Changes:
=====================================
compiler/GHC/Builtin/WiredIn/Types.hs
=====================================
@@ -783,7 +783,7 @@ typeSymbolKind = mkTyConTy typeSymbolKindCon
Note [How tuples work]
~~~~~~~~~~~~~~~~~~~~~~
* There are three families of tuple TyCons and corresponding
- DataCons, expressed by the type BasicTypes.TupleSort:
+ DataCons, expressed by the type GHC.Types.Basic.TupleSort:
data TupleSort = BoxedTuple | UnboxedTuple | ConstraintTuple
* All three families are AlgTyCons, whose AlgTyConRhs is TupleTyCon
@@ -818,7 +818,7 @@ Note [How tuples work]
stores them in the context field of types like HsQualTy.
* In quite a lot of places things are restricted just to
- BoxedTuple/UnboxedTuple, and then we used BasicTypes.Boxity to distinguish
+ BoxedTuple/UnboxedTuple, and then we used GHC.Types.Basic.Boxity to distinguish
E.g. tupleTyCon has a Boxity argument
* When looking up an OccName in the original-name cache
=====================================
compiler/GHC/CmmToAsm/Format.hs
=====================================
@@ -52,20 +52,20 @@ import GHC.Utils.Panic
GHC has severals types that represent various aspects of data format.
These include:
- * 'CmmType.CmmType': The data classification used throughout the C--
+ * 'GHC.Cmm.Type.CmmType': The data classification used throughout the C--
pipeline. This is a pair of a CmmCat and a Width.
- * 'CmmType.CmmCat': What the bits in a C-- value mean (e.g. a pointer, integer, or floating-point value)
+ * 'GHC.Cmm.Type.CmmCat': What the bits in a C-- value mean (e.g. a pointer, integer, or floating-point value)
- * 'CmmType.Width': The width of a C-- value.
+ * 'GHC.Cmm.Type.Width': The width of a C-- value.
- * 'CmmType.Length': The width (measured in number of scalars) of a vector value.
+ * 'GHC.Cmm.Type.Length': The width (measured in number of scalars) of a vector value.
* 'Format.Format': The data format representation used by much of the backend.
- * 'Format.ScalarFormat': The format of a 'Format.VecFormat'\'s scalar.
+ * 'GHC.CmmToAsm.Format.ScalarFormat': The format of a 'GHC.CmmToAsm.Format.VecFormat'\'s scalar.
- * 'RegClass.RegClass': Whether a register is an integer or a floating point/vector register.
+ * 'GHC.Platform.Reg.Class.RegClass': Whether a register is an integer or a floating point/vector register.
-}
-- It looks very like the old MachRep, but it's now of purely local
=====================================
compiler/GHC/Driver/GenerateCgIPEStub.hs
=====================================
@@ -62,7 +62,7 @@ looking up source locations for stack info tables in the map generated during th
The rest of this note will document exactly how the first pass generates the map from labels to
estimated source positions. The algorithms are different depending on whether tables-next-to-code
-is on or off. Both algorithms have in common that we are looking for a `CmmNode.CmmTick`
+is on or off. Both algorithms have in common that we are looking for a `GHC.Cmm.Node.CmmTick`
(containing a `SourceNote`) that is near what we estimate to be the label of a return stack frame.
With tables-next-to-code
@@ -112,14 +112,14 @@ open or closed on exit (one can fallthrough from them to the next node).
Please refer to the paper "Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation"
for a detailed explanation.
-Here we use the fact, that calls (represented by `CmmNode.CmmCall`) are always closed on exit
+Here we use the fact, that calls (represented by `GHC.Cmm.Node.CmmCall`) are always closed on exit
(`CmmNode O C`, `O` means open, `C` closed). In other words, they are always at the end of a block.
So, given a `CmmGraph`:
- - Look at the end of every block: If it is a `CmmNode.CmmCall` returning to some label, lookup
- the nearest `CmmNode.CmmTick` by traversing the middle part of the block backwards (from end to
+ - Look at the end of every block: If it is a `GHC.Cmm.Node.CmmCall` returning to some label, lookup
+ the nearest `GHC.Cmm.Node.CmmTick` by traversing the middle part of the block backwards (from end to
beginning).
- - Take the first `CmmNode.CmmTick` that contains a `Tickish.SourceNote` and map the label we
+ - Take the first `GHC.Cmm.Node.CmmTick` that contains a `Tickish.SourceNote` and map the label we
found to it's payload as an `IpeSourceLocation`. (There are other `Tickish` constructors like
`ProfNote` or `HpcTick`, these are ignored.)
=====================================
compiler/GHC/Iface/Tidy/StaticPtrTable.hs
=====================================
@@ -82,7 +82,7 @@ Here is a running example:
(SF4) The desugarer replaces a nested expression (static e) with a top-level
binding for an application of the function 'makeStatic' (defined in module
- GHC.StaticPtr.Internal of base). So we get
+ GHC.Internal.StaticPtr.Internal of base). So we get
s = /\abc. makeStatic location e
f x = ...(fromStaticPtr s)...
=====================================
compiler/GHC/Tc/Solver/InertSet.hs
=====================================
@@ -460,7 +460,7 @@ In implementation terms
- It is only called when applying an instance decl,
in GHC.Tc.Solver.Dict.tryInstances
- - ClsInst.InstanceWhat says what kind of instance was
+ - GHC.Tc.Instance.Class.InstanceWhat says what kind of instance was
used to solve the constraint. In particular
* LocalInstance identifies quantified constraints
* BuiltinEqInstance identifies the strange built-in
@@ -800,7 +800,7 @@ The InertCans represents a collection of constraints with the following properti
eg a wanted cannot rewrite a given)
* CEqCan equalities: see Note [inert_eqs: the inert equalities]
- Also see documentation in Constraint.Ct for a list of invariants
+ Also see documentation in GHC.Tc.Types.Constraint.Ct for a list of invariants
Note [inert_eqs: the inert equalities]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=====================================
compiler/GHC/Types/Id/Make.hs
=====================================
@@ -987,7 +987,7 @@ until the final simplifier phase; see Note [Activation for data
constructor wrappers].
For further reading, see:
- * (IA1) in Note [Interesting arguments] in GHC.Core.Op.Simplify.Utils
+ * (IA1) in Note [Interesting arguments] in GHC.Core.Opt.Simplify.Utils
* Note [Lone variables] in GHC.Core.Unfold
* Note [exprIsConApp_maybe on data constructors with wrappers]
in GHC.Core.SimpleOpt
=====================================
compiler/GHC/Types/Var.hs
=====================================
@@ -621,27 +621,27 @@ Note [Types for coercions, predicates, and evidence]
VarBndr is polymorphic in both var and visibility fields.
Currently there are nine different uses of 'VarBndr':
-* Var.ForAllTyBinder = VarBndr TyCoVar ForAllTyFlag
+* GHC.Types.Var.ForAllTyBinder = VarBndr TyCoVar ForAllTyFlag
Binder of a forall-type; see ForAllTy in GHC.Core.TyCo.Rep
-* Var.TyVarBinder = VarBndr TyVar ForAllTyFlag
+* GHC.Types.Var.TyVarBinder = VarBndr TyVar ForAllTyFlag
Subset of ForAllTyBinder when we are sure the binder is a TyVar
-* Var.InvisTVBinder = VarBndr TyVar Specificity
+* GHC.Types.Var.InvisTVBinder = VarBndr TyVar Specificity
Specialised form of TyVarBinder, when ForAllTyFlag = Invisible s
See GHC.Core.Type.splitForAllInvisTVBinders
-* Var.ReqTVBinder = VarBndr TyVar ()
+* GHC.Types.Var.ReqTVBinder = VarBndr TyVar ()
Specialised form of TyVarBinder, when ForAllTyFlag = Required
See GHC.Core.Type.splitForAllReqTVBinders
This one is barely used
-* TyCon.TyConBinder = VarBndr TyVar TyConBndrVis
+* GHC.Core.TyCon.TyConBinder = VarBndr TyVar TyConBndrVis
Binders of a TyCon; see TyCon in GHC.Core.TyCon
-* IfaceType.IfaceForAllBndr = VarBndr IfaceBndr ForAllTyFlag
-* IfaceType.IfaceForAllSpecBndr = VarBndr IfaceBndr Specificity
-* IfaceType.IfaceTyConBinder = VarBndr IfaceBndr TyConBndrVis
+* GHC.Iface.Type.IfaceForAllBndr = VarBndr IfaceBndr ForAllTyFlag
+* GHC.Iface.Type.IfaceForAllSpecBndr = VarBndr IfaceBndr Specificity
+* GHC.Iface.Type.IfaceTyConBinder = VarBndr IfaceBndr TyConBndrVis
-}
data VarBndr var argf = Bndr var argf
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/93a2b20f2fb33c1607c9686aa4dd8eb…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/93a2b20f2fb33c1607c9686aa4dd8eb…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][master] ci: Run stack-hadrian-build only in full-ci pipelines
by Marge Bot (@marge-bot) 18 Aug '26
by Marge Bot (@marge-bot) 18 Aug '26
18 Aug '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
eb0dfb01 by Simon Jakobi at 2026-08-18T04:31:44-04:00
ci: Run stack-hadrian-build only in full-ci pipelines
The job exists to catch changes that break hadrian/build-stack (#18726),
but nothing in the pipeline depends on it, and it can only break when
hadrian's dependencies change. Restricting it to full-ci (like
hadrian-multi) still covers marge-bot merge batches, so such breakage
cannot reach master unnoticed, while ordinary validate pipelines skip
the job.
Assisted-by: Claude Fable 5
- - - - -
1 changed file:
- .gitlab-ci.yml
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -552,6 +552,8 @@ stack-hadrian-build:
- . .gitlab/ci.sh setup
- . .gitlab/ci.sh configure
- hadrian/build-stack --version
+ rules:
+ - *full-ci
####################################
# Testing reinstallable ghc codepath
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eb0dfb011b43451e88181fb6b980710…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eb0dfb011b43451e88181fb6b980710…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/TTG-ModuleName] 53 commits: Fix a profiling race condition resulting in segfaults.
by recursion-ninja (@recursion-ninja) 18 Aug '26
by recursion-ninja (@recursion-ninja) 18 Aug '26
18 Aug '26
recursion-ninja pushed to branch wip/TTG-ModuleName at Glasgow Haskell Compiler / GHC
Commits:
ed09895d by Andreas Klebinger at 2026-07-08T16:53:27-04:00
Fix a profiling race condition resulting in segfaults.
StgToCmm: Don't assume tagged FUN closures in closureCodeBody.
When entering a closure the self/node pointer might not be tagged in
some situations when a thunk is evaluated by multiple threads.
So we most AND away the tag bits rather than subtracting an expected tag.
Apply.cmm: Fix a race condition occuring when a thunk is mutated during GC.
In stg_ap_0_fast when might need to run GC before entering a thunk. If this happens
another thread or the GC itself might mutate the closure making entering it no longer
valid. We now check for this.
Add test and changelog for #27123 fixes.
- - - - -
67c03eb2 by Cheng Shao at 2026-07-08T16:54:09-04:00
ghc-heap: fix invalid srtlen returned by peekItbl when no-TNTC
This patch fixes the no-TNTC code path of `peekItbl` so that it looks
at the right memory address when reading the `srt` field from the
`StgInfoTable_` struct. Also adds a `T27465` regression test that
reproduces the bug on no-TNTC builds before the fix. Fixes #27465.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
2ecabb4f by Zubin Duggal at 2026-07-09T09:23:25-04:00
hadrian: binary-dist-dir should not be the default target
Revert behaviour to pre 23c9b6c392f52ec9d7a8618b204ff6b885f5fba2
In 23c9b6c392f52ec9d7a8618b204ff6b885f5fba2, we applied the following behaviour change:
```
hadrian: Build stage 2 cross compilers
...
* hadrian: Make binary-dist-dir the default build target. This allows us
to have the logic in one place about which libraries/stages to build
with cross compilers. Fixes #24192
```
This is a major regression to development experience, a plain hadrian/build
--freeze1 now takes ages because we rebuild all docs (which need to go in the
binary dist dir).
`binary-dist-dir` is the wrong default target for regular GHC development work
Fixes #27445
- - - - -
e16388e3 by Zubin Duggal at 2026-07-09T09:23:25-04:00
.gitignore: Add the hadrian system.config introduced by commit 23c9b6c392f52ec9d7a8618b204ff6b885f5fba2
Since
commit 23c9b6c392f52ec9d7a8618b204ff6b885f5fba2
Author: Matthew Pickering <matthewtpickering(a)gmail.com>
Date: Thu Dec 21 16:17:41 2023 +0000
hadrian: Build stage 2 cross compilers
./configure produces /hadrian/cfg/system.config.{host,target}
Add these to .gitignore
- - - - -
7e8abf41 by Alan Zimmerman at 2026-07-09T09:24:12-04:00
EPA: Replace AnnListItem with simply [TrailingAnn]
Remove the unnecessary wrapper around a single field.
- - - - -
29032f17 by Zubin Duggal at 2026-07-09T09:24:58-04:00
testsuite: Keep real reason for fragile test failures
- - - - -
c34e03a7 by Zubin Duggal at 2026-07-09T09:24:58-04:00
testsuite: Fall back to the failure reason for empty JUnit bodies
- - - - -
409d40f0 by Zubin Duggal at 2026-07-09T09:24:58-04:00
testsuite: Show output diffs in JUnit output
Also refactor compare_outputs to return essentially a `Maybe Diff`
(`CompareOutput`) instead of a bool, but more pythonic. This
allows us to pass the diff through nice.
- - - - -
06fee1ab by Zubin Duggal at 2026-07-09T09:24:58-04:00
perf notes: include stat deviation and acceptance window in notes so they show up in gitlab
- - - - -
57c0f32c by mangoiv at 2026-07-10T11:08:38-04:00
driver: enable -finter-module-far-jumps by default
this fixes a compatibility bug with certain binutils/gcc versions where
we were seeing jump offset overflow errors.
This commit can probably reverted if we stop supporting the problematic
binutils/gcc verions (2.44 and 14.2, respectively)
Reolves #26994
- - - - -
4396a6f2 by Andrea Vezzosi at 2026-07-10T11:09:25-04:00
[Fix #27287] preserve ModBreaks in ModIface
- - - - -
ed261a7e by Cheng Shao at 2026-07-14T17:59:38-04:00
hadrian: fix HLS support
This patch fixes hadrian's HLS support so one can rely on HLS when
working on the hadrian codebase. Fixes #27480.
Not building/linking shared libraries for hadrian is a severely
premature optimization; this top-level setting in `cabal.project` only
affects home packages while the dependencies in the cabal store are
built with vanilla/dynamic anyway, and even adding dynamic builds to
home packages would not be costly due to cabal's usage of
`-dynamic-too`.
- - - - -
eee8ec5b by Cheng Shao at 2026-07-14T18:00:20-04:00
compiler: fix miscompiled %load_relaxed, add missing %store_relaxed
This patch fixes the %load_relaxed cmm primop compilation logic to
correctly use relaxed memory ordering, and adds the missing
%store_relaxed primop. Parsing logic of %load/%store with explicit
ordering is covered in the AtomicFetch test case. Fixes #27483.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
1718230f by Alan Zimmerman at 2026-07-14T18:01:06-04:00
EPA: Keep binds and sigs together in HsValBindsLR
We combine them into a single list for GhcPs, wrapped in the
ValBind data type, which is the bind equivalent of ValD, having
constructors for binds and sigs.
This simplifies exact print processing, especially when using it to
update the contents of local binds, as we no longer need AnnSortKey
BindTag
- - - - -
6bd1ad2a by Andreas Klebinger at 2026-07-14T18:01:49-04:00
Bump nofib submodule to account for MonoLocalBinds.
New versions of GHC enable MonoLocalBinds by default.
This breaks some of the benchmarks. I've fixed this and
this bump pulls in that fix.
- - - - -
7eb0f1c9 by Cheng Shao at 2026-07-14T18:02:31-04:00
testsuite: fix bytecodeIPE test under +ipe flavours
This patch fixes the bytecodeIPE test under +ipe flavours. It used to
fail under +ipe because the RTS is built with IPE info, then
stg_AP_info in RTS carries IPE info, so whereFrom wouldn't return
Nothing. Now the test checks IPE info of a datacon in the ghci-loaded
module which is not affected by whether the RTS is built with IPE info
or not. Fixes #27498.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
ef038aae by cydparser at 2026-07-15T04:35:41-04:00
Reduce bytes allocated for `capabilities` in RTS (fixes #27487)
In rts/Capability.c, `capabilities` is an array of pointers, but it was allocated as if it were an
array of Capability's.
- - - - -
d377e83e by Cheng Shao at 2026-07-15T04:36:27-04:00
rts: fix missing UNTAG in stg_readTVarIOzh
This patch fixes missing UNTAG on the current value closure read from
StgTVar. UNTAG is a no-op when it's stg_TREC_HEADER_info which is word
aligned; it may be a tagged closure, and reading info table from the
tagged address is an unaligned load which may cause issues on
platforms with strict alignment requirements.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
8ed03842 by Cheng Shao at 2026-07-15T04:36:27-04:00
rts: fix missing UNTAG in stg_control0zh_ll
This patch fixes missing UNTAG on the cont closure returned by
captureContinuationAndAbort. In case it's not NULL,
captureContinuationAndAbort returns a tagged StgContinuation closure,
in which case it must be untagged before accessing the
apply_mask_frame field.
In the past it worked out of luck: when apply_mask_frame was NULL then
mask_frame_offset is also 0 so the control flow didn't diverge to a
wrong path. Still, this is horribly wrong and will crash once
StgContinuation struct is refactored and fields are shuffled around.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
5aa7000a by Cheng Shao at 2026-07-15T04:37:08-04:00
compiler: fix redundant AP thunk codegen when not using -ticky-ap-thunk
This patch fixes a double negation confusion in !7525 that results in
some redundant AP thunk code generation when not using
-ticky-ap-thunk. Now, we use `stgToCmmUseStdApThunk` to indicate
whether precomputed AP thunks in the RTS should be used, which
defaults to `True`, unless `-ticky-ap-thunk` is passed.
`-finfo-table-map` now also implies `-ticky-ap-thunk`, since when
doing IPE profiling we want the generated AP thunks to be unique.
Fixes #27502.
-------------------------
Metric Decrease:
T3064
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
d43a7b7a by Brian McKenna at 2026-07-15T20:10:04+02:00
Strip ticks when desugaring bool guards
The special `considerAccessible` pattern was broken when compiling
with debug info. Compiling with debug info wraps expressions with
`SourceNote` ticks, which broke the internals of the
`desugarBoolGuard` function. Ticks are now ignored within this
function.
Fixes #27360
- - - - -
ede4b17b by Ben Gamari at 2026-07-15T22:59:53-04:00
base: Display ExceptionContext in WhileHandling's textual description
As originally-implemented the implementation for
`WhileHandling(displayExceptionAnnotation)` would display the
`ExceptionContext` of the exception which it carries (as this was the
behavior of `displayException`, in terms of which
`displayExceptionAnnotation` was implemented).
However, in 284ffab3 the definition of `SomeException(displayException)`
was changed to exclude the `ExceptionContext`. This means that
`WhileHandling(displayExceptionAnnotation)` fails to describe the
provenance of the exception which it captures, greatly limiting its
utility.
Return the implementation to its originally-specified behavior by
implementing `WhileHandling(displayExceptionAnnotation)` in terms of
`displayExceptionWithInfo`.
Fixes #27456.
- - - - -
0f64f348 by Cheng Shao at 2026-07-16T15:41:08+00:00
ci: add missing docker permission workaround in abi-test job
- - - - -
660cb239 by Cheng Shao at 2026-07-16T19:37:48+00:00
bindist: Fix make install -j race condition on macos/freebsd
This patch fixes make install -j race condition on macos/freebsd. BSD
install fails with EEXIST when multiple install processes concurrently
create the same prefix directory. So we add an `install_dirs`
prerequisite job that sequentially creates the directories for
subsequent jobs to work with. Fixes #27499.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
08130257 by Cheng Shao at 2026-07-16T19:37:48+00:00
ci: run bindist make install with -j
This patch makes the ci scripts run `make install` with `-j` to reduce
wall clock time when installing the bindist, see related issue for
benchmark numbers. This only affects ghc ci logic, the user-facing
default is up to distributors and is still `-j1`. Closes #27029.
- - - - -
d5ae6906 by Adam Gundry at 2026-07-17T04:57:43-04:00
Mark various language extension flags as deprecated (see #27329)
The following language extensions are now deprecated:
- AlternativeLayoutRule
- AlternativeLayoutRuleTransitional
- ParallelArrays
- PolymorphicComponents
- Rank2Types
In addition, the warning `-Walternative-layout-rule-transitional`
has been marked as deprecated, as it is emitted only under the
deprecated extension `XAlternativeLayoutRuleTransitional`.
- - - - -
fe3b059c by Andrew Lelechenko at 2026-07-17T04:58:26-04:00
base: re-export GHC.Environment.getFullArgs from System.Environment
CLC proposal https://github.com/haskell/core-libraries-committee/issues/431
- - - - -
722236dd by sheaf at 2026-07-18T08:48:31-04:00
Coercion optimisation: avoid double-Sym for InstCo
Ticket #27374 pointed out an issue with GHC.Core.Coercion.Opt.optCoercion's
handling of InstCo: it contravened (LC2) in Note [The LiftingContext in optCoercion]
because it applied the ambient 'sym' to a coercion that was then added
to the lifting context substitution.
Fixes #27374
Co-authored-by: Simon Jakobi <simon.jakobi(a)gmail.com>
- - - - -
ff70fc75 by sheaf at 2026-07-18T08:48:31-04:00
Coercion optimisation: avoid exponential behaviour
The change to coercion optimisation of 'InstCo' in the previous commit
introduces exponential behaviour to the coercion optimiser. To avoid
this, this commit provides a way to push in 'Sym' of an already-optimised
coercion: GHC.Core.Coercion.Opt.mkDeepSymCo.
See Note [Pushing Sym without re-optimising] in GHC.Core.Coercion.Opt.
- - - - -
dfef27f0 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Move THREADED_RTS-conditional struct members to end of Capability
Accessing members of the Capability struct from CMM code rely on
accessor macros. (The macros are generated by deriveConstants).
These macros have a single definition. This means that the offsets of
all struct members must *not* vary based on THREADED_RTS vs
!THREADED_RTS. This requires that any struct members that are
conditional on THREADED_RTS must occur after the unconditional struct
members. Hence we move all the ones that are conditional on
THREADED_RTS to the end.
Add a deriveConstants entry for the iomgr member of the Capability
struct, which was the motivation for this change.
Add warning messages to help our future selves. Debugging this took me
a couple hours in gdb!
- - - - -
c254e022 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Make the IOManager API use CapIOManager rather than Capability
This makes the API somewhat more self-contained and more consistent.
Now the IOManager API and each of the backends takes just the I/O
manager structure. Previously we had a bit of a mixture, depending on
whether the function needed access to the Capability or just the
CapIOManager.
We still need access to the cap, so we introduce a back reference to
reach the capability, via iomgr->cap.
Convert all uses in select and poll backends, but not win32 ones.
Convert callers in the scheduler and elsewhere.
Also convert the three CMM primops that call IOManager APIs. They just
need to use Capability_iomgr(MyCapability()).
- - - - -
4f3d8f31 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Split posix/MIO.c out of posix/Signals.c
The MIO I/O manager was secretly living inside the Signals file.
Now it gets its own file, like any other self-respecting I/O manager.
- - - - -
52ce04a9 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Rationalise some scheduler run queue utilities
Move them all to the same place in the file.
Make some static that were used only internally.
Also remove a redundant assignment after calling truncateRunQueue that
is already done within truncateRunQueue.
- - - - -
75bbdebc by Duncan Coutts at 2026-07-18T08:49:12-04:00
Rename initIOManager{AfterFork} to {re}startIOManager
These are more accurate names, since these actions happen after
initialisation and are really about starting (or restarting) background
threads.
- - - - -
724c0517 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Free per-cap I/O managers during shutdown and forkProcess
Historically this was not strictly necessary. The select and win32
legacy I/O managers did not maintain any dynamically allocated
resources. The new poll one does (an auxillary table), and so this
should be freed.
After forkProcess, all threads get deleted. This includes threads
waiting on I/O or timers. So as of this patch, resetting the I/O
manager is just about tidying things up. For example, for the poll
I/O manager this will reset the size of the AIOP table (which
otherwise grows but never shrinks).
In future however the re-initialising will become neeecessary for
functionality, since some I/O managers will need to re-initialise
wakeup fds that are set CLOEXEC.
- - - - -
c007d122 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add a TODO to the MIO I/O manager
The direction of travel is to make I/O managers per-capability and have
all their state live in the struct CapIOManager. The MIO I/O manager
however still has a number of global variables.
It's not obvious how handle these globals however.
- - - - -
b65ab7b3 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add a FIXME note in the Poll I/O manager
- - - - -
daf2bd6f by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add missing updateRemembSetPushClosure in poll I/O manager
For the non-moving GC.
- - - - -
e33ca830 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Minor doc improvement to struct StgAsyncIOOp member outcome
Mention the enumeration names, as well as their numeric values. The rest
of the code uses the enum names.
- - - - -
4edd2579 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Minor doc improvements for StgTSOBlockInfo
Clarify that certain union members are used only by certain legacy
I/O managers. Hopefully we will be able to remove these at some point.
- - - - -
536bedbb by Duncan Coutts at 2026-07-18T08:49:12-04:00
Avoid exporting various win32-specific rts symbols
The BeginPrivate.h / EndPrivate.h scheme works perfectly well on
Windows, but all of the rts/win32/*.h files were not using it.
- - - - -
8139b5ac by Duncan Coutts at 2026-07-18T08:49:12-04:00
Remove wakeupIOManager, ioManagerWakeup and setIOManagerWakeupFd
We no longer need wakeupIOManager for the threaded RTS case, so we can
remove it and the bits only needed to support it. This includes the
pipe/eventfd fd shared between the RTS and the in-library I/O manager
used for waking up the I/O manager thread. The pipe/eventfd still
exists, but it no longer has to be communicated to the RTS, since the
RTS no longer needs to use it.
So we remove the RTS API export setIOManagerWakeupFd, and remove uses of
it within the I/O managers in ghc-internal.
- - - - -
74fe7c66 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add a new interruptIOManager API for the I/O managers
It will be used to interrupt awaitCompletedTimeoutsOrIO. Also update the
return type and docs for awaitCompletedTimeoutsOrIO to have it return
false when it gets interrupted, and have no useful post condition in
that case.
- - - - -
38792843 by Duncan Coutts at 2026-07-18T08:49:13-04:00
Add interruptIOManager support for select I/O manager
Uses the FdWakup mechanism.
- - - - -
2f3b00aa by Duncan Coutts at 2026-07-18T08:49:13-04:00
Add interruptIOManager support for poll I/O manager
Uses the FdWakup mechanism.
A quirk we have to cope with is that we now need to poll one more fd --
the wakeup_fd_r -- but this fd has no corresponding entry in the
aiop_table. This is awkward since we have set up our aiop_poll_table to
be an auxilliary table with matching indicies.
The solution this patch uses (and described in the comments) is to have
two tables: struct pollfd *aiop_poll_table, *full_poll_table;
and to have the aiop_poll_table alias the tail of the full_poll_table.
The head entry in the full_poll_table is the extra fd. So we poll the
full_poll_table, while the aiop_poll_table still has matching indicies
with the aiop_table.
Hurrah for C aliasing rules.
- - - - -
cee50131 by Duncan Coutts at 2026-07-18T08:49:13-04:00
Add interruptIOManager support for win32 legacy I/O manager
And remove unused related helper resetAbandonRequestWait. It is not
called because the event is created in auto-reset mode, so never needs
to be reset manually.
- - - - -
cf453143 by Duncan Coutts at 2026-07-18T08:49:13-04:00
Note lack of interruptIOManager support for WinIO I/O manager
Though there's a plausible design, we can't sanely test it at the moment
due to related WinIO bugs. Filed as issue #27403.
- - - - -
1b74a0ad by Duncan Coutts at 2026-07-18T08:49:13-04:00
Be more explicit about enum IOReadOrWrite values, and type within cmm
Belt and braces.
- - - - -
b388d093 by Brian McKenna at 2026-07-18T17:51:50-04:00
Ignore ticks in the pattern-match term oracle
The term-oracle in the pattern-match checker is keyed by a canonical
form of the scrutinee, computed by `makeDictsCoherent`. That canonical
form was tick-sensitive: two occurrences of an otherwise identical
expression that happened to carry different ticks were treated as
distinct values, breaking long-distance information.
This shows up in practice under `-finfo-table-map`, because the
desugarer wraps every record-selector use site in a `SourceNote`
carrying that site's span. For example:
data Box = Box { unBox :: Maybe Int }
f b = case unBox b of
Nothing -> 0
Just _ -> let Just x = unBox b in x
The two `unBox b` expressionss carry different SourceNote spans, the
pattern-match checker sees them as different, the long-distance
information from the outer `Just _` branch never reaches the
let-pattern, and `Just x = unBox b` is wrongly reported as
non-exhaustive.
We now strip all ticks in `makeDictsCoherent`. This is documented as
Wrinkle (UD1) of Note [Unique dictionaries in the TmOracle CoreMap].
Fixes #27314
- - - - -
c23e1acb by Mrjtjmn at 2026-07-18T17:52:45-04:00
Add explanations for unsolved Typeable constraints
This commit adds explanations for unsolved 'Typeable' constraints.
GHC will now provide additional explanations for an unsolved constraint
of the form 'Typeable ty', explain why GHC did not solve Typeable constraint.
e.g.:
- 'ty' is a polymorphic type (e.g. forall a. a -> a)
- 'ty' is a qualified type (e.g. Eq Int => Int)
- 'ty' is an unboxed sum type
- 'ty' is an unreduced type family application
- 'ty' whose kind is not typeable
Fixes #26532
- - - - -
cbef021e by Artem Pelenitsyn at 2026-07-19T07:49:55-04:00
ghc-internal: Lock.hs: fix typo and indentation
- - - - -
42918646 by Duncan Coutts at 2026-07-19T07:50:36-04:00
Fix failing test GcStaticPointers for non-moving GC
Minor mistake in asserting something before checking for that same
thing.
Specifically, Bdescr asserts HEAP_ALLOCED_GC, but Bdescr was being used
prior to a guard that checks HEAP_ALLOCED_GC. The solution is just to
move the use of Bdescr after the guard.
Thanks to Simon Jakobi for identifying the problem.
- - - - -
62bb9bbb by Recursion Ninja at 2026-08-17T20:12:47-04:00
Decoupling 'ModuleName' from GHC internals by adding a GHC-pass parameter to specify the storage representation
- - - - -
285 changed files:
- .gitignore
- .gitlab-ci.yml
- .gitlab/ci.sh
- + changelog.d/T26532
- + changelog.d/T27123.md
- + changelog.d/T27314.md
- + changelog.d/T27329
- + changelog.d/T27360
- + changelog.d/T27374
- + changelog.d/T27456
- + changelog.d/fix-cmm-atomic-load-store
- + changelog.d/fix-make-install-j
- + changelog.d/fix-peekitbl-no-tntc
- + changelog.d/fix-use-std-ap-thunk
- + changelog.d/inter-module-far-jumps-aarch64-default
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/Opt/CallerCC/Types.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Config/StgToCmm.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main/Compile.hs
- compiler/GHC/Driver/Main/Hsc.hs
- compiler/GHC/Driver/Main/Passes.hs
- compiler/GHC/Driver/Pipeline.hs-boot
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Expr.hs-boot
- compiler/GHC/Hs/Extension.hs
- + compiler/GHC/Hs/Extension/Instances.hs
- compiler/GHC/Hs/Extension/Pass.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Breakpoints.hs
- + compiler/GHC/HsToCore/Breakpoints/Types.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/String.hs
- compiler/GHC/Platform/Ways.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Lit.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Config.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Types/Rank.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Unique.hs
- compiler/GHC/Unit/Home.hs
- compiler/GHC/Unit/Module.hs
- compiler/GHC/Unit/Module/Env.hs
- compiler/GHC/Unit/Module/ModGuts.hs
- compiler/GHC/Unit/Module/ModIface.hs
- + compiler/GHC/Unit/Module/Name.hs
- compiler/GHC/Unit/Module/WholeCoreBindings.hs
- compiler/GHC/Unit/Parser.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Unit/Types.hs-boot
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/Language/Haskell/Syntax/Module/Name.hs
- compiler/ghc.cabal.in
- docs/users_guide/expected-undocumented-flags.txt
- docs/users_guide/exts/rank_polymorphism.rst
- docs/users_guide/exts/static_pointers.rst
- docs/users_guide/using-optimisation.rst
- ghc/GHCi/UI.hs
- hadrian/bindist/Makefile
- hadrian/cabal.project
- hadrian/src/Rules.hs
- hadrian/src/Rules/BinaryDist.hs
- libraries/base/changelog.md
- libraries/base/src/System/Environment.hs
- libraries/base/tests/T15349.stderr
- + libraries/ghc-heap/tests/T27465.hs
- + libraries/ghc-heap/tests/T27465.stdout
- libraries/ghc-heap/tests/all.T
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Event/Control.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Manager.hs
- libraries/ghc-internal/src/GHC/Internal/Event/TimerManager.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
- libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable.hsc
- libraries/ghc-internal/src/GHC/Internal/Heap/InfoTableProf.hsc
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock.hs
- libraries/ghc-internal/tests/backtraces/T14532b.stdout
- nofib
- rts/Apply.cmm
- rts/Capability.c
- rts/Capability.h
- rts/ContinuationOps.cmm
- rts/IOManager.c
- rts/IOManager.h
- rts/IOManagerInternals.h
- rts/PrimOps.cmm
- rts/RaiseAsync.c
- rts/RtsStartup.c
- rts/RtsSymbols.c
- rts/Schedule.c
- rts/Schedule.h
- rts/include/rts/IOInterface.h
- rts/include/rts/storage/Closures.h
- rts/include/rts/storage/TSO.h
- rts/posix/FdWakeup.h
- + rts/posix/MIO.c
- + rts/posix/MIO.h
- rts/posix/Poll.c
- rts/posix/Poll.h
- rts/posix/Select.c
- rts/posix/Select.h
- rts/posix/Signals.c
- rts/posix/Signals.h
- rts/posix/Timeout.c
- rts/posix/Timeout.h
- rts/rts.cabal
- rts/sm/NonMovingMark.c
- rts/win32/AsyncMIO.c
- rts/win32/AsyncMIO.h
- rts/win32/AsyncWinIO.h
- rts/win32/AwaitEvent.c
- rts/win32/AwaitEvent.h
- rts/win32/ConsoleHandler.h
- rts/win32/MIOManager.h
- rts/win32/ThrIOManager.h
- rts/win32/WorkQueue.h
- rts/win32/veh_excn.h
- testsuite/driver/junit.py
- testsuite/driver/perf_notes.py
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/driver/testutil.py
- testsuite/tests/backpack/should_compile/T13149.bkp
- testsuite/tests/cmm/should_run/AtomicFetch.hs
- testsuite/tests/cmm/should_run/AtomicFetch_cmm.cmm
- testsuite/tests/codeGen/should_run/cgrun025.stderr
- + testsuite/tests/corelint/T27374.hs
- testsuite/tests/corelint/all.T
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/determinism/determ017/A.hs
- testsuite/tests/exceptions/T26759.stderr
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/ghc-e/should_fail/T18441fail7.stderr
- testsuite/tests/ghci/scripts/T12005.script
- testsuite/tests/ghci/scripts/bytecodeIPE.hs
- testsuite/tests/ghci/should_run/Makefile
- + testsuite/tests/ghci/should_run/T27287.hs
- + testsuite/tests/ghci/should_run/T27287.stdout
- testsuite/tests/ghci/should_run/all.T
- testsuite/tests/haddock/perf/Fold.hs
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/indexed-types/should_fail/T7354.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/layout/layout001.stdout
- testsuite/tests/layout/layout002.stdout
- testsuite/tests/layout/layout003.stdout
- testsuite/tests/layout/layout004.stdout
- testsuite/tests/layout/layout005.stdout
- testsuite/tests/layout/layout006.stdout
- testsuite/tests/layout/layout007.stdout
- testsuite/tests/layout/layout008.stdout
- testsuite/tests/layout/layout009.stdout
- testsuite/tests/linear/should_compile/T1735Min.hs
- testsuite/tests/mdo/should_fail/mdofail006.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- + testsuite/tests/parser/should_compile/T13087.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20718b.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/parser/should_fail/T8431.stderr
- testsuite/tests/parser/should_fail/readFail038.stderr
- testsuite/tests/perf/compiler/T3064.hs
- + testsuite/tests/pmcheck/should_compile/T27314.hs
- + testsuite/tests/pmcheck/should_compile/T27360.hs
- testsuite/tests/pmcheck/should_compile/all.T
- testsuite/tests/polykinds/T7594.hs
- testsuite/tests/printer/AnnotationNoListTuplePuns.stdout
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/programs/thurston-modular-arith/Main.hs
- + testsuite/tests/rts/T27123.hs
- testsuite/tests/rts/all.T
- testsuite/tests/rts/ipe/IpeStats/Fold.hs
- testsuite/tests/runghc/T7859.stderr-mingw32
- testsuite/tests/simplCore/should_compile/T11562.hs
- testsuite/tests/simplCore/should_run/T3591.hs
- testsuite/tests/typecheck/should_compile/DeepSubsumption02.hs
- testsuite/tests/typecheck/should_compile/T12507.hs
- testsuite/tests/typecheck/should_compile/T13951.hs
- testsuite/tests/typecheck/should_compile/T15242.stderr
- testsuite/tests/typecheck/should_compile/T18920.hs
- testsuite/tests/typecheck/should_compile/T2595.hs
- testsuite/tests/typecheck/should_compile/T7541.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T15067.stderr
- + testsuite/tests/typecheck/should_fail/T26532.hs
- + testsuite/tests/typecheck/should_fail/T26532.stderr
- testsuite/tests/typecheck/should_fail/T6069.stderr
- testsuite/tests/typecheck/should_fail/T7368a.hs
- testsuite/tests/typecheck/should_fail/T9858b.stderr
- testsuite/tests/typecheck/should_fail/TcStaticPointersFail02.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_run/T1735_Help/Basics.hs
- testsuite/tests/typecheck/should_run/T3731-short.hs
- testsuite/tests/typecheck/should_run/T3731.hs
- testsuite/tests/typecheck/should_run/church.hs
- testsuite/tests/typecheck/should_run/tcrun008.hs
- testsuite/tests/typecheck/should_run/tcrun017.hs
- testsuite/tests/typecheck/should_run/tcrun026.hs
- testsuite/tests/typecheck/should_run/tcrun035.hs
- testsuite/tests/typecheck/should_run/tcrun036.hs
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
- utils/deriveConstants/Main.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c5c54179bd65d3fbfdad1235bd0315…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c5c54179bd65d3fbfdad1235bd0315…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc] Pushed new branch wip/TTG-ModuleName
by recursion-ninja (@recursion-ninja) 17 Aug '26
by recursion-ninja (@recursion-ninja) 17 Aug '26
17 Aug '26
recursion-ninja pushed new branch wip/TTG-ModuleName at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/TTG-ModuleName
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/az/exactprint-annotation-rationalisation] 48 commits: loopImports: Don't dup ms_uid in summary imports
by Alan Zimmerman (@alanz) 17 Aug '26
by Alan Zimmerman (@alanz) 17 Aug '26
17 Aug '26
Alan Zimmerman pushed to branch wip/az/exactprint-annotation-rationalisation at Glasgow Haskell Compiler / GHC
Commits:
c130188d by Rodrigo Mesquita at 2026-08-15T06:29:53-04:00
loopImports: Don't dup ms_uid in summary imports
We were writing the ms_unitid of the mod summary with every single
import of that module
That complicated the code (as though the UnitId in that list could ever
be something else) and also allocates unnecessarily per every mod
import. Very slight allocation decrease measured locally in a few tests:
(MultiComponentModulesRecomp: -0.06%; MultiComponentModulesRecomp100: -0.05%)
Purely a clean up.
- - - - -
c71166a8 by Rodrigo Mesquita at 2026-08-15T06:29:53-04:00
downsweep: make control flow simpler and cache correct
This refactor extracts the control flow of downsweep into a single
function `dfsBuild`, which takes care of iteratively expanding and
traversing all nodes of the in-construction module graph necessary to
build a full `ModuleGraph`.
There are three levels of caching going on, all of which are necessary
to make sure we don't do repeated work (notably, NEVER summarise the
same module twice).
1. `dfsBuild` accumulates the final module graph and never revisits the
same node of the module graph. Cache is keyed by the final
`ModuleGraph`s `NodeKey`s.
2. For Module A in home-unit u1, each import in the list of imports
needs to be *found* (call to `findImportedModuleWithIsBoot`): at this
point, we only have the `ModuleName` of the import, not the `Module`.
This *finding* is somewhat expensive, so we cache it as well
(`ImportsCache`). The cache key is the home-unit to which the module
belongs~[1], the import package qualifier, and the ModuleName.
[1] Different home-units will have different package flags, which means
potentially different `Module` resolution for the same `ModuleName`.
3. The most expensive operation we want to avoid is summarising a
`Module` into a `ModSummary`, which notably involves parsing the
module header from scratch.
The third cache, in essence, maps a `Module` to its `ModSummary`
(named `ModSummaryCache`). This cache upholds the invariant: we NEVER
summarise the same module twice. In practice, the cache key is the
Module's UnitId and the Source path; the reason is we need to
distinguish between `.hs` and `.hs-boot` files, as their summaries
will differ.
Note that (2) can't guarantee this alone: Two ModuleName imports in
separate units can (and likely do) map to the same `Module`.
Note that the previous implementation failed to achieve the
no-duplicate-work summarisation invariant, and we ended up doing a
quadratic amount of processing in scenarios like test
`MultiComponentModules100`.
See also Note [Downsweep Control Flow and Caching]
Fixes #27461
Perf changes:
MultiComponentModules(normal) ghc/alloc 2,097,389,264 1,992,186,736 -5.0% GOOD
MultiComponentModules100(normal) ghc/alloc 24,310,173,770 21,293,867,360 -12.4% GOOD
MultiComponentModulesRecomp(normal) ghc/alloc 602,761,394 498,543,984 -17.3% GOOD
MultiComponentModulesRecomp100(normal) ghc/alloc 11,885,968,240 8,895,404,864 -25.2% GOOD
-------------------------
Metric Decrease:
MultiComponentModules
MultiComponentModules100
MultiComponentModulesRecomp
MultiComponentModulesRecomp100
-------------------------
- - - - -
ebc4047b by Rodrigo Mesquita at 2026-08-15T06:29:53-04:00
implicitRequirementsShallow can never reach HoleUnit
findImportedModule will never return `HoleUnit` for a `ModuleName`
(a `HoleUnit` can only be found as a signature instantiation, never as a
directly *imported* thing)
Therefore, we can drop `[ModuleName]` returned by
`implicitRequirementsShallow`, which makes many things dead code.
Namely, the call to `implicitRequirementsShallow` from
GHC.Driver.Downsweep which was a performance bottleneck (for doing lots
of duplicate work in findImportedModule) is now entirely gone.
Fixes #27053
In an MR with this patch and the downsweep refactor (previous commit), CI says:
MultiComponentModules(normal) ghc/alloc 2,097,396,728 1,943,662,304 -7.3% GOOD
MultiComponentModules100(normal) ghc/alloc 24,310,182,136 17,227,574,440 -29.1% GOOD
MultiComponentModulesRecomp(normal) ghc/alloc 602,769,518 449,973,656 -25.3% GOOD
MultiComponentModulesRecomp100(normal) ghc/alloc 11,885,976,408 4,828,894,160 -59.4% GOOD
-------------------------
Metric Decrease:
MultiComponentModules
MultiComponentModules100
MultiComponentModulesRecomp
MultiComponentModulesRecomp100
-------------------------
- - - - -
85a6ab01 by Rodrigo Mesquita at 2026-08-15T06:29:53-04:00
downsweep: Cache negative results
When traversing a module graph structure, a uniquely identified node
should always expand to the same thing.
I don't see how visiting the same node which failed to be expanded a
first time would ever successfully expand the second time we try to
expand it (eg. when coming from a different edge to it -- it is still
the same node!). The node expansion is local, based just based on the
node itself, not on the path to get there.
Therefore, this patch removes the weird behavior and commentary of
`dfsBuild` wrt to `Nothing` not being cached and being potentially
expanded a second time around to something different, which was
misleading and, ultimately, incorrect.
Now, we have a `MGRes`, which is more explicit about a node being
Skipped just being a node that is ignored whenever it is found (and that
skip is cached) -- and we may want to do this due to failures or due to
just trying nodes which might not work on purpose, like hs-boots.
We uniformly cache positive and negative results and remove the
assumption that there might be an ordering in which the same node
visited at a later time might be expanded differently.
This makes it possible to traverse the module nodes in parallel without
a change in behavior, since there's no longer a hidden ordering
requirement.
- - - - -
56747c3f by Rodrigo Mesquita at 2026-08-15T06:29:53-04:00
Organize and clean-up GHC.Driver.Downsweep
Simply some cosmetic changes, moving definitions around to structure the
module better into its relevant sections
(In go (ns ++ ss), it's not a problem to use ++ because it's a good
producer and we won't have to append fully before processing the next
item in go)
- - - - -
12f64118 by Wolfgang Jeltsch at 2026-08-15T06:31:12-04:00
Add support for textual output of bytecode file content
- - - - -
a737df91 by Brandon Chinn at 2026-08-15T12:40:25-04:00
Add law in qualified strings doc
- - - - -
e3188581 by Zubin Duggal at 2026-08-15T12:41:06-04:00
DmdAnal: Fix maxDmdType
We need to eta expand the smaller DmdType using defaultArgDmd, like in lubDmdType.
Introduce zipDmdType as a common combinator to implement both maxDmdType and lubDmdType
uniformly.
fixes #27626
- - - - -
ca9b0b22 by mangoiv at 2026-08-15T12:41:47-04:00
hadrian: set the executable bit for hie-bios.bat
- - - - -
1aac7095 by sheaf at 2026-08-16T04:37:16-04:00
Avoid wasteful allocations in mkTyConAppCo
The idiom "traverse isReflCo_maybe" followed by "map fst" used in
'GHC.Core.Coercion.mkTyConAppCo' was allocating a lot of waste.
This commit uses 'GHC.Data.Unboxed.traverseMaybeUB' to avoid all these
unnecessary intermediate allocations.
In a quick microbenchmark for 'mkTyConAppCo', this change resulted in:
- refl case (all argument coercions are reflexive):
- -60% runtime
- -80% allocations
- non-refl case:
- from 0% to -12% runtime (depending on which argument is non-refl)
- from 0% to -70% allocations ( -- '' -- )
Fixes #27648
-------------------------
Metric Decrease:
FamAppCachePerf
SimplCastPerf
T12425
T15703
T26426
T3064
T9872a
T9872b
T9872b_defer
T9872c
T9872d
T5321Fun
T9020
T9630
TcPlugin_RewritePerf
Metric Increase:
LinkableUsage02
-------------------------
- - - - -
3915e982 by Alan Zimmerman at 2026-08-16T04:37:58-04:00
EPA: Remove al_trailing from AnnList
It was not being used
- - - - -
fed942ac by Andreas Klebinger at 2026-08-17T12:11:57-04:00
testsuite: Use sigkill in process009.
SIGHUB might have been blocked by a (grand)*parent of the test.
In such cases the test would fail as the python process would simply
exist gracefully instead of committing to a premature end.
By using SIGKILL we can rely on the signal not being blocked, fixing #27578
in the process.
- - - - -
574c875f by Andreas Klebinger at 2026-08-17T12:12:39-04:00
Simplify comparison in DFM.hs
Fixes #27669
- - - - -
d8f1a2a3 by Alan Zimmerman at 2026-08-17T12:13:18-04:00
TTG: Add extension points to BooleanFormula
They are currently unused, but will be used for exact print
annotations next, allowing us to get rid of LocatedBF / SrcSpanAnnBF
- - - - -
9a82d258 by Alan Zimmerman at 2026-08-17T19:25:52+01:00
EPA: Remove LocatedBC / SrcSpanBF
The custom annotations are now in the BooleanFormula TTG extension
points, so LBooleanFormula can now use the standard LocatedA.
- - - - -
c58f6867 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: remove unused addTrailingAnnToL. Squash appropriately
- - - - -
0feb735d by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPS: Remove NoEpTok/NoEpUniTok, using an unhelpful SrcSpan instead
Also introduce helper functions noEpTok and noEpUniTok to serve
as simple replacements in code inserting an token annotation without
location information.
- - - - -
d3af13a3 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Some haddock processing tweaks
- - - - -
0feaf34d by Alan Zimmerman at 2026-08-17T19:26:59+01:00
Some haddock exactprint tests
- - - - -
243430f8 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: When adding comments honour trailing anns
- - - - -
d410e63c by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Uses Parsers.parseModule for exactprint tests
This is the advertised way to parse for use for exact printing in the
ghc-exactprint library, make sure we test using it.
- - - - -
ea7a19f3 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA Fix HsCmdDo exact print with comments
TODO: add test based on proc-do-complex-four-out.hs
- - - - -
3ed851b0 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Add comments about remaining Anno SrcSpan instances
- - - - -
3aa090d6 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Plan for Fixing AnnList Layout Properly
- - - - -
74849f3e by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Remove ListBanana / ListParens from AnnListBrackets
- - - - -
19b5c3d2 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Tidy up mkHsDoPv, take AnnList directly
And some extra stuff by accident.
The main goal is to slim down AnnListBrackets to just have braces or
none.
This makes it clear that it serves only for lists which may have layout,
and opens the route to use EpLayout instead of AnnListBrackets
- - - - -
835ebf03 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Add specific layout field to AnnList
- - - - -
94b8264a by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Use EpaLocation in EpVirtualBraces
reword:
EPA Use vocurly as basis for AnnListLayout
For the existing cases that populate AnnList.
This also shows up AnnList usages that can never capture layout.
- - - - -
ef1b285b by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA Use vocurly as basis for AnnListLayout
For the existing cases that populate AnnList.
This also shows up AnnList usages that can never capture layout.
- - - - -
336af5b0 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: AnnList clean up patch for empty where clause
- - - - -
959ab6e3 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Add TTG fields to FamilyInfo
This commit is a simple add, with unused extension fields.
It lays the groundwork for using them for exact print annotations
- - - - -
808b9851 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
WIP annclassdecl
- - - - -
28589c84 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Update AnnClsInstDecl to contain AnnList
It was already separately tracking the '{', '}' and leading ';' values.
This aligns it with layout-introducing parser productions ('vocurly'),
so the layout processing can be handled uniformly
- - - - -
b0b3106c by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Tidy up markAnnListA'
It takes an action which can modify the AnnList, but this
is never used. So remove it.
- - - - -
acd033f2 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Use AnnList for GADT declarations
- - - - -
e2509e78 by Alan Zimmerman at 2026-08-17T19:26:59+01:00
EPA: Use AnnList in AnnClassDecl
- - - - -
8444d44e by Alan Zimmerman at 2026-08-17T19:37:00+01:00
EPA: Make local binds located
Use LHsLocalBinds instead of HsLocalBinds
This reverses an earlier change, and brings processing of local binds
into alignement with the exact printing principle that the LocatedA
contents provide the location and extent of the enclosed item,
together with any comments or context-specific trailing items like
commas or semi colons.
The internal TTG extension points only carry exact print annotations
related to printing the item within its bounds.
This change brings back the problem of EmptyLocalBinds, which by
definition cannot have a location. These get a noSrcSpan location,
which is ignored in the exact printing process.
- - - - -
8f2ad624 by Alan Zimmerman at 2026-08-17T19:37:00+01:00
EPA: Use AnnList in HsMultiIf
It introduces layout, capture it
- - - - -
2618238b by Alan Zimmerman at 2026-08-17T19:37:00+01:00
EPA: Use AnnList in DecBrl
- - - - -
a0b0d98d by Alan Zimmerman at 2026-08-17T21:39:38+01:00
EPA: Replace AnnListLayout / AnnListBrackets with EpLayout
- - - - -
51af2cd1 by Alan Zimmerman at 2026-08-17T23:27:08+01:00
WIP: setLayoutBoth inside markAnnListA
Current problem is it is a global one-shot, and MG has one too
Check: is it needed?
if so, honouring EpLayout may be needed
- - - - -
b2876e77 by Alan Zimmerman at 2026-08-17T23:27:08+01:00
Update AnnList plan. do not put into MR
- - - - -
c7ff8d0a by Alan Zimmerman at 2026-08-17T23:27:08+01:00
EPA: First pass implementation of HsList, for ClassDecls
Just as a straight list replacement to start with, no payload.
This shows the scope and invasiveness of the initial change
- - - - -
39b59224 by Alan Zimmerman at 2026-08-17T23:27:08+01:00
EPA: HsList attempt WIP
- - - - -
dd2560bf by Alan Zimmerman at 2026-08-17T23:27:08+01:00
Enable ppr test for Haddock1. It currently fails
- - - - -
91918304 by Alan Zimmerman at 2026-08-17T23:27:08+01:00
WIP on removing NoEpAnn. Likely abandon
- - - - -
0b77f7c3 by Alan Zimmerman at 2026-08-17T23:27:08+01:00
EPA: Add an overview doc for exact printing
- - - - -
57acfce1 by Simon Peyton Jones at 2026-08-17T23:27:08+01:00
Added an intro section
- - - - -
153 changed files:
- + ANNLIST-LAYOUT-PLAN.md
- + ExactPrint.md
- + changelog.d/27626
- + changelog.d/downsweep-refactor
- + changelog.d/show-byte-code
- compiler/GHC/ByteCode/Serialize.hs
- + compiler/GHC/ByteCode/Show.hs
- compiler/GHC/Core/Class.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Data/BooleanFormula.hs
- compiler/GHC/Data/Unboxed.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Lazy.hs
- compiler/GHC/Data/Word64Map/Strict.hs
- compiler/GHC/Data/Word64Map/Strict/Internal.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Main/Interactive.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Extension/Pass.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Stats.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Expr.hs-boot
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Tc/Deriv/Functor.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Class.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Unit/Env.hs
- compiler/Language/Haskell/Syntax.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/BooleanFormula.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/ghc.cabal.in
- docs/users_guide/exts/qualified_strings.rst
- docs/users_guide/using.rst
- ghc/GHC/Driver/Session/Mode.hs
- ghc/GHCi/UI.hs
- ghc/Main.hs
- hadrian/hie-bios.bat
- testsuite/tests/count-deps/CountDepsParser.stdout
- + testsuite/tests/dmdanal/should_run/M2.hs
- + testsuite/tests/dmdanal/should_run/T27626.hs
- + testsuite/tests/dmdanal/should_run/T27626.stdout
- testsuite/tests/dmdanal/should_run/all.T
- + testsuite/tests/driver/T27461/Main1.hs
- + testsuite/tests/driver/T27461/Main2.hs
- + testsuite/tests/driver/T27461/Makefile
- + testsuite/tests/driver/T27461/T27461a.stderr
- + testsuite/tests/driver/T27461/T27461b.script
- + testsuite/tests/driver/T27461/T27461b.stderr
- + testsuite/tests/driver/T27461/T27461b.stdout
- + testsuite/tests/driver/T27461/all.T
- + testsuite/tests/driver/T27461/src/Bar.hs
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/ghc-api/fixed-nodes/FixedNodes.hs
- testsuite/tests/ghc-api/fixed-nodes/InterfaceModuleGraph.hs
- testsuite/tests/ghc-api/fixed-nodes/ModuleGraphInvariants.hs
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20718b.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/perf/compiler/hard_hole_fits.stderr
- testsuite/tests/printer/AnnotationNoListTuplePuns.stdout
- + testsuite/tests/printer/Haddock1.hs
- testsuite/tests/printer/Makefile
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/printer/all.T
- testsuite/tests/process/process009.hs
- testsuite/tests/process/process009.stdout
- + testsuite/tests/show-bytecode/Example.hs
- + testsuite/tests/show-bytecode/Makefile
- + testsuite/tests/show-bytecode/all.T
- + testsuite/tests/show-bytecode/normalize
- + testsuite/tests/show-bytecode/show-bytecode-breakpoints.stdout
- + testsuite/tests/show-bytecode/show-bytecode-breakpoints.stdout-javascript-unknown-ghcjs
- + testsuite/tests/show-bytecode/show-bytecode-hpc.stdout
- + testsuite/tests/show-bytecode/show-bytecode-vanilla.stdout
- + testsuite/tests/show-bytecode/show-bytecode-vanilla.stdout-javascript-unknown-ghcjs
- testsuite/tests/splice-imports/SI35.hs
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Parsers.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
- utils/check-ppr/Main.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c5fc327eca1bc6a7853ed4f2d20e0c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c5fc327eca1bc6a7853ed4f2d20e0c…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: testsuite: Use sigkill in process009.
by Marge Bot (@marge-bot) 17 Aug '26
by Marge Bot (@marge-bot) 17 Aug '26
17 Aug '26
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
fed942ac by Andreas Klebinger at 2026-08-17T12:11:57-04:00
testsuite: Use sigkill in process009.
SIGHUB might have been blocked by a (grand)*parent of the test.
In such cases the test would fail as the python process would simply
exist gracefully instead of committing to a premature end.
By using SIGKILL we can rely on the signal not being blocked, fixing #27578
in the process.
- - - - -
574c875f by Andreas Klebinger at 2026-08-17T12:12:39-04:00
Simplify comparison in DFM.hs
Fixes #27669
- - - - -
d8f1a2a3 by Alan Zimmerman at 2026-08-17T12:13:18-04:00
TTG: Add extension points to BooleanFormula
They are currently unused, but will be used for exact print
annotations next, allowing us to get rid of LocatedBF / SrcSpanAnnBF
- - - - -
c556ed58 by Andreas Klebinger at 2026-08-17T17:50:10-04:00
Fix a number of incorrect module references:
Fix module reference in Note [DataCon wrappers are conlike].
Fix module reference in Note [Detailed InertCans Invariants].
Fix module reference in Note [GHC's data format representations].
Fix module reference in Note [Grand plan for static forms].
Fix module reference in Note [How tuples work].
Fix module reference in Note [Solved dictionaries].
Fix module reference in Note [Stacktraces from Info Table Provenance Entries (IPE based stack unwinding)].
Fix module reference in Note [The VarBndr type and its uses].
Found the incorrect references with a llm.
- - - - -
bb344b5f by Simon Jakobi at 2026-08-17T17:50:11-04:00
ci: Run stack-hadrian-build only in full-ci pipelines
The job exists to catch changes that break hadrian/build-stack (#18726),
but nothing in the pipeline depends on it, and it can only break when
hadrian's dependencies change. Restricting it to full-ci (like
hadrian-multi) still covers marge-bot merge batches, so such breakage
cannot reach master unnoticed, while ordinary validate pipelines skip
the job.
Assisted-by: Claude Fable 5
- - - - -
29 changed files:
- .gitlab-ci.yml
- compiler/GHC/Builtin/WiredIn/Types.hs
- compiler/GHC/CmmToAsm/Format.hs
- compiler/GHC/Core/Class.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Data/BooleanFormula.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Lazy.hs
- compiler/GHC/Data/Word64Map/Strict.hs
- compiler/GHC/Data/Word64Map/Strict/Internal.hs
- compiler/GHC/Driver/GenerateCgIPEStub.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy/StaticPtrTable.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Parser.y
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/TyCl/Class.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Types/Var.hs
- compiler/Language/Haskell/Syntax/BooleanFormula.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- testsuite/tests/process/process009.hs
- testsuite/tests/process/process009.stdout
- utils/check-exact/ExactPrint.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -552,6 +552,8 @@ stack-hadrian-build:
- . .gitlab/ci.sh setup
- . .gitlab/ci.sh configure
- hadrian/build-stack --version
+ rules:
+ - *full-ci
####################################
# Testing reinstallable ghc codepath
=====================================
compiler/GHC/Builtin/WiredIn/Types.hs
=====================================
@@ -783,7 +783,7 @@ typeSymbolKind = mkTyConTy typeSymbolKindCon
Note [How tuples work]
~~~~~~~~~~~~~~~~~~~~~~
* There are three families of tuple TyCons and corresponding
- DataCons, expressed by the type BasicTypes.TupleSort:
+ DataCons, expressed by the type GHC.Types.Basic.TupleSort:
data TupleSort = BoxedTuple | UnboxedTuple | ConstraintTuple
* All three families are AlgTyCons, whose AlgTyConRhs is TupleTyCon
@@ -818,7 +818,7 @@ Note [How tuples work]
stores them in the context field of types like HsQualTy.
* In quite a lot of places things are restricted just to
- BoxedTuple/UnboxedTuple, and then we used BasicTypes.Boxity to distinguish
+ BoxedTuple/UnboxedTuple, and then we used GHC.Types.Basic.Boxity to distinguish
E.g. tupleTyCon has a Boxity argument
* When looking up an OccName in the original-name cache
=====================================
compiler/GHC/CmmToAsm/Format.hs
=====================================
@@ -52,20 +52,20 @@ import GHC.Utils.Panic
GHC has severals types that represent various aspects of data format.
These include:
- * 'CmmType.CmmType': The data classification used throughout the C--
+ * 'GHC.Cmm.Type.CmmType': The data classification used throughout the C--
pipeline. This is a pair of a CmmCat and a Width.
- * 'CmmType.CmmCat': What the bits in a C-- value mean (e.g. a pointer, integer, or floating-point value)
+ * 'GHC.Cmm.Type.CmmCat': What the bits in a C-- value mean (e.g. a pointer, integer, or floating-point value)
- * 'CmmType.Width': The width of a C-- value.
+ * 'GHC.Cmm.Type.Width': The width of a C-- value.
- * 'CmmType.Length': The width (measured in number of scalars) of a vector value.
+ * 'GHC.Cmm.Type.Length': The width (measured in number of scalars) of a vector value.
* 'Format.Format': The data format representation used by much of the backend.
- * 'Format.ScalarFormat': The format of a 'Format.VecFormat'\'s scalar.
+ * 'GHC.CmmToAsm.Format.ScalarFormat': The format of a 'GHC.CmmToAsm.Format.VecFormat'\'s scalar.
- * 'RegClass.RegClass': Whether a register is an integer or a floating point/vector register.
+ * 'GHC.Platform.Reg.Class.RegClass': Whether a register is an integer or a floating point/vector register.
-}
-- It looks very like the old MachRep, but it's now of purely local
=====================================
compiler/GHC/Core/Class.hs
=====================================
@@ -41,6 +41,7 @@ import GHC.Utils.Panic
import GHC.Types.SrcLoc
import GHC.Types.Var.Set
import GHC.Utils.Outputable
+import GHC.Data.BooleanFormula () -- for BooleanFormulaDefault instance
import Language.Haskell.Syntax.BooleanFormula ( BooleanFormula, mkTrue )
import qualified Data.Data as Data
=====================================
compiler/GHC/CoreToIface.hs
=====================================
@@ -542,10 +542,11 @@ toIfGuidance src guidance
toIfaceBooleanFormula :: BF.BooleanFormula GhcRn -> IfaceBooleanFormula
toIfaceBooleanFormula = go
where
- go (BF.Var nm ) = IfVar $ mkIfLclName . getOccFS . unLoc $ nm
- go (BF.And bfs ) = IfAnd $ map (go . unLoc) bfs
- go (BF.Or bfs ) = IfOr $ map (go . unLoc) bfs
- go (BF.Parens bf) = IfParens $ (go . unLoc) bf
+ go (BF.Var _ nm ) = IfVar $ mkIfLclName . getOccFS . unLoc $ nm
+ go (BF.And _ bfs ) = IfAnd $ map (go . unLoc) bfs
+ go (BF.Or _ bfs ) = IfOr $ map (go . unLoc) bfs
+ go (BF.Parens _ bf) = IfParens $ (go . unLoc) bf
+ go (BF.XBooleanFormula _) = panic "toIfaceBooleanFormula"
{-
************************************************************************
=====================================
compiler/GHC/Data/BooleanFormula.hs
=====================================
@@ -27,7 +27,10 @@ import GHC.Types.SrcLoc (unLoc)
import GHC.Utils.Outputable
import GHC.Parser.Annotation ( SrcSpanAnnBF )
import GHC.Hs.Extension (GhcPass (..), OutputableBndrId)
-import Language.Haskell.Syntax.Extension (Anno, LIdP, IdP)
+import Language.Haskell.Syntax.Extension (Anno, LIdP, IdP,
+ noExtField, NoExtField, DataConCantHappen,
+ XBFVar, XBFAnd, XBFOr, XBFParens,
+ XXBooleanFormula)
import Language.Haskell.Syntax.BooleanFormula
@@ -37,6 +40,17 @@ import Language.Haskell.Syntax.BooleanFormula
type instance Anno (BooleanFormula (GhcPass p)) = SrcSpanAnnBF
+type instance XBFVar (GhcPass _) = NoExtField
+type instance XBFAnd (GhcPass _) = NoExtField
+type instance XBFOr (GhcPass _) = NoExtField
+type instance XBFParens (GhcPass _) = NoExtField
+type instance XXBooleanFormula (GhcPass _) = DataConCantHappen
+
+instance BooleanFormulaDefault (GhcPass p) where
+ bfAnnAnd = noExtField
+ bfAnnOr = noExtField
+
+
-- if we had Functor/Traversable (LbooleanFormula p) we could use that
-- as a constraint and we wouldn't need to specialize to just GhcPass p,
-- but becuase LBooleanFormula is a type synonym such a constraint is
@@ -49,10 +63,10 @@ bfMap :: (LIdP (GhcPass p) -> LIdP (GhcPass p'))
-> BooleanFormula (GhcPass p) -> BooleanFormula (GhcPass p')
bfMap f = go
where
- go (Var a ) = Var $ f a
- go (And bfs) = And $ map (fmap go) bfs
- go (Or bfs) = Or $ map (fmap go) bfs
- go (Parens bf ) = Parens $ fmap go bf
+ go (Var x a ) = Var x $ f a
+ go (And x bfs) = And x $ map (fmap go) bfs
+ go (Or x bfs) = Or x $ map (fmap go) bfs
+ go (Parens x bf ) = Parens x $ fmap go bf
bfTraverse :: Applicative f
=> (LIdP (GhcPass p) -> f (LIdP (GhcPass p')))
@@ -60,10 +74,10 @@ bfTraverse :: Applicative f
-> f (BooleanFormula (GhcPass p'))
bfTraverse f = go
where
- go (Var a ) = Var <$> f a
- go (And bfs) = And <$> traverse @[] (traverse go) bfs
- go (Or bfs) = Or <$> traverse @[] (traverse go) bfs
- go (Parens bf ) = Parens <$> traverse go bf
+ go (Var x a ) = Var x <$> f a
+ go (And x bfs) = And x <$> traverse @[] (traverse go) bfs
+ go (Or x bfs) = Or x <$> traverse @[] (traverse go) bfs
+ go (Parens x bf ) = Parens x <$> traverse go bf
@@ -106,18 +120,18 @@ We don't show a ridiculous error message like
----------------------------------------------------------------------
isFalse :: BooleanFormula (GhcPass p) -> Bool
-isFalse (Or []) = True
+isFalse (Or _ []) = True
isFalse _ = False
isTrue :: BooleanFormula (GhcPass p) -> Bool
-isTrue (And []) = True
+isTrue (And _ []) = True
isTrue _ = False
eval :: (LIdP (GhcPass p) -> Bool) -> BooleanFormula (GhcPass p) -> Bool
-eval f (Var x) = f x
-eval f (And xs) = all (eval f . unLoc) xs
-eval f (Or xs) = any (eval f . unLoc) xs
-eval f (Parens x) = eval f (unLoc x)
+eval f (Var _ x) = f x
+eval f (And _ xs) = all (eval f . unLoc) xs
+eval f (Or _ xs) = any (eval f . unLoc) xs
+eval f (Parens _ x) = eval f (unLoc x)
-- Simplify a boolean formula.
-- The argument function should give the truth of the atoms, or Nothing if undecided.
@@ -125,12 +139,12 @@ simplify :: forall p. Eq (LIdP (GhcPass p))
=> (LIdP (GhcPass p) -> Maybe Bool)
-> BooleanFormula (GhcPass p)
-> BooleanFormula (GhcPass p)
-simplify f (Var a) = case f a of
- Nothing -> Var a
+simplify f (Var x a) = case f a of
+ Nothing -> Var x a
Just b -> mkBool b
-simplify f (And xs) = mkAnd (map (fmap (simplify f)) xs)
-simplify f (Or xs) = mkOr (map (fmap (simplify f)) xs)
-simplify f (Parens x) = simplify f (unLoc x)
+simplify f (And _ xs) = mkAnd (map (fmap (simplify f)) xs)
+simplify f (Or _ xs) = mkOr (map (fmap (simplify f)) xs)
+simplify f (Parens _ x) = simplify f (unLoc x)
-- Test if a boolean formula is satisfied when the given values are assigned to the atoms
-- if it is, returns Nothing
@@ -152,11 +166,11 @@ isUnsatisfied f bf
-- If the boolean formula holds, does that mean that the given atom is always true?
impliesAtom :: Eq (IdP (GhcPass p)) => BooleanFormula (GhcPass p) -> LIdP (GhcPass p) -> Bool
-Var x `impliesAtom` y = (unLoc x) == (unLoc y)
-And xs `impliesAtom` y = any (\x -> unLoc x `impliesAtom` y) xs
- -- we have all of xs, so one of them implying y is enough
-Or xs `impliesAtom` y = all (\x -> unLoc x `impliesAtom` y) xs
-Parens x `impliesAtom` y = unLoc x `impliesAtom` y
+Var _ x `impliesAtom` y = (unLoc x) == (unLoc y)
+And _ xs `impliesAtom` y = any (\x -> unLoc x `impliesAtom` y) xs
+ -- we have all of xs, so one of them implying y is enough
+Or _ xs `impliesAtom` y = all (\x -> unLoc x `impliesAtom` y) xs
+Parens _ x `impliesAtom` y = unLoc x `impliesAtom` y
implies :: (Uniquable (IdP (GhcPass p))) => BooleanFormula (GhcPass p) -> BooleanFormula (GhcPass p) -> Bool
implies e1 e2 = go (Clause emptyUniqSet [e1]) (Clause emptyUniqSet [e2])
@@ -164,18 +178,18 @@ implies e1 e2 = go (Clause emptyUniqSet [e1]) (Clause emptyUniqSet [e2])
go :: Uniquable (IdP (GhcPass p)) => Clause (GhcPass p) -> Clause (GhcPass p) -> Bool
go l@Clause{ clauseExprs = hyp:hyps } r =
case hyp of
- Var x | memberClauseAtoms (unLoc x) r -> True
- | otherwise -> go (extendClauseAtoms l (unLoc x)) { clauseExprs = hyps } r
- Parens hyp' -> go l { clauseExprs = unLoc hyp':hyps } r
- And hyps' -> go l { clauseExprs = map unLoc hyps' ++ hyps } r
- Or hyps' -> all (\hyp' -> go l { clauseExprs = unLoc hyp':hyps } r) hyps'
+ Var _ x | memberClauseAtoms (unLoc x) r -> True
+ | otherwise -> go (extendClauseAtoms l (unLoc x)) { clauseExprs = hyps } r
+ Parens _ hyp' -> go l { clauseExprs = unLoc hyp':hyps } r
+ And _ hyps' -> go l { clauseExprs = map unLoc hyps' ++ hyps } r
+ Or _ hyps' -> all (\hyp' -> go l { clauseExprs = unLoc hyp':hyps } r) hyps'
go l r@Clause{ clauseExprs = con:cons } =
case con of
- Var x | memberClauseAtoms (unLoc x) l -> True
- | otherwise -> go l (extendClauseAtoms r (unLoc x)) { clauseExprs = cons }
- Parens con' -> go l r { clauseExprs = unLoc con':cons }
- And cons' -> all (\con' -> go l r { clauseExprs = unLoc con':cons }) cons'
- Or cons' -> go l r { clauseExprs = map unLoc cons' ++ cons }
+ Var _ x | memberClauseAtoms (unLoc x) l -> True
+ | otherwise -> go l (extendClauseAtoms r (unLoc x)) { clauseExprs = cons }
+ Parens _ con' -> go l r { clauseExprs = unLoc con':cons }
+ And _ cons' -> all (\con' -> go l r { clauseExprs = unLoc con':cons }) cons'
+ Or _ cons' -> go l r { clauseExprs = map unLoc cons' ++ cons }
go _ _ = False
-- A small sequent calculus proof engine.
@@ -201,12 +215,12 @@ pprBooleanFormula' :: (Rational -> LIdP (GhcPass p) -> SDoc)
-> Rational -> BooleanFormula (GhcPass p) -> SDoc
pprBooleanFormula' pprVar pprAnd pprOr = go
where
- go p (Var x) = pprVar p x
- go p (And []) = cparen (p > 0) empty
- go p (And xs) = pprAnd p (map (go 3 . unLoc) xs)
- go _ (Or []) = keyword $ text "FALSE"
- go p (Or xs) = pprOr p (map (go 2 . unLoc) xs)
- go p (Parens x) = go p (unLoc x)
+ go p (Var _ x) = pprVar p x
+ go p (And _ []) = cparen (p > 0) empty
+ go p (And _ xs) = pprAnd p (map (go 3 . unLoc) xs)
+ go _ (Or _ []) = keyword $ text "FALSE"
+ go p (Or _ xs) = pprOr p (map (go 2 . unLoc) xs)
+ go p (Parens _ x) = go p (unLoc x)
-- Pretty print in source syntax, "a | b | c,d,e"
pprBooleanFormula :: (Rational -> LIdP (GhcPass p) -> SDoc)
@@ -233,8 +247,9 @@ instance OutputableBndrId p => Outputable (BooleanFormula (GhcPass p)) where
pprBooleanFormulaNormal :: OutputableBndrId p => BooleanFormula (GhcPass p) -> SDoc
pprBooleanFormulaNormal = go
where
- go (Var x) = pprPrefixOcc (unLoc x)
- go (And xs) = fsep $ punctuate comma (map (go . unLoc) xs)
- go (Or []) = keyword $ text "FALSE"
- go (Or xs) = fsep $ intersperse vbar (map (go . unLoc) xs)
- go (Parens x) = parens (go $ unLoc x)
+ go (Var _ x) = pprPrefixOcc (unLoc x)
+ go (And _ xs) = fsep $ punctuate comma (map (go . unLoc) xs)
+ go (Or _ []) = keyword $ text "FALSE"
+ go (Or _ xs) = fsep $ intersperse vbar (map (go . unLoc) xs)
+ go (Parens _ x) = parens (go $ unLoc x)
+ go (XBooleanFormula _) = text "XBooleanFormula"
=====================================
compiler/GHC/Data/Word64Map/Internal.hs
=====================================
@@ -72,6 +72,7 @@ module GHC.Data.Word64Map.Internal (
-- * Query
, null
, size
+ , sizeAtMost
, compareSize
, member
, notMember
@@ -533,6 +534,10 @@ size = go 0
go acc (Tip _ _) = 1 + acc
go acc Nil = acc
+-- | Check if the map is <= n in O(min(|map|,n))
+sizeAtMost :: Word64Map a -> Int -> Bool
+sizeAtMost map n = compareSize map n /= GT
+
-- | \(O(\min(n,c))\). Compare the number of entries in the map to an @Int@.
--
-- @compareSize m c@ returns the same result as @compare ('size' m) c@ but is
=====================================
compiler/GHC/Data/Word64Map/Lazy.hs
=====================================
@@ -113,6 +113,7 @@ module GHC.Data.Word64Map.Lazy (
-- ** Size
, WM.null
, size
+ , sizeAtMost
, compareSize
-- * Combine
=====================================
compiler/GHC/Data/Word64Map/Strict.hs
=====================================
@@ -130,6 +130,7 @@ module GHC.Data.Word64Map.Strict (
-- ** Size
, null
, size
+ , sizeAtMost
, compareSize
-- * Combine
=====================================
compiler/GHC/Data/Word64Map/Strict/Internal.hs
=====================================
@@ -132,6 +132,7 @@ module GHC.Data.Word64Map.Strict.Internal (
-- ** Size
, null
, size
+ , sizeAtMost
, compareSize
-- * Combine
@@ -324,6 +325,7 @@ import GHC.Data.Word64Map.Internal
, spanAntitone
, restrictKeys
, size
+ , sizeAtMost
, compareSize
, split
, splitLookup
=====================================
compiler/GHC/Driver/GenerateCgIPEStub.hs
=====================================
@@ -62,7 +62,7 @@ looking up source locations for stack info tables in the map generated during th
The rest of this note will document exactly how the first pass generates the map from labels to
estimated source positions. The algorithms are different depending on whether tables-next-to-code
-is on or off. Both algorithms have in common that we are looking for a `CmmNode.CmmTick`
+is on or off. Both algorithms have in common that we are looking for a `GHC.Cmm.Node.CmmTick`
(containing a `SourceNote`) that is near what we estimate to be the label of a return stack frame.
With tables-next-to-code
@@ -112,14 +112,14 @@ open or closed on exit (one can fallthrough from them to the next node).
Please refer to the paper "Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation"
for a detailed explanation.
-Here we use the fact, that calls (represented by `CmmNode.CmmCall`) are always closed on exit
+Here we use the fact, that calls (represented by `GHC.Cmm.Node.CmmCall`) are always closed on exit
(`CmmNode O C`, `O` means open, `C` closed). In other words, they are always at the end of a block.
So, given a `CmmGraph`:
- - Look at the end of every block: If it is a `CmmNode.CmmCall` returning to some label, lookup
- the nearest `CmmNode.CmmTick` by traversing the middle part of the block backwards (from end to
+ - Look at the end of every block: If it is a `GHC.Cmm.Node.CmmCall` returning to some label, lookup
+ the nearest `GHC.Cmm.Node.CmmTick` by traversing the middle part of the block backwards (from end to
beginning).
- - Take the first `CmmNode.CmmTick` that contains a `Tickish.SourceNote` and map the label we
+ - Take the first `GHC.Cmm.Node.CmmTick` that contains a `Tickish.SourceNote` and map the label we
found to it's payload as an `IpeSourceLocation`. (There are other `Tickish` constructors like
`ProfNote` or `HpcTick`, these are ignored.)
=====================================
compiler/GHC/Iface/Ext/Ast.hs
=====================================
@@ -2083,16 +2083,16 @@ instance ToHie PendingRnSplice where
instance (HiePass p, Data (IdGhcP p))
=> ToHie (GenLocated SrcSpanAnnBF (BooleanFormula (GhcPass p))) where
toHie (L span form) = concatM $ makeNode form (locA span) : case form of
- Var a ->
+ Var _ a ->
[ toHie $ C Use a
]
- And forms ->
+ And _ forms ->
[ toHie forms
]
- Or forms ->
+ Or _ forms ->
[ toHie forms
]
- Parens f ->
+ Parens _ f ->
[ toHie f
]
=====================================
compiler/GHC/Iface/Syntax.hs
=====================================
@@ -103,6 +103,7 @@ import GHC.Data.FastString
import GHC.Data.BooleanFormula (pprBooleanFormula, isTrue)
import Language.Haskell.Syntax.BooleanFormula(BooleanFormula(..))
+import Language.Haskell.Syntax.Extension (noExtField)
import Language.Haskell.Syntax.Text
import Control.Monad
@@ -1326,10 +1327,10 @@ pprIfaceDecl ss decl@(IfaceClass { ifName = clas
fromIfaceBooleanFormula :: IfaceBooleanFormula -> BooleanFormula GhcRn
-- `mkUnboundName` here is fine because the Name generated is only used for pretty printing and nothing else.
- fromIfaceBooleanFormula (IfVar nm ) = Var $ noLocA . mkUnboundName . mkVarOccFS . ifLclNameFS $ nm
- fromIfaceBooleanFormula (IfAnd bfs ) = And $ map (noLocA . fromIfaceBooleanFormula) bfs
- fromIfaceBooleanFormula (IfOr bfs ) = Or $ map (noLocA . fromIfaceBooleanFormula) bfs
- fromIfaceBooleanFormula (IfParens bf) = Parens $ (noLocA . fromIfaceBooleanFormula) bf
+ fromIfaceBooleanFormula (IfVar nm ) = Var noExtField $ noLocA . mkUnboundName . mkVarOccFS . ifLclNameFS $ nm
+ fromIfaceBooleanFormula (IfAnd bfs ) = And noExtField $ map (noLocA . fromIfaceBooleanFormula) bfs
+ fromIfaceBooleanFormula (IfOr bfs ) = Or noExtField $ map (noLocA . fromIfaceBooleanFormula) bfs
+ fromIfaceBooleanFormula (IfParens bf) = Parens noExtField $ (noLocA . fromIfaceBooleanFormula) bf
-- See Note [Suppressing binder signatures] in GHC.Iface.Type
=====================================
compiler/GHC/Iface/Tidy/StaticPtrTable.hs
=====================================
@@ -82,7 +82,7 @@ Here is a running example:
(SF4) The desugarer replaces a nested expression (static e) with a top-level
binding for an application of the function 'makeStatic' (defined in module
- GHC.StaticPtr.Internal of base). So we get
+ GHC.Internal.StaticPtr.Internal of base). So we get
s = /\abc. makeStatic location e
f x = ...(fromStaticPtr s)...
=====================================
compiler/GHC/IfaceToCore.hs
=====================================
@@ -883,10 +883,10 @@ tc_iface_decl _parent ignore_prags
return (ATI tc mb_def)
tc_boolean_formula :: IfaceBooleanFormula -> IfL (BooleanFormula GhcRn)
- tc_boolean_formula (IfAnd ibfs ) = BF.And . map noLocA <$> traverse tc_boolean_formula ibfs
- tc_boolean_formula (IfOr ibfs ) = BF.Or . map noLocA <$> traverse tc_boolean_formula ibfs
- tc_boolean_formula (IfParens ibf) = BF.Parens . noLocA <$> tc_boolean_formula ibf
- tc_boolean_formula (IfVar nm ) = BF.Var . noLocA <$> (lookupIfaceTop . mkVarOccFS . ifLclNameFS $ nm)
+ tc_boolean_formula (IfAnd ibfs ) = BF.And NoExtField . map noLocA <$> traverse tc_boolean_formula ibfs
+ tc_boolean_formula (IfOr ibfs ) = BF.Or NoExtField . map noLocA <$> traverse tc_boolean_formula ibfs
+ tc_boolean_formula (IfParens ibf) = BF.Parens NoExtField . noLocA <$> tc_boolean_formula ibf
+ tc_boolean_formula (IfVar nm ) = BF.Var NoExtField . noLocA <$> (lookupIfaceTop . mkVarOccFS . ifLclNameFS $ nm)
mk_sc_doc pred = text "Superclass" <+> ppr pred
mk_at_doc tc = text "Associated type" <+> ppr tc
=====================================
compiler/GHC/Parser.y
=====================================
@@ -3821,11 +3821,11 @@ name_boolformula :: { LBooleanFormula GhcPs }
: name_boolformula_and { $1 }
| name_boolformula_and '|' name_boolformula
{% do { h <- addTrailingVbarBF $1 (epTok $2)
- ; return (sLLa $1 $> (Or [h,$3])) } }
+ ; return (sLLa $1 $> (Or noExtField [h,$3])) } }
name_boolformula_and :: { LBooleanFormula GhcPs }
: name_boolformula_and_list
- { sLLa (head $1) (last $1) (And (toList $1)) }
+ { sLLa (head $1) (last $1) (And noExtField (toList $1)) }
name_boolformula_and_list :: { NonEmpty (LBooleanFormula GhcPs) }
: name_boolformula_atom { NE.singleton $1 }
@@ -3834,9 +3834,9 @@ name_boolformula_and_list :: { NonEmpty (LBooleanFormula GhcPs) }
; return (h NE.<| $3) } }
name_boolformula_atom :: { LBooleanFormula GhcPs }
- : '(' name_boolformula ')' {% amsr (sLL $1 $> (Parens $2))
+ : '(' name_boolformula ')' {% amsr (sLL $1 $> (Parens noExtField $2))
(AnnBooleanFormula (epTok $1) (epTok $3) []) }
- | name_var { sL1a $1 (Var $1) }
+ | name_var { sL1a $1 (Var noExtField $1) }
namelist :: { Located [LocatedN RdrName] }
namelist : name_var { sL1 $1 [$1] }
=====================================
compiler/GHC/Tc/Solver/InertSet.hs
=====================================
@@ -460,7 +460,7 @@ In implementation terms
- It is only called when applying an instance decl,
in GHC.Tc.Solver.Dict.tryInstances
- - ClsInst.InstanceWhat says what kind of instance was
+ - GHC.Tc.Instance.Class.InstanceWhat says what kind of instance was
used to solve the constraint. In particular
* LocalInstance identifies quantified constraints
* BuiltinEqInstance identifies the strange built-in
@@ -800,7 +800,7 @@ The InertCans represents a collection of constraints with the following properti
eg a wanted cannot rewrite a given)
* CEqCan equalities: see Note [inert_eqs: the inert equalities]
- Also see documentation in Constraint.Ct for a list of invariants
+ Also see documentation in GHC.Tc.Types.Constraint.Ct for a list of invariants
Note [inert_eqs: the inert equalities]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=====================================
compiler/GHC/Tc/TyCl/Class.hs
=====================================
@@ -345,7 +345,7 @@ tcClassMinimalDef _clas sigs op_info
where
-- By default require all methods without a default implementation
defMindef :: ClassMinimalDef
- defMindef = mkAnd [ noLocA (mkVar (noLocA name))
+ defMindef = mkAnd [ noLocA (mkVar NoExtField (noLocA name))
| (name, _, Nothing) <- op_info ]
instantiateMethod :: Class -> TcId -> [TcType] -> TcType
=====================================
compiler/GHC/Types/Id/Make.hs
=====================================
@@ -987,7 +987,7 @@ until the final simplifier phase; see Note [Activation for data
constructor wrappers].
For further reading, see:
- * (IA1) in Note [Interesting arguments] in GHC.Core.Op.Simplify.Utils
+ * (IA1) in Note [Interesting arguments] in GHC.Core.Opt.Simplify.Utils
* Note [Lone variables] in GHC.Core.Unfold
* Note [exprIsConApp_maybe on data constructors with wrappers]
in GHC.Core.SimpleOpt
=====================================
compiler/GHC/Types/Unique/DFM.hs
=====================================
@@ -351,8 +351,8 @@ foldUDFM :: (elt -> a -> a) -> a -> UniqDFM key elt -> a
{-# INLINE foldUDFM #-}
-- Specialises k and z into M.foldr on the small-map path.
foldUDFM k z (UDFM m ub)
- | M.compareSize m 1 /= GT = M.foldr (k . taggedFst) z m
- | otherwise = fold_udfm k z m ub
+ | M.sizeAtMost m 1 = M.foldr (k . taggedFst) z m
+ | otherwise = fold_udfm k z m ub
fold_udfm :: (elt -> a -> a) -> a -> M.Word64Map (TaggedVal elt) -> Int -> a
{-# NOINLINE fold_udfm #-}
@@ -402,8 +402,8 @@ eltsUDFM :: UniqDFM key elt -> [elt]
{-# INLINE eltsUDFM #-} -- so the small case is a good producer
-- This matters for T13719.
eltsUDFM (UDFM m ub)
- | M.compareSize m 1 /= GT = build (\c n -> M.foldr (c . taggedFst) n m)
- | otherwise = elts_udfm m ub
+ | M.sizeAtMost m 1 = build (\c n -> M.foldr (c . taggedFst) n m)
+ | otherwise = elts_udfm m ub
elts_udfm :: M.Word64Map (TaggedVal elt) -> Int -> [elt]
{-# NOINLINE elts_udfm #-}
@@ -511,7 +511,7 @@ udfmToList :: UniqDFM key elt -> [(Unique, elt)]
-- traverseUSDFM in the pattern-match checker, which doesn't fuse. Inlining
-- the size dispatch into it regresses T17836.
udfmToList (UDFM m ub)
- | M.compareSize m 1 /= GT =
+ | M.sizeAtMost m 1 =
M.foldrWithKey (\k tv r -> (mkUniqueGrimily k, taggedFst tv) : r) [] m
| usePigeonholeSort m ub = pigeonholeSort ub
(\k tv -> TaggedVal (mkUniqueGrimily k, taggedFst tv) (taggedSnd tv)) m
=====================================
compiler/GHC/Types/Var.hs
=====================================
@@ -621,27 +621,27 @@ Note [Types for coercions, predicates, and evidence]
VarBndr is polymorphic in both var and visibility fields.
Currently there are nine different uses of 'VarBndr':
-* Var.ForAllTyBinder = VarBndr TyCoVar ForAllTyFlag
+* GHC.Types.Var.ForAllTyBinder = VarBndr TyCoVar ForAllTyFlag
Binder of a forall-type; see ForAllTy in GHC.Core.TyCo.Rep
-* Var.TyVarBinder = VarBndr TyVar ForAllTyFlag
+* GHC.Types.Var.TyVarBinder = VarBndr TyVar ForAllTyFlag
Subset of ForAllTyBinder when we are sure the binder is a TyVar
-* Var.InvisTVBinder = VarBndr TyVar Specificity
+* GHC.Types.Var.InvisTVBinder = VarBndr TyVar Specificity
Specialised form of TyVarBinder, when ForAllTyFlag = Invisible s
See GHC.Core.Type.splitForAllInvisTVBinders
-* Var.ReqTVBinder = VarBndr TyVar ()
+* GHC.Types.Var.ReqTVBinder = VarBndr TyVar ()
Specialised form of TyVarBinder, when ForAllTyFlag = Required
See GHC.Core.Type.splitForAllReqTVBinders
This one is barely used
-* TyCon.TyConBinder = VarBndr TyVar TyConBndrVis
+* GHC.Core.TyCon.TyConBinder = VarBndr TyVar TyConBndrVis
Binders of a TyCon; see TyCon in GHC.Core.TyCon
-* IfaceType.IfaceForAllBndr = VarBndr IfaceBndr ForAllTyFlag
-* IfaceType.IfaceForAllSpecBndr = VarBndr IfaceBndr Specificity
-* IfaceType.IfaceTyConBinder = VarBndr IfaceBndr TyConBndrVis
+* GHC.Iface.Type.IfaceForAllBndr = VarBndr IfaceBndr ForAllTyFlag
+* GHC.Iface.Type.IfaceForAllSpecBndr = VarBndr IfaceBndr Specificity
+* GHC.Iface.Type.IfaceTyConBinder = VarBndr IfaceBndr TyConBndrVis
-}
data VarBndr var argf = Bndr var argf
=====================================
compiler/Language/Haskell/Syntax/BooleanFormula.hs
=====================================
@@ -4,59 +4,78 @@
module Language.Haskell.Syntax.BooleanFormula(
BooleanFormula(..), LBooleanFormula,
- mkVar, mkFalse, mkTrue, mkBool, mkAnd, mkOr
+ mkVar, mkFalse, mkTrue, mkBool, mkAnd, mkOr,
+ BooleanFormulaDefault(..)
) where
import Prelude hiding ( init, last )
import Data.List ( nub )
-import Language.Haskell.Syntax.Extension (XRec, UnXRec (..), LIdP)
+import Language.Haskell.Syntax.Extension (XRec, UnXRec (..), LIdP,
+ XBFVar, XBFAnd, XBFOr, XBFParens,
+ XXBooleanFormula)
-- types
type LBooleanFormula p = XRec p (BooleanFormula p)
-data BooleanFormula p = Var (LIdP p) | And [LBooleanFormula p] | Or [LBooleanFormula p]
- | Parens (LBooleanFormula p)
+data BooleanFormula p
+ = Var (XBFVar p) (LIdP p)
+ | And (XBFAnd p) [LBooleanFormula p]
+ | Or (XBFOr p) [LBooleanFormula p]
+ | Parens (XBFParens p) (LBooleanFormula p)
+ | XBooleanFormula !(XXBooleanFormula p)
+
+class BooleanFormulaDefault p where
+ bfAnnAnd :: XBFAnd p
+ bfAnnOr :: XBFOr p
-- instances
-deriving instance (Eq (LIdP p), Eq (LBooleanFormula p)) => Eq (BooleanFormula p)
+deriving instance (Eq (LIdP p), Eq (LBooleanFormula p),
+ Eq (XBFVar p),
+ Eq (XBFAnd p),
+ Eq (XBFOr p),
+ Eq (XBFParens p),
+ Eq (XXBooleanFormula p)
+ ) => Eq (BooleanFormula p)
-- smart constructors
-- see note [Simplification of BooleanFormulas]
-mkVar :: LIdP p -> BooleanFormula p
+mkVar :: XBFVar p -> LIdP p -> BooleanFormula p
mkVar = Var
-mkFalse, mkTrue :: BooleanFormula p
-mkFalse = Or []
-mkTrue = And []
+mkFalse, mkTrue :: forall p. BooleanFormulaDefault p => BooleanFormula p
+mkFalse = Or (bfAnnOr @p) []
+mkTrue = And (bfAnnAnd @p) []
-- Convert a Bool to a BooleanFormula
-mkBool :: Bool -> BooleanFormula p
+mkBool :: BooleanFormulaDefault p => Bool -> BooleanFormula p
mkBool False = mkFalse
mkBool True = mkTrue
-- Make a conjunction, and try to simplify
-mkAnd :: forall p. (UnXRec p, Eq (LIdP p), Eq (LBooleanFormula p)) => [LBooleanFormula p] -> BooleanFormula p
+mkAnd :: forall p. (UnXRec p, Eq (LIdP p), Eq (LBooleanFormula p), BooleanFormulaDefault p)
+ => [LBooleanFormula p] -> BooleanFormula p
mkAnd = maybe mkFalse (mkAnd' . nub . concat) . mapM fromAnd
where
-- See Note [Simplification of BooleanFormulas]
fromAnd :: LBooleanFormula p -> Maybe [LBooleanFormula p]
fromAnd bf = case unXRec @p bf of
- (And xs) -> Just xs
+ (And _ xs) -> Just xs
-- assume that xs are already simplified
-- otherwise we would need: fromAnd (And xs) = concat <$> traverse fromAnd xs
- (Or []) -> Nothing
+ (Or _ []) -> Nothing
-- in case of False we bail out, And [..,mkFalse,..] == mkFalse
_ -> Just [bf]
mkAnd' [x] = unXRec @p x
- mkAnd' xs = And xs
+ mkAnd' xs = And (bfAnnAnd @p) xs
-mkOr :: forall p. (UnXRec p, Eq (LIdP p), Eq (LBooleanFormula p)) => [LBooleanFormula p] -> BooleanFormula p
+mkOr :: forall p. (UnXRec p, Eq (LIdP p), Eq (LBooleanFormula p), BooleanFormulaDefault p)
+ => [LBooleanFormula p] -> BooleanFormula p
mkOr = maybe mkTrue (mkOr' . nub . concat) . mapM fromOr
where
-- See Note [Simplification of BooleanFormulas]
fromOr bf = case unXRec @p bf of
- (Or xs) -> Just xs
- (And []) -> Nothing
- _ -> Just [bf]
+ (Or _ xs) -> Just xs
+ (And _ []) -> Nothing
+ _ -> Just [bf]
mkOr' [x] = unXRec @p x
- mkOr' xs = Or xs
+ mkOr' xs = Or (bfAnnOr @p) xs
=====================================
compiler/Language/Haskell/Syntax/Extension.hs
=====================================
@@ -841,6 +841,14 @@ type family XXIntegralLit x
type family XStringLit x
type family XXStringLit x
+-- =====================================================================
+-- BooleanFormula type families
+
+type family XBFVar p
+type family XBFAnd p
+type family XBFOr p
+type family XBFParens p
+type family XXBooleanFormula p
-- =====================================================================
-- Misc
=====================================
testsuite/tests/process/process009.hs
=====================================
@@ -11,7 +11,7 @@ main = do
let script = intercalate " "
[ "exec python3 2>/dev/null"
, "-c"
- , "'import os; os.kill(os.getpid(), 1)'"
+ , "'import os; os.kill(os.getpid(), 9)'" -- SIGKILL
]
(_,_,_,p) <- createProcess (shell script)
waitForProcess p >>= print
=====================================
testsuite/tests/process/process009.stdout
=====================================
@@ -1,3 +1,3 @@
-ExitFailure (-1)
-Just (ExitFailure (-1))
-Just (ExitFailure (-1))
+ExitFailure (-9)
+Just (ExitFailure (-9))
+Just (ExitFailure (-9))
=====================================
utils/check-exact/ExactPrint.hs
=====================================
@@ -2722,18 +2722,18 @@ instance ExactPrint (BF.BooleanFormula GhcPs) where
getAnnotationEntry = const NoEntryVal
setAnnotationAnchor a _ _ _ = a
- exact (BF.Var x) = do
+ exact (BF.Var e x) = do
x' <- markAnnotated x
- return (BF.Var x')
- exact (BF.Or ls) = do
+ return (BF.Var e x')
+ exact (BF.Or e ls) = do
ls' <- mapM markAnnotated ls
- return (BF.Or ls')
- exact (BF.And ls) = do
+ return (BF.Or e ls')
+ exact (BF.And e ls) = do
ls' <- mapM markAnnotated ls
- return (BF.And ls')
- exact (BF.Parens x) = do
+ return (BF.And e ls')
+ exact (BF.Parens e x) = do
x' <- markAnnotated x
- return (BF.Parens x')
+ return (BF.Parens e x')
-- ---------------------------------------------------------------------
=====================================
utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
=====================================
@@ -998,26 +998,26 @@ ppClassDecl
-- Minimal complete definition
minimalBit = case [s | MinimalSig _ (L _ s) <- sigs] of
-- Miminal complete definition = every shown method
- And xs : _
- | sort [getName n | L _ (Var (L _ n)) <- xs]
+ And _ xs : _
+ | sort [getName n | L _ (Var _ (L _ n)) <- xs]
== sort [getName n | ClassOpSig _ _ ns _ <- sigs, L _ n <- ns] ->
noHtml
-- Minimal complete definition = the only shown method
- Var (L _ n) : _
+ Var _ (L _ n) : _
| [getName n]
== [getName n' | ClassOpSig _ _ ns _ <- sigs, L _ n' <- ns] ->
noHtml
-- Minimal complete definition = nothing
- And [] : _ -> subMinimal $ toHtml ("Nothing" :: LText)
+ And _ [] : _ -> subMinimal $ toHtml ("Nothing" :: LText)
m : _ -> subMinimal $ ppMinimal False m
_ -> noHtml
- ppMinimal _ (Var (L _ n)) = ppDocName qual Prefix True n
- ppMinimal _ (And fs) = foldr1 (\a b -> a +++ (", " :: LText) +++ b) $ map (ppMinimal True . unLoc) fs
- ppMinimal p (Or fs) = wrap $ foldr1 (\a b -> a +++ (" | " :: LText) +++ b) $ map (ppMinimal False . unLoc) fs
+ ppMinimal _ (Var _ (L _ n)) = ppDocName qual Prefix True n
+ ppMinimal _ (And _ fs) = foldr1 (\a b -> a +++ (", " :: LText) +++ b) $ map (ppMinimal True . unLoc) fs
+ ppMinimal p (Or _ fs) = wrap $ foldr1 (\a b -> a +++ (" | " :: LText) +++ b) $ map (ppMinimal False . unLoc) fs
where
wrap | p = parens | otherwise = id
- ppMinimal p (Parens x) = ppMinimal p (unLoc x)
+ ppMinimal p (Parens _ x) = ppMinimal p (unLoc x)
-- Instances
instancesBit =
=====================================
utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
=====================================
@@ -858,10 +858,10 @@ bfTraverse :: Applicative f
-> f (BooleanFormula DocNameI)
bfTraverse f = go
where
- go (Var a ) = Var <$> f a
- go (And bfs) = And <$> traverse @[] (traverse go) bfs
- go (Or bfs) = Or <$> traverse @[] (traverse go) bfs
- go (Parens bf ) = Parens <$> traverse go bf
+ go (Var x a ) = Var x <$> f a
+ go (And x bfs) = And x <$> traverse @[] (traverse go) bfs
+ go (Or x bfs) = Or x <$> traverse @[] (traverse go) bfs
+ go (Parens x bf ) = Parens x <$> traverse go bf
renameForD :: ForeignDecl GhcRn -> RnM (ForeignDecl DocNameI)
renameForD (ForeignImport _ modifiers lname ltype x) = do
=====================================
utils/haddock/haddock-api/src/Haddock/Types.hs
=====================================
@@ -1038,6 +1038,12 @@ type instance XCTyFamInstDecl DocNameI = NoExtField
type instance XHsContext DocNameI = NoExtField
type instance XXHsContextDetails DocNameI = DataConCantHappen
+type instance XBFVar DocNameI = NoExtField
+type instance XBFAnd DocNameI = NoExtField
+type instance XBFOr DocNameI = NoExtField
+type instance XBFParens DocNameI = NoExtField
+type instance XXBooleanFormula DocNameI = DataConCantHappen
+
-----------------------------------------------------------------------------
-- * NFData instances for GHC types
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2667cef68d74b079c03cb895a25c49…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2667cef68d74b079c03cb895a25c49…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/sjakobi/T27619-liveness-fixpoint-formats] NCG: compare register formats by width, remove Ord Format
by Simon Jakobi (@sjakobi) 17 Aug '26
by Simon Jakobi (@sjakobi) 17 Aug '26
17 Aug '26
Simon Jakobi pushed to branch wip/sjakobi/T27619-liveness-fixpoint-formats at Glasgow Haskell Compiler / GHC
Commits:
1ad7425a by Simon Jakobi at 2026-08-17T23:12:15+02:00
NCG: compare register formats by width, remove Ord Format
maxRegWithFormat, minusCoveredRegs and the caller-less shrinkingRegs
compared formats with Format's derived Ord, which ordered by
constructor, not by width: For example, VecFormat 16 FmtInt8 (16 bytes)
sorted above a hypothetical VecFormat 8 FmtDouble (64 bytes). This is
harmless while all vector vregs are 128-bit, but once wider vectors land
in the NCG it becomes unsound in both directions of Note [Register
formats in liveness analysis]: the maxRegWithFormat join could record a
live format narrower than a read, violating (FmtBwd1), and
minusCoveredRegs could treat a narrow vector write as covering a wider
live format, violating (FmtBwd2). Noted in #27619.
The comparisons now go by formatToWidth, except the liveness join
maxRegWithFormat, which needs a total order to keep the liveness
fixpoint convergent and uses the new width-major compareFormat. See
Note [Convergence of the liveness fixpoint] in GHC.CmmToAsm.Reg.Liveness.
Apart from future-proofing for larger vector formats, these changes also
make the code more obviously correct today.
Also remove the Ord instances of Format and ScalarFormat, so future
users need to make a conscious choice between formatToWidth and
compareFormat.
Assisted-by: Claude Fable 5
- - - - -
4 changed files:
- compiler/GHC/CmmToAsm/Format.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/Reg/Liveness.hs
- compiler/GHC/CmmToAsm/Reg/Regs.hs
Changes:
=====================================
compiler/GHC/CmmToAsm/Format.hs
=====================================
@@ -23,6 +23,7 @@ module GHC.CmmToAsm.Format (
vecFormat,
isVecFormat,
cmmTypeFormat,
+ compareFormat,
formatToWidth,
scalarWidth,
formatInBytes,
@@ -40,11 +41,13 @@ where
import GHC.Prelude
+import Data.Semigroup ( (<>) )
+
import GHC.Cmm
import GHC.Platform.Reg ( Reg(..), RealReg, VirtualReg )
import GHC.Types.Unique ( Uniquable(..) )
import GHC.Types.Unique.Set
-import GHC.Utils.Outputable
+import GHC.Utils.Outputable hiding ( (<>) )
import GHC.Utils.Panic
{- Note [GHC's data format representations]
@@ -92,7 +95,9 @@ data Format
| FF64
| VecFormat !Length -- ^ number of elements (always at least 2)
!ScalarFormat -- ^ format of each element
- deriving (Show, Eq, Ord)
+ deriving (Show, Eq)
+ -- No Ord: compare via 'formatToWidth', or use 'compareFormat' where a
+ -- total order is needed.
pattern IntegerFormat :: Format
pattern IntegerFormat <- ( isIntegerFormat -> True )
@@ -117,7 +122,7 @@ data ScalarFormat
| FmtInt64
| FmtFloat
| FmtDouble
- deriving (Show, Eq, Ord)
+ deriving (Show, Eq)
scalarFormatFormat :: ScalarFormat -> Format
scalarFormatFormat = \case
@@ -248,6 +253,33 @@ scalarWidth = \case
formatInBytes :: Format -> Int
formatInBytes = widthInBytes . formatToWidth
+-- | Total order on formats: by width, with an arbitrary but fixed tiebreak
+-- between distinct formats of the same width.
+--
+-- See Note [Convergence of the liveness fixpoint] in GHC.CmmToAsm.Reg.Liveness.
+compareFormat :: Format -> Format -> Ordering
+compareFormat f1 f2 =
+ compare (formatToWidth f1) (formatToWidth f2) <> compare (tag f1) (tag f2)
+ where
+ tag :: Format -> (Int, Length)
+ tag = \case
+ II8 -> (0, 0)
+ II16 -> (1, 0)
+ II32 -> (2, 0)
+ II64 -> (3, 0)
+ FF32 -> (4, 0)
+ FF64 -> (5, 0)
+ VecFormat l s -> (6 + scalarTag s, l)
+
+ scalarTag :: ScalarFormat -> Int
+ scalarTag = \case
+ FmtInt8 -> 0
+ FmtInt16 -> 1
+ FmtInt32 -> 2
+ FmtInt64 -> 3
+ FmtFloat -> 4
+ FmtDouble -> 5
+
--------------------------------------------------------------------------------
-- | A typed virtual register: a virtual register, together with the specific
=====================================
compiler/GHC/CmmToAsm/PPC/CodeGen.hs
=====================================
@@ -484,7 +484,7 @@ getRegister' _ _ (CmmMachOp (MO_SS_Conv src tgt) [CmmLoad mem pk _])
, src < tgt = do
let format = cmmTypeFormat pk
-- lwa is DS-form. See Note [Power instruction format]
- let form = if format >= II32 then DS else D
+ let form = if formatToWidth format >= W32 then DS else D
Amode addr addr_code <- getAmode form mem
let code dst = assert (format == intFormat src)
$ addr_code `snocOL` LA format dst addr
=====================================
compiler/GHC/CmmToAsm/Reg/Liveness.hs
=====================================
@@ -937,9 +937,9 @@ test:
dependency order. Comparing the whole accumulated block map would make the
fixpoint quadratic in procedure size (#27437).
-The fixpoint terminates because the entries can only grow: registers are
-only added, formats only increase via 'maxRegWithFormat' joins, and both
-lattices are finite.
+To ensure termination, 'maxRegWithFormat' uses 'compareFormat' which defines a
+total order on formats. Comparing the widths only would introduce the risk of
+an infinite loop where each iteration swaps two formats of the same width.
-}
=====================================
compiler/GHC/CmmToAsm/Reg/Regs.hs
=====================================
@@ -20,7 +20,8 @@ module GHC.CmmToAsm.Reg.Regs (
import GHC.Prelude
import GHC.Platform.Reg ( Reg )
-import GHC.CmmToAsm.Format ( Format, RegWithFormat(..), isVecFormat )
+import GHC.CmmToAsm.Format ( Format, RegWithFormat(..), isVecFormat,
+ compareFormat, formatToWidth )
import GHC.Utils.Outputable ( Outputable )
import GHC.Types.Unique ( Uniquable(..) )
@@ -39,11 +40,12 @@ newtype Regs = Regs { getRegs :: UniqSet RegWithFormat }
maxRegWithFormat :: RegWithFormat -> RegWithFormat -> RegWithFormat
maxRegWithFormat r1@(RegWithFormat _ fmt1) r2@(RegWithFormat _ fmt2)
- = if fmt1 >= fmt2
- then r1
- else r2
- -- Re-using one of the arguments avoids allocating a new 'RegWithFormat',
- -- compared with returning 'RegWithFormat r1 (max fmt1 fmt2)'.
+ | LT <- compareFormat fmt1 fmt2 = r2
+ | otherwise = r1
+ -- See Note [Convergence of the liveness fixpoint] in
+ -- GHC.CmmToAsm.Reg.Liveness.
+ --
+ -- Re-using one of the arguments avoids allocating a new 'RegWithFormat'.
noRegs :: Regs
noRegs = Regs emptyUniqSet
@@ -66,7 +68,7 @@ minusCoveredRegs = coerce $ minusUniqSet_C f
where
f :: RegWithFormat -> RegWithFormat -> Maybe RegWithFormat
f r1@(RegWithFormat _ fmt1) (RegWithFormat _ fmt2) =
- if fmt2 >= fmt1
+ if formatToWidth fmt2 >= formatToWidth fmt1
||
not ( isVecFormat fmt1 )
-- See Wrinkle [Don't allow scalar partial writes]
@@ -99,7 +101,7 @@ shrinkingRegs = coerce $ minusUniqSet_C f
where
f :: RegWithFormat -> RegWithFormat -> Maybe RegWithFormat
f (RegWithFormat _ fmt1) r2@(RegWithFormat _ fmt2)
- | fmt2 < fmt1
+ | formatToWidth fmt2 < formatToWidth fmt1
= Just r2
| otherwise
= Nothing
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1ad7425a61af41a5e26fa79b3ba9e1c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1ad7425a61af41a5e26fa79b3ba9e1c…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0