[Git][ghc/ghc][wip/jeltsch/more-efficient-home-unit-imports-finding] Drop the construction and use of `other_fopts_map`
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
11 Apr '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding at Glasgow Haskell Compiler / GHC
Commits:
ca6d9764 by Wolfgang Jeltsch at 2026-04-11T16:56:30+03:00
Drop the construction and use of `other_fopts_map`
The map was only used for a single lookup, and directly performing the
lookup in the original list is faster than constructing the map and then
performing the lookup in the map.
- - - - -
1 changed file:
- compiler/GHC/Unit/Finder.hs
Changes:
=====================================
compiler/GHC/Unit/Finder.hs
=====================================
@@ -206,7 +206,7 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg =
case mb_pkg of
NoPkgQual -> unqual_import
ThisPkg uid | (homeUnitId <$> mhome_unit) == Just uid -> home_import
- | Just os <- M.lookup uid other_fopts_map -> home_pkg_import (uid, os)
+ | Just os <- lookup uid other_fopts -> home_pkg_import (uid, os)
| otherwise -> pprPanic "findImportModule" (ppr mod_name $$ ppr mb_pkg $$ ppr (homeUnitId <$> mhome_unit) $$ ppr uid $$ ppr (map fst all_opts))
OtherPkg _ -> pkg_import
where
@@ -214,10 +214,8 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg =
module_home_units = M.findWithDefault Set.empty mod_name module_name_map
current_unit_id = homeUnitId <$> mhome_unit
all_opts = case current_unit_id of
- Nothing -> other_fopts_list
- Just home_unit_id -> (home_unit_id, fopts) : other_fopts_list
-
- other_fopts_map = M.fromList other_fopts_list
+ Nothing -> other_fopts
+ Just home_unit_id -> (home_unit_id, fopts) : other_fopts
home_import = case mhome_unit of
Just home_unit -> findHomeModule fc fopts home_unit mod_name
@@ -237,7 +235,7 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg =
-- Do not be smart and change this to `foldr orIfNotFound home_import hs` as
-- that is not the same!! home_import is first because we need to look within ourselves
-- first before looking at the packages in order.
- any_home_import = foldr1 orIfNotFound (home_import :| map home_pkg_import other_fopts_list)
+ any_home_import = foldr1 orIfNotFound (home_import :| map home_pkg_import other_fopts)
pkg_import = findExposedPackageModule fc fopts units mod_name mb_pkg
@@ -259,7 +257,7 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg =
excluded = maybe dep_providers (\u -> Set.insert u dep_providers) current_unit_id
in Set.toList (Set.difference candidates excluded)
other_home_uids = known_other_uids ++ unknown_units
- other_fopts_list =
+ other_fopts =
[ (uid, initFinderOpts (homeUnitEnv_dflags (ue_findHomeUnitEnv uid ue)))
| uid <- other_home_uids
]
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ca6d9764b653b3c8bd81dd08362d6e0…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ca6d9764b653b3c8bd81dd08362d6e0…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/jeltsch/more-efficient-home-unit-imports-finding.jeltsch-experiment] Drop the construction and use of `other_fopts_map`
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
11 Apr '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding.jeltsch-experiment at Glasgow Haskell Compiler / GHC
Commits:
e49a16cd by Wolfgang Jeltsch at 2026-04-11T16:46:04+03:00
Drop the construction and use of `other_fopts_map`
The map was only used for a single lookup, and directly performing the
lookup in the original list is faster than constructing the map and then
performing the lookup in the map.
- - - - -
1 changed file:
- compiler/GHC/Unit/Finder.hs
Changes:
=====================================
compiler/GHC/Unit/Finder.hs
=====================================
@@ -206,7 +206,7 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg =
case mb_pkg of
NoPkgQual -> unqual_import
ThisPkg uid | (homeUnitId <$> mhome_unit) == Just uid -> home_import
- | Just os <- M.lookup uid other_fopts_map -> home_pkg_import (uid, os)
+ | Just os <- lookup uid other_fopts -> home_pkg_import (uid, os)
| otherwise -> pprPanic "findImportModule" (ppr mod_name $$ ppr mb_pkg $$ ppr (homeUnitId <$> mhome_unit) $$ ppr uid $$ ppr (map fst all_opts))
OtherPkg _ -> pkg_import
where
@@ -214,10 +214,8 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg =
module_home_units = M.findWithDefault Set.empty mod_name module_name_map
current_unit_id = homeUnitId <$> mhome_unit
all_opts = case current_unit_id of
- Nothing -> other_fopts_list
- Just home_unit_id -> (home_unit_id, fopts) : other_fopts_list
-
- other_fopts_map = M.fromList other_fopts_list
+ Nothing -> other_fopts
+ Just home_unit_id -> (home_unit_id, fopts) : other_fopts
home_import = case mhome_unit of
Just home_unit -> findHomeModule fc fopts home_unit mod_name
@@ -237,7 +235,7 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg =
-- Do not be smart and change this to `foldr orIfNotFound home_import hs` as
-- that is not the same!! home_import is first because we need to look within ourselves
-- first before looking at the packages in order.
- any_home_import = foldr1 orIfNotFound (home_import :| map home_pkg_import other_fopts_list)
+ any_home_import = foldr1 orIfNotFound (home_import :| map home_pkg_import other_fopts)
pkg_import = findExposedPackageModule fc fopts units mod_name mb_pkg
@@ -259,7 +257,7 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg =
excluded = maybe Set.empty Set.singleton {- maybe dep_providers (\u -> Set.insert u dep_providers) -} current_unit_id
in Set.toList (Set.difference candidates excluded)
other_home_uids = known_other_uids ++ unknown_units
- other_fopts_list =
+ other_fopts =
[ (uid, initFinderOpts (homeUnitEnv_dflags (ue_findHomeUnitEnv uid ue)))
| uid <- other_home_uids
]
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e49a16cd2bc74ba3602cfae10723e3d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e49a16cd2bc74ba3602cfae10723e3d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/jeltsch/more-efficient-home-unit-imports-finding.jeltsch-experiment] 2 commits: Consider also `ModuleNodeFixed` nodes for the cache
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
11 Apr '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding.jeltsch-experiment at Glasgow Haskell Compiler / GHC
Commits:
da4c4d9f by Wolfgang Jeltsch at 2026-04-11T16:23:36+03:00
Consider also `ModuleNodeFixed` nodes for the cache
- - - - -
261aa4e3 by Wolfgang Jeltsch at 2026-04-11T16:30:31+03:00
Experimentally exclude `dep_providers` from `excluded`
- - - - -
2 changed files:
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Module/Graph.hs
Changes:
=====================================
compiler/GHC/Unit/Finder.hs
=====================================
@@ -256,7 +256,7 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg =
in Set.toList providers
unknown_units =
let candidates = Set.difference hpt_deps complete_units
- excluded = maybe dep_providers (\u -> Set.insert u dep_providers) current_unit_id
+ excluded = maybe Set.empty Set.singleton {- maybe dep_providers (\u -> Set.insert u dep_providers) -} current_unit_id
in Set.toList (Set.difference candidates excluded)
other_home_uids = known_other_uids ++ unknown_units
other_fopts_list =
=====================================
compiler/GHC/Unit/Module/Graph.hs
=====================================
@@ -219,22 +219,18 @@ mkHomeModuleMap nodes = ModuleNameHomeMap completeUnits providerMap where
providerMap
= Map.fromListWith Set.union $
[
- (ms_mod_name modSummary, Set.singleton (ms_unitid modSummary)) |
- ModuleNode _ (ModuleNodeCompile modSummary) <- nodes
+ (moduleName, Set.singleton unitID) |
+ ModuleNode _ moduleNodeInfo <- nodes,
+ let moduleName = moduleNodeInfoModuleName moduleNodeInfo,
+ let unitID = moduleNodeInfoUnitId moduleNodeInfo
]
completeUnits :: Set UnitId
- completeUnits
- = Set.fromList $
- [
- ms_unitid modSummary |
- ModuleNode _ (ModuleNodeCompile modSummary) <- nodes
- ]
-
- {-NOTE:
- The matching with `ModuleNodeCompile` results in nodes with
- `ModuleNodeFixed` in their info being dropped.
- -}
+ completeUnits = Set.fromList $
+ [
+ moduleNodeInfoUnitId moduleNodeInfo |
+ ModuleNode _ moduleNodeInfo <- nodes
+ ]
mgHomeModuleMap :: ModuleGraph -> ModuleNameHomeMap
mgHomeModuleMap = mg_home_map
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/91489d4ad4e9c7c134eef9089e2931…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/91489d4ad4e9c7c134eef9089e2931…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/jeltsch/more-efficient-home-unit-imports-finding.fendor-experiment] 2 commits: Consider also `ModuleNodeFixed` nodes for the cache
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
11 Apr '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding.fendor-experiment at Glasgow Haskell Compiler / GHC
Commits:
da4c4d9f by Wolfgang Jeltsch at 2026-04-11T16:23:36+03:00
Consider also `ModuleNodeFixed` nodes for the cache
- - - - -
c6a61c47 by Wolfgang Jeltsch at 2026-04-11T16:30:04+03:00
Experimentally set `candidates` to `Set.empty`
- - - - -
2 changed files:
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Module/Graph.hs
Changes:
=====================================
compiler/GHC/Unit/Finder.hs
=====================================
@@ -255,7 +255,7 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg =
let providers = maybe dep_providers (\u -> Set.delete u dep_providers) current_unit_id
in Set.toList providers
unknown_units =
- let candidates = Set.difference hpt_deps complete_units
+ let candidates = Set.empty -- Set.difference hpt_deps complete_units
excluded = maybe dep_providers (\u -> Set.insert u dep_providers) current_unit_id
in Set.toList (Set.difference candidates excluded)
other_home_uids = known_other_uids ++ unknown_units
=====================================
compiler/GHC/Unit/Module/Graph.hs
=====================================
@@ -219,22 +219,18 @@ mkHomeModuleMap nodes = ModuleNameHomeMap completeUnits providerMap where
providerMap
= Map.fromListWith Set.union $
[
- (ms_mod_name modSummary, Set.singleton (ms_unitid modSummary)) |
- ModuleNode _ (ModuleNodeCompile modSummary) <- nodes
+ (moduleName, Set.singleton unitID) |
+ ModuleNode _ moduleNodeInfo <- nodes,
+ let moduleName = moduleNodeInfoModuleName moduleNodeInfo,
+ let unitID = moduleNodeInfoUnitId moduleNodeInfo
]
completeUnits :: Set UnitId
- completeUnits
- = Set.fromList $
- [
- ms_unitid modSummary |
- ModuleNode _ (ModuleNodeCompile modSummary) <- nodes
- ]
-
- {-NOTE:
- The matching with `ModuleNodeCompile` results in nodes with
- `ModuleNodeFixed` in their info being dropped.
- -}
+ completeUnits = Set.fromList $
+ [
+ moduleNodeInfoUnitId moduleNodeInfo |
+ ModuleNode _ moduleNodeInfo <- nodes
+ ]
mgHomeModuleMap :: ModuleGraph -> ModuleNameHomeMap
mgHomeModuleMap = mg_home_map
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/170ba43002a011e8ca6f1e6bf7c540…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/170ba43002a011e8ca6f1e6bf7c540…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/jeltsch/more-efficient-home-unit-imports-finding] Consider also `ModuleNodeFixed` nodes for the cache
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
11 Apr '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding at Glasgow Haskell Compiler / GHC
Commits:
da4c4d9f by Wolfgang Jeltsch at 2026-04-11T16:23:36+03:00
Consider also `ModuleNodeFixed` nodes for the cache
- - - - -
1 changed file:
- compiler/GHC/Unit/Module/Graph.hs
Changes:
=====================================
compiler/GHC/Unit/Module/Graph.hs
=====================================
@@ -219,22 +219,18 @@ mkHomeModuleMap nodes = ModuleNameHomeMap completeUnits providerMap where
providerMap
= Map.fromListWith Set.union $
[
- (ms_mod_name modSummary, Set.singleton (ms_unitid modSummary)) |
- ModuleNode _ (ModuleNodeCompile modSummary) <- nodes
+ (moduleName, Set.singleton unitID) |
+ ModuleNode _ moduleNodeInfo <- nodes,
+ let moduleName = moduleNodeInfoModuleName moduleNodeInfo,
+ let unitID = moduleNodeInfoUnitId moduleNodeInfo
]
completeUnits :: Set UnitId
- completeUnits
- = Set.fromList $
- [
- ms_unitid modSummary |
- ModuleNode _ (ModuleNodeCompile modSummary) <- nodes
- ]
-
- {-NOTE:
- The matching with `ModuleNodeCompile` results in nodes with
- `ModuleNodeFixed` in their info being dropped.
- -}
+ completeUnits = Set.fromList $
+ [
+ moduleNodeInfoUnitId moduleNodeInfo |
+ ModuleNode _ moduleNodeInfo <- nodes
+ ]
mgHomeModuleMap :: ModuleGraph -> ModuleNameHomeMap
mgHomeModuleMap = mg_home_map
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/da4c4d9f49768a4f326a0ee87b2ce62…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/da4c4d9f49768a4f326a0ee87b2ce62…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/jeltsch/more-efficient-home-unit-imports-finding] 30 commits: base: improve error message for Data.Char.chr
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
11 Apr '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding at Glasgow Haskell Compiler / GHC
Commits:
502e6ffe by Andrew Lelechenko at 2026-04-07T04:47:21-04:00
base: improve error message for Data.Char.chr
As per https://github.com/haskell/core-libraries-committee/issues/384
- - - - -
b21bd52e by Simon Peyton Jones at 2026-04-07T04:48:07-04:00
Refactor FunResCtxt a bit
Fixes #27154
- - - - -
7fe84ea5 by Zubin Duggal at 2026-04-07T19:11:52+05:30
compiler: Warn when -finfo-table-map is used with -fllvm
These are currently not supported together.
Fixes #26435
- - - - -
4a45a7da by Matthew Pickering at 2026-04-08T04:37:29-04:00
packaging: correctly propagate build/host/target to bindist configure script
At the moment the host and target which we will produce a compiler for
is fixed at the initial configure time. Therefore we need to persist
the choice made at this time into the installation bindist as well so we
look for the right tools, with the right prefixes at install time.
In the future, we want to provide a bit more control about what kind of
bindist we produce so the logic about what the host/target will have to
be written by hadrian rather than persisted by the configure script. In
particular with cross compilers we want to either build a normal stage 2
cross bindist or a stage 3 bindist, which creates a bindist which has a
native compiler for the target platform.
Fixes #21970
Co-authored-by: Sven Tennie <sven.tennie(a)gmail.com>
- - - - -
b0950df6 by Sven Tennie at 2026-04-08T04:37:29-04:00
Cross --host and --target no longer required for cross (#21970)
We set sane defaults in the configure script. Thus, these paramenters
aren't required any longer.
- - - - -
fef35216 by Sven Tennie at 2026-04-08T04:37:30-04:00
ci: Define USER_CONF_CC_OPTS_STAGE2 for aarch64/mingw
ghc-toolchain doesn't see $CONF_CC_OPTS_STAGE2 when the bindist gets
configured. So, the hack to override the compiler gets lost.
- - - - -
8dd6f453 by Cheng Shao at 2026-04-08T04:38:11-04:00
ghci: use ShortByteString for LookupSymbol/LookupSymbolInDLL/LookupClosure messages
This patch refactors ghci to use `ShortByteString` for
`LookupSymbol`/`LookupSymbolInDLL`/`LookupClosure` messages as the
first part of #27147.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
371ef200 by Cheng Shao at 2026-04-08T04:38:11-04:00
ghci: use ShortByteString for MkCostCentres message
This patch refactors ghci to use `ShortByteString` for `MkCostCentres`
messages as a first part of #27147. This also considerably lowers the
memory overhead of breakpoints when cost center profiling is enabled.
-------------------------
Metric Decrease:
interpreter_steplocal
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
4a122bb6 by Phil Hazelden at 2026-04-08T20:49:42-04:00
Implement modifiers syntax.
The `%m` syntax of linear types is now accepted in more places, to allow
use by future extensions, though so far linear types is still the only
consumer.
This may break existing code where it
* Uses -XLinearTypes.
* Has code of the form `a %m -> b`, where `m` can't be inferred to be
kind Multiplicity.
The code can be fixed either by adding a kind annotation, or by setting
`-XLinearTypes -XNoModifiers`.
Proposal:
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0370-m…
- - - - -
07267f79 by Zubin Duggal at 2026-04-08T20:50:25-04:00
hadrian: Don't include the package hash in the haddock directory
Since GHC 9.8 and hash_unit_ids, haddock urls have looked like`ghc-9.10.3/doc/html/libraries/base-4.20.2.0-39f9/**/*.html`
The inclusion of the hash makes it hard for downstream non-boot packages to properly link to these files, as the hash is not
part of a standard cabal substitution.
Since we only build one version of each package, we don't need the hash to disambiguate anything, we can just remove it.
Fixes #26635
- - - - -
0a83b95b by ARATA Mizuki at 2026-04-08T20:51:18-04:00
testsuite: Allow multiple ways to be run by setting multiple command-line options
This patch allows multiple `--test-way`s to take effect, like:
$ hadrian/build test --test-way=normal --test-way=llvm
Previously, only one way was run if the test speed was 'normal' or 'fast'.
Closes #26926
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
- - - - -
e841931c by Teo Camarasu at 2026-04-08T20:52:00-04:00
doc: improve eventlog-flush-interval flag documentation
We mention the performance cost and how this flag can be turned off.
Resolves #27056
- - - - -
e332db25 by Teo Camarasu at 2026-04-08T20:52:01-04:00
docs/user_guide: fix typo
- - - - -
5b82080a by Simon Jakobi at 2026-04-08T20:52:44-04:00
Fix -dsuppress-uniques for free variables in demand signatures
Before: Str=b{sXyZ->S}
With this patch: Str=b{S}
T13143.stderr is updated accordingly.
Fixes #27106.
- - - - -
b7a084cc by Simon Jakobi at 2026-04-08T20:53:27-04:00
Documentation fixes for demand signature notation
Fixes #27115.
- - - - -
59391132 by Simon Jakobi at 2026-04-08T20:54:08-04:00
Use upsert for non-deleting map updates
Some compiler functions were using `alter`, despite never removing
any entries: they only update an existing entry or insert a new one.
These functions are converted to using `upsert`:
alter :: (Maybe a -> Maybe a) -> Key -> Map a -> Map a
upsert :: (Maybe a -> a) -> Key -> Map a -> Map a
`upsert` variants are also added to APIs of the various Word64Map
wrapper types.
The precedent for this `upsert` operation is in the containers library:
see https://github.com/haskell/containers/pull/1145
Metrics: compile_time/bytes allocated
-------------------------------------
geo. mean: -0.1%
minimum: -0.5%
maximum: +0.0%
Resolves #27140.
- - - - -
da7e82f4 by Cheng Shao at 2026-04-08T20:54:49-04:00
testsuite: fix testsuite run for +ipe again
This patch makes the +ipe flavour transformer pass the entire
testsuite again by dropping stdout/stderr checks of certain tests that
are sensitive to stack layout changes with `+ipe`. Related: #26799.
- - - - -
b135a87d by Zubin Duggal at 2026-04-09T19:36:50+05:30
Bump directory submodule to 1.3.11.0 (unreleased)
- - - - -
3a291d07 by Zubin Duggal at 2026-04-09T19:36:50+05:30
Bump file-io submodule to 0.2.0
- - - - -
e0ab606d by Zubin Duggal at 2026-04-10T18:40:20+05:30
Release notes for GHC 10.0
- - - - -
e08b9b34 by Zubin Duggal at 2026-04-10T18:40:20+05:30
Bump ghc-prim version to 0.14.0
- - - - -
a92aac6e by Zubin Duggal at 2026-04-10T18:40:20+05:30
Bump template-haskell to 2.25.0.0; update submodule exceptions for TH 2.25
- - - - -
f254d9e8 by Zubin Duggal at 2026-04-10T18:40:20+05:30
Bump GHC version to 10.0
- - - - -
6ce0368a by Zubin Duggal at 2026-04-10T18:40:28+05:30
Bump base to 4.23.0.0; update submodules for base 4.24 upper bound
- - - - -
702fb8a5 by Zubin Duggal at 2026-04-10T18:40:28+05:30
Bump GHC version to 10.1; update submodules template-haskell-lift and template-haskell-quasiquoter for ghc-internal 10.200
- - - - -
75df1ca4 by Zubin Duggal at 2026-04-10T18:40:28+05:30
Use changelog.d for release notes (#26002)
GHC now uses a fragment-based changelog workflow using a custom script adapted from https://codeberg.org/fgaz/changelog-d.
Contributors add a file in changelog.d/ for each user-facing change.
At release time, these are assembled into release notes for sphinx (in RST) format, using
the tool.
New hadrian `changelog` target to generate changelogs
CI job to validate changelog entries for MRs unless skipped with ~"no-changelog" label
Teach sphinx about ghc-mr: extlink to link to MRs
Remove `ghc-package-list` from sphinx, and implement it in changelog-d instead (Fixes #26476).
(cherry picked from commit 989c07249978f418dfde1353abfad453f024d61a)
- - - - -
585d7450 by Luite Stegeman at 2026-04-11T02:17:13-04:00
tc: discard warnings in tcUserStmt Plan C
We typecheck let_stmt twice, but we don't want the warnings twice!
see #26233
- - - - -
2df604e9 by Sylvain Henry at 2026-04-11T02:19:30-04:00
Introduce TargetInt to represent target's Int (#15973)
GHC was using host 'Int' in several places to represent values that
live in the target machine's 'Int' type. This is silently wrong when
cross-compiling from a 32-bit host to a 64-bit target: the host Int
is 32 bits while the target Int is 64 bits.
See Note [TargetInt] in GHC.Platform.
Also used the opportunity to make DynTag = Word8.
Fixes #15973
Co-Authored-By: Claude Sonnet 4.6 <noreply(a)anthropic.com>
- - - - -
035c86b9 by Matthew Pickering at 2026-04-11T15:08:18+03:00
Introduce a cache of home module providers
This contribution introduces a home modules cache to the module graph
and changes the finder to use that cache to cut down home unit search
work. The particular changes are as follows:
* In `GHC.Unit.Module.Graph`, `ModuleGraph` is extended with a new
field `mg_home_map`, exposed as `mgHomeModuleMap`. This is a data
structure that caches the following:
- The set of home units for which the graph has a complete
module listing
- For each module name, the set of home unit IDs that define it
Operations that construct module graphs are updated such that this
cache stays synchronized.
* In `GHC.Unit.Finder`, `findImportedModule` is changed to pull
`mgHomeModuleMap` from `hsc_mod_graph` and pass it to
`findImportedModuleNoHsc`, which now does not search all home units
that the current unit depends on but first searches those of them
that the cache mentions as potential providers of the requested
module and, if this fails, only those for which the module graph is
incomplete.
The practical effect is that for unqualified and this-package imports,
the finder never blindly searches every home unit on which the current
unit depends when the current module graph already states which units
may provide the requested module. This is a performance optimization,
especially for multi-home-unit builds.
Resolves #27055.
Co-authored-by: Wolfgang Jeltsch <wolfgang(a)well-typed.com>
- - - - -
73ed1da6 by Wolfgang Jeltsch at 2026-04-11T15:08:18+03:00
Reuse `current_unit_id` in a few places
- - - - -
323 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/issue_templates/release_tracking.md
- .gitlab/jobs.yaml
- .gitlab/merge_request_templates/Default.md
- + changelog.d/changelog-entries
- + changelog.d/config
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/InfoTable.hs
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/Dataflow/Graph.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/Core/Multiplicity.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/RoughMap.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCon/Env.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Data/FastString/Env.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Lazy.hs
- compiler/GHC/Data/Word64Map/Strict.hs
- compiler/GHC/Data/Word64Map/Strict/Internal.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Plugins.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Breakpoints.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Platform.hs
- compiler/GHC/Platform/Tag.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/Env.hs
- compiler/GHC/StgToCmm/Expr.hs
- compiler/GHC/StgToCmm/Foreign.hs
- compiler/GHC/StgToCmm/Heap.hs
- compiler/GHC/StgToCmm/InfoTableProv.hs
- compiler/GHC/StgToCmm/Layout.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToCmm/Prof.hs
- compiler/GHC/StgToCmm/Ticky.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Name/Env.hs
- compiler/GHC/Types/Name/Occurrence.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Var/Env.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Wasm/ControlFlow/FromCmm.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Decls/Foreign.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/Language/Haskell/Syntax/Type.hs
- compiler/ghc.cabal.in
- configure.ac
- distrib/configure.ac.in
- − docs/users_guide/10.0.1-notes.rst
- + docs/users_guide/10.2.1-notes.rst
- − docs/users_guide/9.16.1-notes.rst
- docs/users_guide/conf.py
- docs/users_guide/debug-info.rst
- docs/users_guide/exts/linear_types.rst
- + docs/users_guide/exts/modifiers.rst
- docs/users_guide/exts/syntax.rst
- docs/users_guide/ghc_config.py.in
- − docs/users_guide/ghc_packages.py
- docs/users_guide/release-notes.rst
- docs/users_guide/runtime_control.rst
- docs/users_guide/using-optimisation.rst
- docs/users_guide/using-warnings.rst
- ghc/ghc-bin.cabal.in
- hadrian/bindist/Makefile
- hadrian/cfg/system.config.in
- hadrian/hadrian.cabal
- hadrian/src/CommandLine.hs
- hadrian/src/Context.hs
- hadrian/src/Main.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Packages.hs
- + hadrian/src/Rules/Changelog.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Test.hs
- hadrian/src/Settings/Builders/Cabal.hs
- hadrian/src/Settings/Default.hs
- libraries/array
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/tests/enum01.stdout
- libraries/base/tests/enum01.stdout-alpha-dec-osf3
- libraries/base/tests/enum01.stdout-ws-64
- libraries/deepseq
- libraries/directory
- libraries/exceptions
- libraries/file-io
- libraries/filepath
- libraries/ghc-boot-th/ghc-boot-th.cabal.in
- libraries/ghc-boot/ghc-boot.cabal.in
- libraries/ghc-compact/ghc-compact.cabal
- libraries/ghc-experimental/ghc-experimental.cabal.in
- libraries/ghc-experimental/tests/backtraces/all.T
- libraries/ghc-internal/src/GHC/Internal/Char.hs
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- libraries/ghc-internal/tests/stack-annotation/all.T
- libraries/ghc-prim/changelog.md
- libraries/ghc-prim/ghc-prim.cabal
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/ObjLink.hs
- libraries/ghci/GHCi/Run.hs
- libraries/ghci/ghci.cabal.in
- libraries/haskeline
- libraries/hpc
- libraries/os-string
- libraries/parsec
- libraries/process
- libraries/semaphore-compat
- libraries/stm
- libraries/template-haskell-lift
- libraries/template-haskell-quasiquoter
- libraries/template-haskell/template-haskell.cabal.in
- libraries/terminfo
- libraries/unix
- m4/fp_setup_project_version.m4
- m4/fptools_ghc_version.m4
- m4/fptools_set_platform_vars.m4
- m4/ghc_toolchain.m4
- testsuite/driver/testlib.py
- testsuite/mk/boilerplate.mk
- testsuite/tests/dmdanal/should_compile/T13143.stderr
- + testsuite/tests/dmdanal/should_compile/T27106.hs
- + testsuite/tests/dmdanal/should_compile/T27106.stderr
- testsuite/tests/dmdanal/should_compile/all.T
- + testsuite/tests/driver/T26435.ghc.stderr
- + testsuite/tests/driver/T26435.hs
- + testsuite/tests/driver/T26435.stdout
- testsuite/tests/driver/T4437.hs
- testsuite/tests/driver/all.T
- testsuite/tests/driver/linkwhole/Main.hs
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- + testsuite/tests/ghci/scripts/T26233.script
- + testsuite/tests/ghci/scripts/T26233.stderr
- + testsuite/tests/ghci/scripts/T26233.stdout
- testsuite/tests/ghci/scripts/all.T
- testsuite/tests/ghci/should_run/T18064.script
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.hs
- testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.stderr
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/linear/should_compile/Linear1Rule.hs
- testsuite/tests/linear/should_compile/MultConstructor.hs
- testsuite/tests/linear/should_compile/NonLinearRecord.hs
- testsuite/tests/linear/should_compile/OldList.hs
- testsuite/tests/linear/should_compile/T19400.hs
- testsuite/tests/linear/should_compile/T22546.hs
- testsuite/tests/linear/should_compile/T23025.hs
- testsuite/tests/linear/should_compile/T26332.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.stderr
- testsuite/tests/linear/should_fail/LinearLet10.hs
- testsuite/tests/linear/should_fail/LinearLet10.stderr
- testsuite/tests/linear/should_fail/LinearPartialSig.hs
- testsuite/tests/linear/should_fail/LinearPartialSig.stderr
- testsuite/tests/linear/should_fail/LinearRole.hs
- + testsuite/tests/linear/should_fail/LinearUnknownModifierKind.hs
- + testsuite/tests/linear/should_fail/LinearUnknownModifierKind.stderr
- testsuite/tests/linear/should_fail/LinearVar.hs
- testsuite/tests/linear/should_fail/LinearVar.stderr
- testsuite/tests/linear/should_fail/T18888_datakinds.hs
- testsuite/tests/linear/should_fail/T18888_datakinds.stderr
- testsuite/tests/linear/should_fail/T19361.hs
- testsuite/tests/linear/should_fail/T19361.stderr
- testsuite/tests/linear/should_fail/T20083.hs
- testsuite/tests/linear/should_fail/T20083.stderr
- testsuite/tests/linear/should_fail/T21278.hs
- testsuite/tests/linear/should_fail/T21278.stderr
- + testsuite/tests/linear/should_fail/TooManyMultiplicities.hs
- + testsuite/tests/linear/should_fail/TooManyMultiplicities.stderr
- + testsuite/tests/linear/should_fail/TooManyMultiplicitiesU.hs
- + testsuite/tests/linear/should_fail/TooManyMultiplicitiesU.stderr
- testsuite/tests/linear/should_fail/all.T
- testsuite/tests/linters/Makefile
- testsuite/tests/linters/all.T
- + testsuite/tests/linters/changelog-d.stdout
- + testsuite/tests/modifiers/Makefile
- + testsuite/tests/modifiers/should_compile/LinearNoModifiers.hs
- + testsuite/tests/modifiers/should_compile/Makefile
- + testsuite/tests/modifiers/should_compile/Modifier1Linear.hs
- + testsuite/tests/modifiers/should_compile/Modifier1Linear.stderr
- + testsuite/tests/modifiers/should_compile/Modifiers.hs
- + testsuite/tests/modifiers/should_compile/Modifiers.stderr
- + testsuite/tests/modifiers/should_compile/ModifiersSuggestLinear.hs
- + testsuite/tests/modifiers/should_compile/ModifiersSuggestLinear.stderr
- + testsuite/tests/modifiers/should_compile/all.T
- + testsuite/tests/modifiers/should_fail/Makefile
- + testsuite/tests/modifiers/should_fail/ModifiersExprUnexpectedInQuote.hs
- + testsuite/tests/modifiers/should_fail/ModifiersExprUnexpectedInQuote.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersForbiddenHere.hs
- + testsuite/tests/modifiers/should_fail/ModifiersForbiddenHere.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersNoExt.hs
- + testsuite/tests/modifiers/should_fail/ModifiersNoExt.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersUnexpectedInQuote.hs
- + testsuite/tests/modifiers/should_fail/ModifiersUnexpectedInQuote.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersUnknownKind.hs
- + testsuite/tests/modifiers/should_fail/ModifiersUnknownKind.stderr
- + testsuite/tests/modifiers/should_fail/all.T
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T18834a.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/parser/should_fail/T19928.stderr
- testsuite/tests/printer/Makefile
- + testsuite/tests/printer/PprModifiers.hs
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20315.hs
- testsuite/tests/printer/Test20315.stderr
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/printer/all.T
- testsuite/tests/rename/should_compile/T22478a.hs
- testsuite/tests/rts/KeepCafsMain.hs
- testsuite/tests/typecheck/no_skolem_info/T20232.hs
- testsuite/tests/typecheck/no_skolem_info/T20232.stderr
- + utils/changelog-d/ChangelogD.hs
- + utils/changelog-d/LICENSE
- + utils/changelog-d/README.md
- + utils/changelog-d/changelog-d.cabal
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/haddock/haddock-api/haddock-api.cabal
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Interface/RenameType.hs
- utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- utils/haddock/haddock-library/haddock-library.cabal
- utils/haddock/haddock-test/haddock-test.cabal
- utils/haddock/haddock.cabal
- utils/haddock/html-test/src/LinearTypes.hs
- utils/haddock/latex-test/src/LinearTypes/LinearTypes.hs
- utils/hsc2hs
- utils/jsffi/dyld.mjs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/55e8861b6e71550b5ee6cf2c0bb4c3…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/55e8861b6e71550b5ee6cf2c0bb4c3…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/jeltsch/more-efficient-home-unit-imports-finding.fendor-experiment] 31 commits: base: improve error message for Data.Char.chr
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
11 Apr '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding.fendor-experiment at Glasgow Haskell Compiler / GHC
Commits:
502e6ffe by Andrew Lelechenko at 2026-04-07T04:47:21-04:00
base: improve error message for Data.Char.chr
As per https://github.com/haskell/core-libraries-committee/issues/384
- - - - -
b21bd52e by Simon Peyton Jones at 2026-04-07T04:48:07-04:00
Refactor FunResCtxt a bit
Fixes #27154
- - - - -
7fe84ea5 by Zubin Duggal at 2026-04-07T19:11:52+05:30
compiler: Warn when -finfo-table-map is used with -fllvm
These are currently not supported together.
Fixes #26435
- - - - -
4a45a7da by Matthew Pickering at 2026-04-08T04:37:29-04:00
packaging: correctly propagate build/host/target to bindist configure script
At the moment the host and target which we will produce a compiler for
is fixed at the initial configure time. Therefore we need to persist
the choice made at this time into the installation bindist as well so we
look for the right tools, with the right prefixes at install time.
In the future, we want to provide a bit more control about what kind of
bindist we produce so the logic about what the host/target will have to
be written by hadrian rather than persisted by the configure script. In
particular with cross compilers we want to either build a normal stage 2
cross bindist or a stage 3 bindist, which creates a bindist which has a
native compiler for the target platform.
Fixes #21970
Co-authored-by: Sven Tennie <sven.tennie(a)gmail.com>
- - - - -
b0950df6 by Sven Tennie at 2026-04-08T04:37:29-04:00
Cross --host and --target no longer required for cross (#21970)
We set sane defaults in the configure script. Thus, these paramenters
aren't required any longer.
- - - - -
fef35216 by Sven Tennie at 2026-04-08T04:37:30-04:00
ci: Define USER_CONF_CC_OPTS_STAGE2 for aarch64/mingw
ghc-toolchain doesn't see $CONF_CC_OPTS_STAGE2 when the bindist gets
configured. So, the hack to override the compiler gets lost.
- - - - -
8dd6f453 by Cheng Shao at 2026-04-08T04:38:11-04:00
ghci: use ShortByteString for LookupSymbol/LookupSymbolInDLL/LookupClosure messages
This patch refactors ghci to use `ShortByteString` for
`LookupSymbol`/`LookupSymbolInDLL`/`LookupClosure` messages as the
first part of #27147.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
371ef200 by Cheng Shao at 2026-04-08T04:38:11-04:00
ghci: use ShortByteString for MkCostCentres message
This patch refactors ghci to use `ShortByteString` for `MkCostCentres`
messages as a first part of #27147. This also considerably lowers the
memory overhead of breakpoints when cost center profiling is enabled.
-------------------------
Metric Decrease:
interpreter_steplocal
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
4a122bb6 by Phil Hazelden at 2026-04-08T20:49:42-04:00
Implement modifiers syntax.
The `%m` syntax of linear types is now accepted in more places, to allow
use by future extensions, though so far linear types is still the only
consumer.
This may break existing code where it
* Uses -XLinearTypes.
* Has code of the form `a %m -> b`, where `m` can't be inferred to be
kind Multiplicity.
The code can be fixed either by adding a kind annotation, or by setting
`-XLinearTypes -XNoModifiers`.
Proposal:
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0370-m…
- - - - -
07267f79 by Zubin Duggal at 2026-04-08T20:50:25-04:00
hadrian: Don't include the package hash in the haddock directory
Since GHC 9.8 and hash_unit_ids, haddock urls have looked like`ghc-9.10.3/doc/html/libraries/base-4.20.2.0-39f9/**/*.html`
The inclusion of the hash makes it hard for downstream non-boot packages to properly link to these files, as the hash is not
part of a standard cabal substitution.
Since we only build one version of each package, we don't need the hash to disambiguate anything, we can just remove it.
Fixes #26635
- - - - -
0a83b95b by ARATA Mizuki at 2026-04-08T20:51:18-04:00
testsuite: Allow multiple ways to be run by setting multiple command-line options
This patch allows multiple `--test-way`s to take effect, like:
$ hadrian/build test --test-way=normal --test-way=llvm
Previously, only one way was run if the test speed was 'normal' or 'fast'.
Closes #26926
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
- - - - -
e841931c by Teo Camarasu at 2026-04-08T20:52:00-04:00
doc: improve eventlog-flush-interval flag documentation
We mention the performance cost and how this flag can be turned off.
Resolves #27056
- - - - -
e332db25 by Teo Camarasu at 2026-04-08T20:52:01-04:00
docs/user_guide: fix typo
- - - - -
5b82080a by Simon Jakobi at 2026-04-08T20:52:44-04:00
Fix -dsuppress-uniques for free variables in demand signatures
Before: Str=b{sXyZ->S}
With this patch: Str=b{S}
T13143.stderr is updated accordingly.
Fixes #27106.
- - - - -
b7a084cc by Simon Jakobi at 2026-04-08T20:53:27-04:00
Documentation fixes for demand signature notation
Fixes #27115.
- - - - -
59391132 by Simon Jakobi at 2026-04-08T20:54:08-04:00
Use upsert for non-deleting map updates
Some compiler functions were using `alter`, despite never removing
any entries: they only update an existing entry or insert a new one.
These functions are converted to using `upsert`:
alter :: (Maybe a -> Maybe a) -> Key -> Map a -> Map a
upsert :: (Maybe a -> a) -> Key -> Map a -> Map a
`upsert` variants are also added to APIs of the various Word64Map
wrapper types.
The precedent for this `upsert` operation is in the containers library:
see https://github.com/haskell/containers/pull/1145
Metrics: compile_time/bytes allocated
-------------------------------------
geo. mean: -0.1%
minimum: -0.5%
maximum: +0.0%
Resolves #27140.
- - - - -
da7e82f4 by Cheng Shao at 2026-04-08T20:54:49-04:00
testsuite: fix testsuite run for +ipe again
This patch makes the +ipe flavour transformer pass the entire
testsuite again by dropping stdout/stderr checks of certain tests that
are sensitive to stack layout changes with `+ipe`. Related: #26799.
- - - - -
b135a87d by Zubin Duggal at 2026-04-09T19:36:50+05:30
Bump directory submodule to 1.3.11.0 (unreleased)
- - - - -
3a291d07 by Zubin Duggal at 2026-04-09T19:36:50+05:30
Bump file-io submodule to 0.2.0
- - - - -
e0ab606d by Zubin Duggal at 2026-04-10T18:40:20+05:30
Release notes for GHC 10.0
- - - - -
e08b9b34 by Zubin Duggal at 2026-04-10T18:40:20+05:30
Bump ghc-prim version to 0.14.0
- - - - -
a92aac6e by Zubin Duggal at 2026-04-10T18:40:20+05:30
Bump template-haskell to 2.25.0.0; update submodule exceptions for TH 2.25
- - - - -
f254d9e8 by Zubin Duggal at 2026-04-10T18:40:20+05:30
Bump GHC version to 10.0
- - - - -
6ce0368a by Zubin Duggal at 2026-04-10T18:40:28+05:30
Bump base to 4.23.0.0; update submodules for base 4.24 upper bound
- - - - -
702fb8a5 by Zubin Duggal at 2026-04-10T18:40:28+05:30
Bump GHC version to 10.1; update submodules template-haskell-lift and template-haskell-quasiquoter for ghc-internal 10.200
- - - - -
75df1ca4 by Zubin Duggal at 2026-04-10T18:40:28+05:30
Use changelog.d for release notes (#26002)
GHC now uses a fragment-based changelog workflow using a custom script adapted from https://codeberg.org/fgaz/changelog-d.
Contributors add a file in changelog.d/ for each user-facing change.
At release time, these are assembled into release notes for sphinx (in RST) format, using
the tool.
New hadrian `changelog` target to generate changelogs
CI job to validate changelog entries for MRs unless skipped with ~"no-changelog" label
Teach sphinx about ghc-mr: extlink to link to MRs
Remove `ghc-package-list` from sphinx, and implement it in changelog-d instead (Fixes #26476).
(cherry picked from commit 989c07249978f418dfde1353abfad453f024d61a)
- - - - -
585d7450 by Luite Stegeman at 2026-04-11T02:17:13-04:00
tc: discard warnings in tcUserStmt Plan C
We typecheck let_stmt twice, but we don't want the warnings twice!
see #26233
- - - - -
2df604e9 by Sylvain Henry at 2026-04-11T02:19:30-04:00
Introduce TargetInt to represent target's Int (#15973)
GHC was using host 'Int' in several places to represent values that
live in the target machine's 'Int' type. This is silently wrong when
cross-compiling from a 32-bit host to a 64-bit target: the host Int
is 32 bits while the target Int is 64 bits.
See Note [TargetInt] in GHC.Platform.
Also used the opportunity to make DynTag = Word8.
Fixes #15973
Co-Authored-By: Claude Sonnet 4.6 <noreply(a)anthropic.com>
- - - - -
035c86b9 by Matthew Pickering at 2026-04-11T15:08:18+03:00
Introduce a cache of home module providers
This contribution introduces a home modules cache to the module graph
and changes the finder to use that cache to cut down home unit search
work. The particular changes are as follows:
* In `GHC.Unit.Module.Graph`, `ModuleGraph` is extended with a new
field `mg_home_map`, exposed as `mgHomeModuleMap`. This is a data
structure that caches the following:
- The set of home units for which the graph has a complete
module listing
- For each module name, the set of home unit IDs that define it
Operations that construct module graphs are updated such that this
cache stays synchronized.
* In `GHC.Unit.Finder`, `findImportedModule` is changed to pull
`mgHomeModuleMap` from `hsc_mod_graph` and pass it to
`findImportedModuleNoHsc`, which now does not search all home units
that the current unit depends on but first searches those of them
that the cache mentions as potential providers of the requested
module and, if this fails, only those for which the module graph is
incomplete.
The practical effect is that for unqualified and this-package imports,
the finder never blindly searches every home unit on which the current
unit depends when the current module graph already states which units
may provide the requested module. This is a performance optimization,
especially for multi-home-unit builds.
Resolves #27055.
Co-authored-by: Wolfgang Jeltsch <wolfgang(a)well-typed.com>
- - - - -
73ed1da6 by Wolfgang Jeltsch at 2026-04-11T15:08:18+03:00
Reuse `current_unit_id` in a few places
- - - - -
170ba430 by Wolfgang Jeltsch at 2026-04-11T15:10:14+03:00
Experimentally set `candidates` to `Set.empty`
- - - - -
323 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/issue_templates/release_tracking.md
- .gitlab/jobs.yaml
- .gitlab/merge_request_templates/Default.md
- + changelog.d/changelog-entries
- + changelog.d/config
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/InfoTable.hs
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/Dataflow/Graph.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/Core/Multiplicity.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/RoughMap.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCon/Env.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Data/FastString/Env.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Lazy.hs
- compiler/GHC/Data/Word64Map/Strict.hs
- compiler/GHC/Data/Word64Map/Strict/Internal.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Plugins.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Breakpoints.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Platform.hs
- compiler/GHC/Platform/Tag.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/Env.hs
- compiler/GHC/StgToCmm/Expr.hs
- compiler/GHC/StgToCmm/Foreign.hs
- compiler/GHC/StgToCmm/Heap.hs
- compiler/GHC/StgToCmm/InfoTableProv.hs
- compiler/GHC/StgToCmm/Layout.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToCmm/Prof.hs
- compiler/GHC/StgToCmm/Ticky.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Name/Env.hs
- compiler/GHC/Types/Name/Occurrence.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Var/Env.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Wasm/ControlFlow/FromCmm.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Decls/Foreign.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/Language/Haskell/Syntax/Type.hs
- compiler/ghc.cabal.in
- configure.ac
- distrib/configure.ac.in
- − docs/users_guide/10.0.1-notes.rst
- + docs/users_guide/10.2.1-notes.rst
- − docs/users_guide/9.16.1-notes.rst
- docs/users_guide/conf.py
- docs/users_guide/debug-info.rst
- docs/users_guide/exts/linear_types.rst
- + docs/users_guide/exts/modifiers.rst
- docs/users_guide/exts/syntax.rst
- docs/users_guide/ghc_config.py.in
- − docs/users_guide/ghc_packages.py
- docs/users_guide/release-notes.rst
- docs/users_guide/runtime_control.rst
- docs/users_guide/using-optimisation.rst
- docs/users_guide/using-warnings.rst
- ghc/ghc-bin.cabal.in
- hadrian/bindist/Makefile
- hadrian/cfg/system.config.in
- hadrian/hadrian.cabal
- hadrian/src/CommandLine.hs
- hadrian/src/Context.hs
- hadrian/src/Main.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Packages.hs
- + hadrian/src/Rules/Changelog.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Test.hs
- hadrian/src/Settings/Builders/Cabal.hs
- hadrian/src/Settings/Default.hs
- libraries/array
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/tests/enum01.stdout
- libraries/base/tests/enum01.stdout-alpha-dec-osf3
- libraries/base/tests/enum01.stdout-ws-64
- libraries/deepseq
- libraries/directory
- libraries/exceptions
- libraries/file-io
- libraries/filepath
- libraries/ghc-boot-th/ghc-boot-th.cabal.in
- libraries/ghc-boot/ghc-boot.cabal.in
- libraries/ghc-compact/ghc-compact.cabal
- libraries/ghc-experimental/ghc-experimental.cabal.in
- libraries/ghc-experimental/tests/backtraces/all.T
- libraries/ghc-internal/src/GHC/Internal/Char.hs
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- libraries/ghc-internal/tests/stack-annotation/all.T
- libraries/ghc-prim/changelog.md
- libraries/ghc-prim/ghc-prim.cabal
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/ObjLink.hs
- libraries/ghci/GHCi/Run.hs
- libraries/ghci/ghci.cabal.in
- libraries/haskeline
- libraries/hpc
- libraries/os-string
- libraries/parsec
- libraries/process
- libraries/semaphore-compat
- libraries/stm
- libraries/template-haskell-lift
- libraries/template-haskell-quasiquoter
- libraries/template-haskell/template-haskell.cabal.in
- libraries/terminfo
- libraries/unix
- m4/fp_setup_project_version.m4
- m4/fptools_ghc_version.m4
- m4/fptools_set_platform_vars.m4
- m4/ghc_toolchain.m4
- testsuite/driver/testlib.py
- testsuite/mk/boilerplate.mk
- testsuite/tests/dmdanal/should_compile/T13143.stderr
- + testsuite/tests/dmdanal/should_compile/T27106.hs
- + testsuite/tests/dmdanal/should_compile/T27106.stderr
- testsuite/tests/dmdanal/should_compile/all.T
- + testsuite/tests/driver/T26435.ghc.stderr
- + testsuite/tests/driver/T26435.hs
- + testsuite/tests/driver/T26435.stdout
- testsuite/tests/driver/T4437.hs
- testsuite/tests/driver/all.T
- testsuite/tests/driver/linkwhole/Main.hs
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- + testsuite/tests/ghci/scripts/T26233.script
- + testsuite/tests/ghci/scripts/T26233.stderr
- + testsuite/tests/ghci/scripts/T26233.stdout
- testsuite/tests/ghci/scripts/all.T
- testsuite/tests/ghci/should_run/T18064.script
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.hs
- testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.stderr
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/linear/should_compile/Linear1Rule.hs
- testsuite/tests/linear/should_compile/MultConstructor.hs
- testsuite/tests/linear/should_compile/NonLinearRecord.hs
- testsuite/tests/linear/should_compile/OldList.hs
- testsuite/tests/linear/should_compile/T19400.hs
- testsuite/tests/linear/should_compile/T22546.hs
- testsuite/tests/linear/should_compile/T23025.hs
- testsuite/tests/linear/should_compile/T26332.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.stderr
- testsuite/tests/linear/should_fail/LinearLet10.hs
- testsuite/tests/linear/should_fail/LinearLet10.stderr
- testsuite/tests/linear/should_fail/LinearPartialSig.hs
- testsuite/tests/linear/should_fail/LinearPartialSig.stderr
- testsuite/tests/linear/should_fail/LinearRole.hs
- + testsuite/tests/linear/should_fail/LinearUnknownModifierKind.hs
- + testsuite/tests/linear/should_fail/LinearUnknownModifierKind.stderr
- testsuite/tests/linear/should_fail/LinearVar.hs
- testsuite/tests/linear/should_fail/LinearVar.stderr
- testsuite/tests/linear/should_fail/T18888_datakinds.hs
- testsuite/tests/linear/should_fail/T18888_datakinds.stderr
- testsuite/tests/linear/should_fail/T19361.hs
- testsuite/tests/linear/should_fail/T19361.stderr
- testsuite/tests/linear/should_fail/T20083.hs
- testsuite/tests/linear/should_fail/T20083.stderr
- testsuite/tests/linear/should_fail/T21278.hs
- testsuite/tests/linear/should_fail/T21278.stderr
- + testsuite/tests/linear/should_fail/TooManyMultiplicities.hs
- + testsuite/tests/linear/should_fail/TooManyMultiplicities.stderr
- + testsuite/tests/linear/should_fail/TooManyMultiplicitiesU.hs
- + testsuite/tests/linear/should_fail/TooManyMultiplicitiesU.stderr
- testsuite/tests/linear/should_fail/all.T
- testsuite/tests/linters/Makefile
- testsuite/tests/linters/all.T
- + testsuite/tests/linters/changelog-d.stdout
- + testsuite/tests/modifiers/Makefile
- + testsuite/tests/modifiers/should_compile/LinearNoModifiers.hs
- + testsuite/tests/modifiers/should_compile/Makefile
- + testsuite/tests/modifiers/should_compile/Modifier1Linear.hs
- + testsuite/tests/modifiers/should_compile/Modifier1Linear.stderr
- + testsuite/tests/modifiers/should_compile/Modifiers.hs
- + testsuite/tests/modifiers/should_compile/Modifiers.stderr
- + testsuite/tests/modifiers/should_compile/ModifiersSuggestLinear.hs
- + testsuite/tests/modifiers/should_compile/ModifiersSuggestLinear.stderr
- + testsuite/tests/modifiers/should_compile/all.T
- + testsuite/tests/modifiers/should_fail/Makefile
- + testsuite/tests/modifiers/should_fail/ModifiersExprUnexpectedInQuote.hs
- + testsuite/tests/modifiers/should_fail/ModifiersExprUnexpectedInQuote.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersForbiddenHere.hs
- + testsuite/tests/modifiers/should_fail/ModifiersForbiddenHere.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersNoExt.hs
- + testsuite/tests/modifiers/should_fail/ModifiersNoExt.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersUnexpectedInQuote.hs
- + testsuite/tests/modifiers/should_fail/ModifiersUnexpectedInQuote.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersUnknownKind.hs
- + testsuite/tests/modifiers/should_fail/ModifiersUnknownKind.stderr
- + testsuite/tests/modifiers/should_fail/all.T
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T18834a.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/parser/should_fail/T19928.stderr
- testsuite/tests/printer/Makefile
- + testsuite/tests/printer/PprModifiers.hs
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20315.hs
- testsuite/tests/printer/Test20315.stderr
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/printer/all.T
- testsuite/tests/rename/should_compile/T22478a.hs
- testsuite/tests/rts/KeepCafsMain.hs
- testsuite/tests/typecheck/no_skolem_info/T20232.hs
- testsuite/tests/typecheck/no_skolem_info/T20232.stderr
- + utils/changelog-d/ChangelogD.hs
- + utils/changelog-d/LICENSE
- + utils/changelog-d/README.md
- + utils/changelog-d/changelog-d.cabal
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/haddock/haddock-api/haddock-api.cabal
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Interface/RenameType.hs
- utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- utils/haddock/haddock-library/haddock-library.cabal
- utils/haddock/haddock-test/haddock-test.cabal
- utils/haddock/haddock.cabal
- utils/haddock/html-test/src/LinearTypes.hs
- utils/haddock/latex-test/src/LinearTypes/LinearTypes.hs
- utils/hsc2hs
- utils/jsffi/dyld.mjs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f9d9ad2e97013e087ba4473bbf58e6…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f9d9ad2e97013e087ba4473bbf58e6…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/jeltsch/more-efficient-home-unit-imports-finding.jeltsch-experiment] 31 commits: base: improve error message for Data.Char.chr
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
by Wolfgang Jeltsch (@jeltsch) 11 Apr '26
11 Apr '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding.jeltsch-experiment at Glasgow Haskell Compiler / GHC
Commits:
502e6ffe by Andrew Lelechenko at 2026-04-07T04:47:21-04:00
base: improve error message for Data.Char.chr
As per https://github.com/haskell/core-libraries-committee/issues/384
- - - - -
b21bd52e by Simon Peyton Jones at 2026-04-07T04:48:07-04:00
Refactor FunResCtxt a bit
Fixes #27154
- - - - -
7fe84ea5 by Zubin Duggal at 2026-04-07T19:11:52+05:30
compiler: Warn when -finfo-table-map is used with -fllvm
These are currently not supported together.
Fixes #26435
- - - - -
4a45a7da by Matthew Pickering at 2026-04-08T04:37:29-04:00
packaging: correctly propagate build/host/target to bindist configure script
At the moment the host and target which we will produce a compiler for
is fixed at the initial configure time. Therefore we need to persist
the choice made at this time into the installation bindist as well so we
look for the right tools, with the right prefixes at install time.
In the future, we want to provide a bit more control about what kind of
bindist we produce so the logic about what the host/target will have to
be written by hadrian rather than persisted by the configure script. In
particular with cross compilers we want to either build a normal stage 2
cross bindist or a stage 3 bindist, which creates a bindist which has a
native compiler for the target platform.
Fixes #21970
Co-authored-by: Sven Tennie <sven.tennie(a)gmail.com>
- - - - -
b0950df6 by Sven Tennie at 2026-04-08T04:37:29-04:00
Cross --host and --target no longer required for cross (#21970)
We set sane defaults in the configure script. Thus, these paramenters
aren't required any longer.
- - - - -
fef35216 by Sven Tennie at 2026-04-08T04:37:30-04:00
ci: Define USER_CONF_CC_OPTS_STAGE2 for aarch64/mingw
ghc-toolchain doesn't see $CONF_CC_OPTS_STAGE2 when the bindist gets
configured. So, the hack to override the compiler gets lost.
- - - - -
8dd6f453 by Cheng Shao at 2026-04-08T04:38:11-04:00
ghci: use ShortByteString for LookupSymbol/LookupSymbolInDLL/LookupClosure messages
This patch refactors ghci to use `ShortByteString` for
`LookupSymbol`/`LookupSymbolInDLL`/`LookupClosure` messages as the
first part of #27147.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
371ef200 by Cheng Shao at 2026-04-08T04:38:11-04:00
ghci: use ShortByteString for MkCostCentres message
This patch refactors ghci to use `ShortByteString` for `MkCostCentres`
messages as a first part of #27147. This also considerably lowers the
memory overhead of breakpoints when cost center profiling is enabled.
-------------------------
Metric Decrease:
interpreter_steplocal
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
4a122bb6 by Phil Hazelden at 2026-04-08T20:49:42-04:00
Implement modifiers syntax.
The `%m` syntax of linear types is now accepted in more places, to allow
use by future extensions, though so far linear types is still the only
consumer.
This may break existing code where it
* Uses -XLinearTypes.
* Has code of the form `a %m -> b`, where `m` can't be inferred to be
kind Multiplicity.
The code can be fixed either by adding a kind annotation, or by setting
`-XLinearTypes -XNoModifiers`.
Proposal:
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0370-m…
- - - - -
07267f79 by Zubin Duggal at 2026-04-08T20:50:25-04:00
hadrian: Don't include the package hash in the haddock directory
Since GHC 9.8 and hash_unit_ids, haddock urls have looked like`ghc-9.10.3/doc/html/libraries/base-4.20.2.0-39f9/**/*.html`
The inclusion of the hash makes it hard for downstream non-boot packages to properly link to these files, as the hash is not
part of a standard cabal substitution.
Since we only build one version of each package, we don't need the hash to disambiguate anything, we can just remove it.
Fixes #26635
- - - - -
0a83b95b by ARATA Mizuki at 2026-04-08T20:51:18-04:00
testsuite: Allow multiple ways to be run by setting multiple command-line options
This patch allows multiple `--test-way`s to take effect, like:
$ hadrian/build test --test-way=normal --test-way=llvm
Previously, only one way was run if the test speed was 'normal' or 'fast'.
Closes #26926
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
- - - - -
e841931c by Teo Camarasu at 2026-04-08T20:52:00-04:00
doc: improve eventlog-flush-interval flag documentation
We mention the performance cost and how this flag can be turned off.
Resolves #27056
- - - - -
e332db25 by Teo Camarasu at 2026-04-08T20:52:01-04:00
docs/user_guide: fix typo
- - - - -
5b82080a by Simon Jakobi at 2026-04-08T20:52:44-04:00
Fix -dsuppress-uniques for free variables in demand signatures
Before: Str=b{sXyZ->S}
With this patch: Str=b{S}
T13143.stderr is updated accordingly.
Fixes #27106.
- - - - -
b7a084cc by Simon Jakobi at 2026-04-08T20:53:27-04:00
Documentation fixes for demand signature notation
Fixes #27115.
- - - - -
59391132 by Simon Jakobi at 2026-04-08T20:54:08-04:00
Use upsert for non-deleting map updates
Some compiler functions were using `alter`, despite never removing
any entries: they only update an existing entry or insert a new one.
These functions are converted to using `upsert`:
alter :: (Maybe a -> Maybe a) -> Key -> Map a -> Map a
upsert :: (Maybe a -> a) -> Key -> Map a -> Map a
`upsert` variants are also added to APIs of the various Word64Map
wrapper types.
The precedent for this `upsert` operation is in the containers library:
see https://github.com/haskell/containers/pull/1145
Metrics: compile_time/bytes allocated
-------------------------------------
geo. mean: -0.1%
minimum: -0.5%
maximum: +0.0%
Resolves #27140.
- - - - -
da7e82f4 by Cheng Shao at 2026-04-08T20:54:49-04:00
testsuite: fix testsuite run for +ipe again
This patch makes the +ipe flavour transformer pass the entire
testsuite again by dropping stdout/stderr checks of certain tests that
are sensitive to stack layout changes with `+ipe`. Related: #26799.
- - - - -
b135a87d by Zubin Duggal at 2026-04-09T19:36:50+05:30
Bump directory submodule to 1.3.11.0 (unreleased)
- - - - -
3a291d07 by Zubin Duggal at 2026-04-09T19:36:50+05:30
Bump file-io submodule to 0.2.0
- - - - -
e0ab606d by Zubin Duggal at 2026-04-10T18:40:20+05:30
Release notes for GHC 10.0
- - - - -
e08b9b34 by Zubin Duggal at 2026-04-10T18:40:20+05:30
Bump ghc-prim version to 0.14.0
- - - - -
a92aac6e by Zubin Duggal at 2026-04-10T18:40:20+05:30
Bump template-haskell to 2.25.0.0; update submodule exceptions for TH 2.25
- - - - -
f254d9e8 by Zubin Duggal at 2026-04-10T18:40:20+05:30
Bump GHC version to 10.0
- - - - -
6ce0368a by Zubin Duggal at 2026-04-10T18:40:28+05:30
Bump base to 4.23.0.0; update submodules for base 4.24 upper bound
- - - - -
702fb8a5 by Zubin Duggal at 2026-04-10T18:40:28+05:30
Bump GHC version to 10.1; update submodules template-haskell-lift and template-haskell-quasiquoter for ghc-internal 10.200
- - - - -
75df1ca4 by Zubin Duggal at 2026-04-10T18:40:28+05:30
Use changelog.d for release notes (#26002)
GHC now uses a fragment-based changelog workflow using a custom script adapted from https://codeberg.org/fgaz/changelog-d.
Contributors add a file in changelog.d/ for each user-facing change.
At release time, these are assembled into release notes for sphinx (in RST) format, using
the tool.
New hadrian `changelog` target to generate changelogs
CI job to validate changelog entries for MRs unless skipped with ~"no-changelog" label
Teach sphinx about ghc-mr: extlink to link to MRs
Remove `ghc-package-list` from sphinx, and implement it in changelog-d instead (Fixes #26476).
(cherry picked from commit 989c07249978f418dfde1353abfad453f024d61a)
- - - - -
585d7450 by Luite Stegeman at 2026-04-11T02:17:13-04:00
tc: discard warnings in tcUserStmt Plan C
We typecheck let_stmt twice, but we don't want the warnings twice!
see #26233
- - - - -
2df604e9 by Sylvain Henry at 2026-04-11T02:19:30-04:00
Introduce TargetInt to represent target's Int (#15973)
GHC was using host 'Int' in several places to represent values that
live in the target machine's 'Int' type. This is silently wrong when
cross-compiling from a 32-bit host to a 64-bit target: the host Int
is 32 bits while the target Int is 64 bits.
See Note [TargetInt] in GHC.Platform.
Also used the opportunity to make DynTag = Word8.
Fixes #15973
Co-Authored-By: Claude Sonnet 4.6 <noreply(a)anthropic.com>
- - - - -
035c86b9 by Matthew Pickering at 2026-04-11T15:08:18+03:00
Introduce a cache of home module providers
This contribution introduces a home modules cache to the module graph
and changes the finder to use that cache to cut down home unit search
work. The particular changes are as follows:
* In `GHC.Unit.Module.Graph`, `ModuleGraph` is extended with a new
field `mg_home_map`, exposed as `mgHomeModuleMap`. This is a data
structure that caches the following:
- The set of home units for which the graph has a complete
module listing
- For each module name, the set of home unit IDs that define it
Operations that construct module graphs are updated such that this
cache stays synchronized.
* In `GHC.Unit.Finder`, `findImportedModule` is changed to pull
`mgHomeModuleMap` from `hsc_mod_graph` and pass it to
`findImportedModuleNoHsc`, which now does not search all home units
that the current unit depends on but first searches those of them
that the cache mentions as potential providers of the requested
module and, if this fails, only those for which the module graph is
incomplete.
The practical effect is that for unqualified and this-package imports,
the finder never blindly searches every home unit on which the current
unit depends when the current module graph already states which units
may provide the requested module. This is a performance optimization,
especially for multi-home-unit builds.
Resolves #27055.
Co-authored-by: Wolfgang Jeltsch <wolfgang(a)well-typed.com>
- - - - -
73ed1da6 by Wolfgang Jeltsch at 2026-04-11T15:08:18+03:00
Reuse `current_unit_id` in a few places
- - - - -
91489d4a by Wolfgang Jeltsch at 2026-04-11T15:10:28+03:00
Experimentally exclude `dep_providers` from `excluded`
- - - - -
323 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/issue_templates/release_tracking.md
- .gitlab/jobs.yaml
- .gitlab/merge_request_templates/Default.md
- + changelog.d/changelog-entries
- + changelog.d/config
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/InfoTable.hs
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/Dataflow/Graph.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/CFG.hs
- compiler/GHC/Core/Multiplicity.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/RoughMap.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCon/Env.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Data/FastString/Env.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Lazy.hs
- compiler/GHC/Data/Word64Map/Strict.hs
- compiler/GHC/Data/Word64Map/Strict/Internal.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Plugins.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Breakpoints.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Platform.hs
- compiler/GHC/Platform/Tag.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/Env.hs
- compiler/GHC/StgToCmm/Expr.hs
- compiler/GHC/StgToCmm/Foreign.hs
- compiler/GHC/StgToCmm/Heap.hs
- compiler/GHC/StgToCmm/InfoTableProv.hs
- compiler/GHC/StgToCmm/Layout.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToCmm/Prof.hs
- compiler/GHC/StgToCmm/Ticky.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Name/Env.hs
- compiler/GHC/Types/Name/Occurrence.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Var/Env.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Wasm/ControlFlow/FromCmm.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Decls/Foreign.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/Language/Haskell/Syntax/Type.hs
- compiler/ghc.cabal.in
- configure.ac
- distrib/configure.ac.in
- − docs/users_guide/10.0.1-notes.rst
- + docs/users_guide/10.2.1-notes.rst
- − docs/users_guide/9.16.1-notes.rst
- docs/users_guide/conf.py
- docs/users_guide/debug-info.rst
- docs/users_guide/exts/linear_types.rst
- + docs/users_guide/exts/modifiers.rst
- docs/users_guide/exts/syntax.rst
- docs/users_guide/ghc_config.py.in
- − docs/users_guide/ghc_packages.py
- docs/users_guide/release-notes.rst
- docs/users_guide/runtime_control.rst
- docs/users_guide/using-optimisation.rst
- docs/users_guide/using-warnings.rst
- ghc/ghc-bin.cabal.in
- hadrian/bindist/Makefile
- hadrian/cfg/system.config.in
- hadrian/hadrian.cabal
- hadrian/src/CommandLine.hs
- hadrian/src/Context.hs
- hadrian/src/Main.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Packages.hs
- + hadrian/src/Rules/Changelog.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Test.hs
- hadrian/src/Settings/Builders/Cabal.hs
- hadrian/src/Settings/Default.hs
- libraries/array
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/tests/enum01.stdout
- libraries/base/tests/enum01.stdout-alpha-dec-osf3
- libraries/base/tests/enum01.stdout-ws-64
- libraries/deepseq
- libraries/directory
- libraries/exceptions
- libraries/file-io
- libraries/filepath
- libraries/ghc-boot-th/ghc-boot-th.cabal.in
- libraries/ghc-boot/ghc-boot.cabal.in
- libraries/ghc-compact/ghc-compact.cabal
- libraries/ghc-experimental/ghc-experimental.cabal.in
- libraries/ghc-experimental/tests/backtraces/all.T
- libraries/ghc-internal/src/GHC/Internal/Char.hs
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- libraries/ghc-internal/tests/stack-annotation/all.T
- libraries/ghc-prim/changelog.md
- libraries/ghc-prim/ghc-prim.cabal
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/ObjLink.hs
- libraries/ghci/GHCi/Run.hs
- libraries/ghci/ghci.cabal.in
- libraries/haskeline
- libraries/hpc
- libraries/os-string
- libraries/parsec
- libraries/process
- libraries/semaphore-compat
- libraries/stm
- libraries/template-haskell-lift
- libraries/template-haskell-quasiquoter
- libraries/template-haskell/template-haskell.cabal.in
- libraries/terminfo
- libraries/unix
- m4/fp_setup_project_version.m4
- m4/fptools_ghc_version.m4
- m4/fptools_set_platform_vars.m4
- m4/ghc_toolchain.m4
- testsuite/driver/testlib.py
- testsuite/mk/boilerplate.mk
- testsuite/tests/dmdanal/should_compile/T13143.stderr
- + testsuite/tests/dmdanal/should_compile/T27106.hs
- + testsuite/tests/dmdanal/should_compile/T27106.stderr
- testsuite/tests/dmdanal/should_compile/all.T
- + testsuite/tests/driver/T26435.ghc.stderr
- + testsuite/tests/driver/T26435.hs
- + testsuite/tests/driver/T26435.stdout
- testsuite/tests/driver/T4437.hs
- testsuite/tests/driver/all.T
- testsuite/tests/driver/linkwhole/Main.hs
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- + testsuite/tests/ghci/scripts/T26233.script
- + testsuite/tests/ghci/scripts/T26233.stderr
- + testsuite/tests/ghci/scripts/T26233.stdout
- testsuite/tests/ghci/scripts/all.T
- testsuite/tests/ghci/should_run/T18064.script
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.hs
- testsuite/tests/haddock/should_compile_flag_haddock/haddockLinear.stderr
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/linear/should_compile/Linear1Rule.hs
- testsuite/tests/linear/should_compile/MultConstructor.hs
- testsuite/tests/linear/should_compile/NonLinearRecord.hs
- testsuite/tests/linear/should_compile/OldList.hs
- testsuite/tests/linear/should_compile/T19400.hs
- testsuite/tests/linear/should_compile/T22546.hs
- testsuite/tests/linear/should_compile/T23025.hs
- testsuite/tests/linear/should_compile/T26332.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.hs
- testsuite/tests/linear/should_fail/LinearErrOrigin.stderr
- testsuite/tests/linear/should_fail/LinearLet10.hs
- testsuite/tests/linear/should_fail/LinearLet10.stderr
- testsuite/tests/linear/should_fail/LinearPartialSig.hs
- testsuite/tests/linear/should_fail/LinearPartialSig.stderr
- testsuite/tests/linear/should_fail/LinearRole.hs
- + testsuite/tests/linear/should_fail/LinearUnknownModifierKind.hs
- + testsuite/tests/linear/should_fail/LinearUnknownModifierKind.stderr
- testsuite/tests/linear/should_fail/LinearVar.hs
- testsuite/tests/linear/should_fail/LinearVar.stderr
- testsuite/tests/linear/should_fail/T18888_datakinds.hs
- testsuite/tests/linear/should_fail/T18888_datakinds.stderr
- testsuite/tests/linear/should_fail/T19361.hs
- testsuite/tests/linear/should_fail/T19361.stderr
- testsuite/tests/linear/should_fail/T20083.hs
- testsuite/tests/linear/should_fail/T20083.stderr
- testsuite/tests/linear/should_fail/T21278.hs
- testsuite/tests/linear/should_fail/T21278.stderr
- + testsuite/tests/linear/should_fail/TooManyMultiplicities.hs
- + testsuite/tests/linear/should_fail/TooManyMultiplicities.stderr
- + testsuite/tests/linear/should_fail/TooManyMultiplicitiesU.hs
- + testsuite/tests/linear/should_fail/TooManyMultiplicitiesU.stderr
- testsuite/tests/linear/should_fail/all.T
- testsuite/tests/linters/Makefile
- testsuite/tests/linters/all.T
- + testsuite/tests/linters/changelog-d.stdout
- + testsuite/tests/modifiers/Makefile
- + testsuite/tests/modifiers/should_compile/LinearNoModifiers.hs
- + testsuite/tests/modifiers/should_compile/Makefile
- + testsuite/tests/modifiers/should_compile/Modifier1Linear.hs
- + testsuite/tests/modifiers/should_compile/Modifier1Linear.stderr
- + testsuite/tests/modifiers/should_compile/Modifiers.hs
- + testsuite/tests/modifiers/should_compile/Modifiers.stderr
- + testsuite/tests/modifiers/should_compile/ModifiersSuggestLinear.hs
- + testsuite/tests/modifiers/should_compile/ModifiersSuggestLinear.stderr
- + testsuite/tests/modifiers/should_compile/all.T
- + testsuite/tests/modifiers/should_fail/Makefile
- + testsuite/tests/modifiers/should_fail/ModifiersExprUnexpectedInQuote.hs
- + testsuite/tests/modifiers/should_fail/ModifiersExprUnexpectedInQuote.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersForbiddenHere.hs
- + testsuite/tests/modifiers/should_fail/ModifiersForbiddenHere.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersNoExt.hs
- + testsuite/tests/modifiers/should_fail/ModifiersNoExt.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersUnexpectedInQuote.hs
- + testsuite/tests/modifiers/should_fail/ModifiersUnexpectedInQuote.stderr
- + testsuite/tests/modifiers/should_fail/ModifiersUnknownKind.hs
- + testsuite/tests/modifiers/should_fail/ModifiersUnknownKind.stderr
- + testsuite/tests/modifiers/should_fail/all.T
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T18834a.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/parser/should_fail/T19928.stderr
- testsuite/tests/printer/Makefile
- + testsuite/tests/printer/PprModifiers.hs
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20315.hs
- testsuite/tests/printer/Test20315.stderr
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/printer/all.T
- testsuite/tests/rename/should_compile/T22478a.hs
- testsuite/tests/rts/KeepCafsMain.hs
- testsuite/tests/typecheck/no_skolem_info/T20232.hs
- testsuite/tests/typecheck/no_skolem_info/T20232.stderr
- + utils/changelog-d/ChangelogD.hs
- + utils/changelog-d/LICENSE
- + utils/changelog-d/README.md
- + utils/changelog-d/changelog-d.cabal
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/haddock/haddock-api/haddock-api.cabal
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Interface/RenameType.hs
- utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- utils/haddock/haddock-library/haddock-library.cabal
- utils/haddock/haddock-test/haddock-test.cabal
- utils/haddock/haddock.cabal
- utils/haddock/html-test/src/LinearTypes.hs
- utils/haddock/latex-test/src/LinearTypes/LinearTypes.hs
- utils/hsc2hs
- utils/jsffi/dyld.mjs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9c1ebab719c3d644d1da84553182ac…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9c1ebab719c3d644d1da84553182ac…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
11 Apr '26
Simon Peyton Jones pushed to branch wip/spj-reinstallable-base at Glasgow Haskell Compiler / GHC
Commits:
b3583936 by Simon Peyton Jones at 2026-04-11T12:07:32+01:00
Wibbles
- - - - -
33 changed files:
- compiler/GHC/Builtin/KnownKeys.hs
- compiler/GHC/Builtin/KnownOccs.hs
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/HsToCore/Foreign/JavaScript.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Module.hs
- libraries/base/src/GHC/RTS/Flags.hs
- libraries/base/src/System/IO/Unsafe.hs
- libraries/ghc-internal/src/GHC/Internal/AllocationLimitHandler.hs
- libraries/ghc-internal/src/GHC/Internal/Bignum/BigNat.hs-boot
- libraries/ghc-internal/src/GHC/Internal/Conc/Bound.hs
- libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Monad.hs
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/ST/Lazy/Imp.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Functor/Const.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Version.hs
- libraries/ghc-internal/src/GHC/Internal/Enum.hs-boot
- libraries/ghc-internal/src/GHC/Internal/Event/TimeOut.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Context.hs-boot
- libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs-boot
- libraries/ghc-internal/src/GHC/Internal/Foreign/Marshal/Pool.hs
- libraries/ghc-internal/src/GHC/Internal/Generics.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/Exception.hs-boot
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Types.hs-boot
- libraries/ghc-internal/src/GHC/Internal/Num.hs-boot
- libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc
- libraries/ghc-internal/src/GHC/Internal/Real.hs-boot
- libraries/ghc-internal/src/GHC/Internal/Unicode/Version.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b358393648958939a8d6014b02e3aac…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b358393648958939a8d6014b02e3aac…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] Introduce TargetInt to represent target's Int (#15973)
by Marge Bot (@marge-bot) 11 Apr '26
by Marge Bot (@marge-bot) 11 Apr '26
11 Apr '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
2df604e9 by Sylvain Henry at 2026-04-11T02:19:30-04:00
Introduce TargetInt to represent target's Int (#15973)
GHC was using host 'Int' in several places to represent values that
live in the target machine's 'Int' type. This is silently wrong when
cross-compiling from a 32-bit host to a 64-bit target: the host Int
is 32 bits while the target Int is 64 bits.
See Note [TargetInt] in GHC.Platform.
Also used the opportunity to make DynTag = Word8.
Fixes #15973
Co-Authored-By: Claude Sonnet 4.6 <noreply(a)anthropic.com>
- - - - -
18 changed files:
- compiler/GHC/ByteCode/InfoTable.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/Platform.hs
- compiler/GHC/Platform/Tag.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/Env.hs
- compiler/GHC/StgToCmm/Expr.hs
- compiler/GHC/StgToCmm/Foreign.hs
- compiler/GHC/StgToCmm/Heap.hs
- compiler/GHC/StgToCmm/InfoTableProv.hs
- compiler/GHC/StgToCmm/Layout.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToCmm/Prof.hs
- compiler/GHC/StgToCmm/Ticky.hs
- compiler/GHC/StgToCmm/Utils.hs
Changes:
=====================================
compiler/GHC/ByteCode/InfoTable.hs
=====================================
@@ -21,7 +21,7 @@ import GHC.Core.TyCon ( TyCon, tyConFamilySize, isBoxedDataTyCon, tyConDat
import GHC.Core.Multiplicity ( scaledThing )
import GHC.StgToCmm.Layout ( mkVirtConstrSizes )
-import GHC.StgToCmm.Closure ( tagForCon )
+import GHC.StgToCmm.Closure ( tagForCon, fromDynTag )
import GHC.Utils.Misc
import GHC.Utils.Panic
@@ -58,7 +58,7 @@ make_constr_itbls profile cons =
ptrs'
nptrs_really
conNo
- (tagForCon platform dcon)
+ (fromDynTag (tagForCon platform dcon))
descr
)
where
=====================================
compiler/GHC/Cmm/LayoutStack.hs
=====================================
@@ -927,7 +927,7 @@ areaToSp platform sp_old _sp_hwm area_off (CmmStackSlot area n)
-- Replace (CmmStackSlot area n) with an offset from Sp
areaToSp platform _ sp_hwm _ (CmmLit CmmHighStackMark)
- = mkIntExpr platform sp_hwm
+ = mkIntExpr platform (toTargetInt sp_hwm)
-- Replace CmmHighStackMark with the number of bytes of stack used,
-- the sp_hwm. See Note [Stack usage] in GHC.StgToCmm.Heap
@@ -1199,7 +1199,7 @@ lowerSafeForeignCall profile block
callSuspendThread :: Platform -> LocalReg -> Bool -> CmmNode O O
callSuspendThread platform id intrbl =
CmmUnsafeForeignCall (PrimTarget MO_SuspendThread)
- [id] [baseExpr platform, mkIntExpr platform (fromEnum intrbl)]
+ [id] [baseExpr platform, mkIntExpr platform (toTargetInt (fromEnum intrbl))]
callResumeThread :: LocalReg -> LocalReg -> CmmNode O O
callResumeThread new_base id =
=====================================
compiler/GHC/Cmm/Utils.hs
=====================================
@@ -162,12 +162,16 @@ typeForeignHint = primRepForeignHint . typePrimRepU
--
---------------------------------------------------
--- XXX: should really be Integer, since Int doesn't necessarily cover
--- the full range of target Ints.
-mkIntCLit :: Platform -> Int -> CmmLit
+-- | Make a word-width 'CmmLit' for a target 'Int' value.
+-- Uses 'TargetInt' (= 'Int64') rather than host 'Int' to avoid
+-- truncation when cross-compiling from a 32-bit host to a 64-bit target.
+-- See Note [TargetInt] in GHC.Platform.
+mkIntCLit :: Platform -> TargetInt -> CmmLit
mkIntCLit platform i = CmmInt (toInteger i) (wordWidth platform)
-mkIntExpr :: Platform -> Int -> CmmExpr
+-- | Make a word-width 'CmmExpr' for a target 'Int' value.
+-- See Note [TargetInt] in GHC.Platform.
+mkIntExpr :: Platform -> TargetInt -> CmmExpr
mkIntExpr platform i = CmmLit $! mkIntCLit platform i
zeroCLit :: Platform -> CmmLit
@@ -279,7 +283,7 @@ cmmIndexExpr platform width base idx =
cmmOffsetExpr platform base byte_off
where
idx_w = cmmExprWidth platform idx
- byte_off = CmmMachOp (MO_Shl idx_w) [idx, mkIntExpr platform (widthInLog width)]
+ byte_off = CmmMachOp (MO_Shl idx_w) [idx, mkIntExpr platform (toTargetInt (widthInLog width))]
cmmLoadIndex :: Platform -> CmmType -> CmmExpr -> Int -> CmmExpr
cmmLoadIndex platform ty expr ix =
=====================================
compiler/GHC/Platform.hs
=====================================
@@ -44,6 +44,9 @@ module GHC.Platform
, platformHsSOName
, platformSOExt
, genericPlatform
+ -- * Target integer type
+ , TargetInt
+ , toTargetInt
)
where
@@ -61,6 +64,25 @@ import Data.Int
import System.FilePath
import System.Directory
+-- Note [TargetInt]
+-- ~~~~~~~~~~~~~~~~
+-- GHC uses 'TargetInt' to represent a value of type 'Int' on the target
+-- machine. This is distinct from the host's 'Int' type: when cross-compiling
+-- from a 32-bit host to a 64-bit target, the host 'Int' is 32 bits but the
+-- target's 'Int' type is 64 bits. Using host 'Int' to store target 'Int'
+-- values would cause silent truncation in that scenario.
+--
+-- We use 'Int64' because it covers the full range of any supported target
+-- (32-bit or 64-bit), while still being a fixed-size type that participates in
+-- correct signed arithmetic (e.g. bitwise complement, see 'cmmPointerMask').
+type TargetInt = Int64
+
+-- | Convert a host-side 'Int' value to a 'TargetInt'.
+-- Use this when converting host-computed counts or offsets into target-sized
+-- integers, e.g. when passing to 'mkIntExpr' or 'mkIntCLit'.
+toTargetInt :: Int -> TargetInt
+toTargetInt = fromIntegral
+
-- | Platform description
--
-- This is used to describe platforms so that we can generate code for them.
=====================================
compiler/GHC/Platform/Tag.hs
=====================================
@@ -6,14 +6,24 @@ module GHC.Platform.Tag
, tAG_MASK
, mAX_PTR_TAG
, isSmallFamily
+ , toDynTag
+ , fromDynTag
) where
import GHC.Prelude
import GHC.Platform
+import GHC.Utils.Panic.Plain (assert)
--- | The tag on a pointer (from the dynamic-tagging paper)
-type DynTag = Int
+import Data.Word (Word8)
+
+-- | The tag on a pointer (from the dynamic-tagging paper).
+-- Wraps a 'Word8' because pointer tags are non-negative and bounded by the
+-- number of tag bits on the platform (2 or 3 bits in practice), so values
+-- never exceed 7. Use 'toDynTag' to construct, 'fromDynTag' to extract.
+-- See Note [Data constructor dynamic tags].
+newtype DynTag = DynTag Word8
+ deriving (Eq, Ord, Show)
{- Note [Data constructor dynamic tags]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -35,13 +45,37 @@ The interpreter also needs to be updated if we change the
tagging strategy; see tagConstr in rts/Interpreter.c.
-}
--- | Tag bits mask / maximum pointer tag value, derived from the
--- number of tag bits on the platform.
-tAG_MASK, mAX_PTR_TAG :: Platform -> Int
+-- | Word-sized bitmask of the tag bits (all tag bits set to 1).
+-- Used in bitwise operations such as 'cmmTagMask' and 'cmmPointerMask'.
+-- This is a 'TargetInt' because it participates in word-width arithmetic
+-- on the target (see Note [TargetInt] in GHC.Platform).
+tAG_MASK :: Platform -> TargetInt
tAG_MASK platform = (1 `shiftL` pc_TAG_BITS (platformConstants platform)) - 1
-mAX_PTR_TAG = tAG_MASK
+
+-- | Maximum pointer tag value; equivalently the number of tag bits set.
+-- This is the 'DynTag' companion to 'tAG_MASK': small enough to fit in
+-- 'Word8' since it equals tAG_MASK but is used as a tag number, not a mask.
+mAX_PTR_TAG :: Platform -> DynTag
+mAX_PTR_TAG platform = DynTag (fromIntegral (tAG_MASK platform))
+
+-- | Narrow a host-side 'Int' to a 'DynTag', asserting that the value is
+-- non-negative and does not exceed 'mAX_PTR_TAG' for the given platform.
+toDynTag :: Platform -> Int -> DynTag
+toDynTag platform n =
+ assert (n >= 0 && n <= fromDynTag (mAX_PTR_TAG platform)) $
+ DynTag (fromIntegral n)
+
+-- | Unwrap a 'DynTag' to a host-side 'Int'.
+-- Safe because 'DynTag' values are always small: at most 'mAX_PTR_TAG',
+-- bounded by the number of tag bits on the platform (typically 2 or 3 bits,
+-- so at most 7).
+fromDynTag :: DynTag -> Int
+fromDynTag (DynTag w) = fromIntegral w
-- | Is a data type family small enough that each constructor can get
-- its own pointer tag?
+--
+-- 'fam_size' is a host-side constructor count; compare against
+-- 'mAX_PTR_TAG' via 'fromDynTag' to stay in 'Int' arithmetic.
isSmallFamily :: Platform -> Int -> Bool
-isSmallFamily platform fam_size = fam_size <= mAX_PTR_TAG platform
+isSmallFamily platform fam_size = fam_size <= fromDynTag (mAX_PTR_TAG platform)
=====================================
compiler/GHC/StgToCmm.hs
=====================================
@@ -303,7 +303,7 @@ cgEnumerationTyCon tycon
= do platform <- getPlatform
emitRODataLits (mkClosureTableLabel (tyConName tycon) NoCafRefs)
[ CmmLabelOff (mkClosureLabel (dataConName con) NoCafRefs)
- (tagForCon platform con)
+ (fromDynTag (tagForCon platform con))
| con <- tyConDataCons tycon]
cgDataCon :: ConInfoTableLocation -> DataCon -> FCode ()
@@ -342,7 +342,7 @@ cgDataCon mn data_con
; let node = CmmReg $ nodeReg platform
; ldvEnter node
; tickyReturnOldCon (length arg_reps)
- ; void $ emitReturn [cmmOffsetB platform node (tagForCon platform data_con)]
+ ; void $ emitReturn [cmmOffsetB platform node (fromDynTag (tagForCon platform data_con))]
}
-- The case continuation code expects a tagged pointer
}
=====================================
compiler/GHC/StgToCmm/Bind.hs
=====================================
@@ -589,7 +589,7 @@ closureCodeBody top_lvl bndr cl_info cc args@(arg0:_) body fv_details
; enterCostCentreFun cc
(CmmMachOp (mo_wordSub platform)
[ CmmReg (CmmLocal node) -- See [NodeReg clobbered with loopification]
- , mkIntExpr platform (funTag platform cl_info) ])
+ , mkIntExpr platform (toTargetInt (fromDynTag (funTag platform cl_info))) ])
; fv_bindings <- mapM bind_fv fv_details
-- Load free vars out of closure *after*
-- heap check, to reduce live vars over check
=====================================
compiler/GHC/StgToCmm/Closure.hs
=====================================
@@ -12,7 +12,7 @@
-----------------------------------------------------------------------------
module GHC.StgToCmm.Closure (
- DynTag, tagForCon, isSmallFamily,
+ DynTag, tagForCon, isSmallFamily, toDynTag, fromDynTag,
idPrimRep1, idPrimRepU, isGcPtrRep, addIdReps, addArgReps,
@@ -65,7 +65,7 @@ module GHC.StgToCmm.Closure (
import GHC.Prelude
import GHC.Platform
-import GHC.Platform.Tag (DynTag, mAX_PTR_TAG, isSmallFamily)
+import GHC.Platform.Tag (DynTag, mAX_PTR_TAG, isSmallFamily, toDynTag, fromDynTag)
import GHC.Platform.Profile
import GHC.Stg.Syntax
@@ -320,13 +320,13 @@ mkLFStringLit = LFUnlifted
-----------------------------------------------------
tagForCon :: Platform -> DataCon -> DynTag
-tagForCon platform con = min (dataConTag con) (mAX_PTR_TAG platform)
--- NB: 1-indexed
+-- NB: 1-indexed; result is clamped to mAX_PTR_TAG.
+tagForCon platform con = toDynTag platform (min (dataConTag con) (fromDynTag (mAX_PTR_TAG platform)))
tagForArity :: Platform -> RepArity -> DynTag
tagForArity platform arity
- | isSmallFamily platform arity = arity
- | otherwise = 0
+ | isSmallFamily platform arity = toDynTag platform arity
+ | otherwise = toDynTag platform 0
-- | Return the tag in the low order bits of a variable bound
-- to this LambdaForm
@@ -334,7 +334,7 @@ lfDynTag :: Platform -> LambdaFormInfo -> DynTag
lfDynTag platform lf = case lf of
LFCon con -> tagForCon platform con
LFReEntrant _ arity _ _ -> tagForArity platform arity
- _other -> 0
+ _other -> toDynTag platform 0
-----------------------------------------------------------------------------
=====================================
compiler/GHC/StgToCmm/Env.hs
=====================================
@@ -90,7 +90,7 @@ idInfoToAmode cg_info
-- | A tag adds a byte offset to the pointer
addDynTag :: Platform -> CmmExpr -> DynTag -> CmmExpr
-addDynTag = cmmOffsetB
+addDynTag platform e tag = cmmOffsetB platform e (fromDynTag tag)
maybeLetNoEscape :: CgIdInfo -> Maybe (BlockId, [LocalReg])
maybeLetNoEscape CgIdInfo { cg_loc = LneLoc blk_id args} = Just (blk_id, args)
=====================================
compiler/GHC/StgToCmm/Expr.hs
=====================================
@@ -748,7 +748,10 @@ cgAlts gc_plan bndr (AlgAlt tycon) alts
!ptag_expr = cmmConstrTag1 platform (CmmReg bndr_reg)
!branches' = first succ <$> branches
!maxpt = mAX_PTR_TAG platform
- (!via_ptr, !via_info) = partition ((< maxpt) . fst) branches'
+ -- 'maxpt' is a 'DynTag'; branch tables use host-side 'ConTagZ'
+ -- (= 'Int'), so convert via 'fromDynTag'.
+ !maxpt_i = fromDynTag maxpt :: ConTagZ
+ (!via_ptr, !via_info) = partition ((< maxpt_i) . fst) branches'
!small = isSmallFamily platform fam_sz
-- Is the constructor tag in the node reg?
@@ -756,7 +759,7 @@ cgAlts gc_plan bndr (AlgAlt tycon) alts
; if small || null via_info
then -- Yes, bndr_reg has constructor tag in ls bits
emitSwitch ptag_expr branches' mb_deflt 1
- (if small then fam_sz else maxpt)
+ (if small then fam_sz else maxpt_i)
else -- No, the get exact tag from info table when mAX_PTR_TAG
-- See Note [Double switching for big families]
@@ -772,7 +775,7 @@ cgAlts gc_plan bndr (AlgAlt tycon) alts
infos_lbl <- newBlockId
infos_scp <- getTickScope
- let spillover = (maxpt, (mkBranch infos_lbl, infos_scp))
+ let spillover = (maxpt_i, (mkBranch infos_lbl, infos_scp))
(mb_shared_deflt, mb_shared_branch) <- case mb_deflt of
(Just (stmts, scp)) ->
@@ -781,13 +784,13 @@ cgAlts gc_plan bndr (AlgAlt tycon) alts
, Just (mkBranch lbl, scp))
_ -> return (Nothing, Nothing)
-- Switch on pointer tag
- emitSwitch ptag_expr (spillover : via_ptr) mb_shared_deflt 1 maxpt
+ emitSwitch ptag_expr (spillover : via_ptr) mb_shared_deflt 1 maxpt_i
join_lbl <- newBlockId
emit (mkBranch join_lbl)
-- Switch on info table tag
emitLabel infos_lbl
emitSwitch itag_expr info0 mb_shared_branch
- (maxpt - 1) (fam_sz - 1)
+ (maxpt_i - 1) (fam_sz - 1)
emitLabel join_lbl
; return AssignedDirectly }
=====================================
compiler/GHC/StgToCmm/Foreign.hs
=====================================
@@ -621,7 +621,7 @@ openNursery profile tso = do
(CmmMachOp (mo_wordMul platform)
[ CmmMachOp (MO_SS_Conv W32 (wordWidth platform))
[CmmLoad (nursery_bdescr_blocks platform cnreg) b32 NaturallyAligned]
- , mkIntExpr platform (pc_BLOCK_SIZE (platformConstants platform))
+ , mkIntExpr platform (toTargetInt (pc_BLOCK_SIZE (platformConstants platform)))
])
(-1)
)
=====================================
compiler/GHC/StgToCmm/Heap.hs
=====================================
@@ -539,7 +539,7 @@ heapCheck checkStack checkYield do_gc code
"See https://gitlab.haskell.org/ghc/ghc/issues/4505 for details.",
"Suggestion: read data from a file instead of having large static data",
"structures in code."]
- | hpHw > 0 = Just (mkIntExpr platform (hpHw * (platformWordSizeInBytes platform)))
+ | hpHw > 0 = Just (mkIntExpr platform (toTargetInt hpHw * toTargetInt (platformWordSizeInBytes platform)))
| otherwise = Nothing
where
constants = platformConstants platform
=====================================
compiler/GHC/StgToCmm/InfoTableProv.hs
=====================================
@@ -117,7 +117,7 @@ emitIpeBufferListNode this_mod ents dus0 = do
ctx = stgToCmmContext cfg
platform = stgToCmmPlatform cfg
- int n = mkIntCLit platform n
+ int n = mkIntCLit platform (toTargetInt n)
((cg_ipes, unit_id, module_name), strtab) = flip runState emptyStringTable $ do
unit_id <- lookupStringTable $ ST.pack $ renderWithContext ctx (ppr $ moduleName this_mod)
=====================================
compiler/GHC/StgToCmm/Layout.hs
=====================================
@@ -241,7 +241,7 @@ slowCall fun stg_args
end_lbl <- newBlockId
let correct_arity = cmmEqWord platform (funInfoArity profile fun_iptr)
- (mkIntExpr platform n_args)
+ (mkIntExpr platform (toTargetInt n_args))
tscope <- getTickScope
emit (mkCbranch (cmmIsTagged platform funv)
=====================================
compiler/GHC/StgToCmm/Prim.hs
=====================================
@@ -172,7 +172,7 @@ emitPrimOp cfg primop =
-> inlinePrimop $ \[res] -> doNewArrayOp res (arrPtrsRep platform (fromInteger n)) mkMAP_DIRTY_infoLabel
[ (mkIntExpr platform (fromInteger n),
fixedHdrSize profile + pc_OFFSET_StgMutArrPtrs_ptrs (platformConstants platform))
- , (mkIntExpr platform (nonHdrSizeW (arrPtrsRep platform (fromInteger n))),
+ , (mkIntExpr platform (toTargetInt (nonHdrSizeW (arrPtrsRep platform (fromInteger n)))),
fixedHdrSize profile + pc_OFFSET_StgMutArrPtrs_size (platformConstants platform))
]
(fromInteger n) init
@@ -2240,7 +2240,7 @@ genericWordAddCOp [res_r, res_c] [aa, bb]
CmmMachOp (mo_wordNot platform) [CmmReg (CmmLocal res_r)]
]
],
- mkIntExpr platform (platformWordSizeInBits platform - 1)
+ mkIntExpr platform (toTargetInt (platformWordSizeInBits platform - 1))
]
]
genericWordAddCOp _ _ = panic "genericWordAddCOp"
@@ -2273,7 +2273,7 @@ genericWordSubCOp [res_r, res_c] [aa, bb]
CmmReg (CmmLocal res_r)
]
],
- mkIntExpr platform (platformWordSizeInBits platform - 1)
+ mkIntExpr platform (toTargetInt (platformWordSizeInBits platform - 1))
]
]
genericWordSubCOp _ _ = panic "genericWordSubCOp"
@@ -2309,7 +2309,7 @@ genericIntAddCOp [res_r, res_c] [aa, bb]
CmmMachOp (mo_wordNot platform) [CmmMachOp (mo_wordXor platform) [aa,bb]],
CmmMachOp (mo_wordXor platform) [aa, CmmReg (CmmLocal res_r)]
],
- mkIntExpr platform (platformWordSizeInBits platform - 1)
+ mkIntExpr platform (toTargetInt (platformWordSizeInBits platform - 1))
]
]
genericIntAddCOp _ _ = panic "genericIntAddCOp"
@@ -2334,7 +2334,7 @@ genericIntSubCOp [res_r, res_c] [aa, bb]
CmmMachOp (mo_wordXor platform) [aa,bb],
CmmMachOp (mo_wordXor platform) [aa, CmmReg (CmmLocal res_r)]
],
- mkIntExpr platform (platformWordSizeInBits platform - 1)
+ mkIntExpr platform (toTargetInt (platformWordSizeInBits platform - 1))
]
]
genericIntSubCOp _ _ = panic "genericIntSubCOp"
@@ -2541,7 +2541,7 @@ doWritePtrArrayOp addr idx val
cmmOffsetExpr platform
(cmmOffsetExprW platform (cmmOffsetB platform addr hdr_size)
(ptrArraySize platform profile addr))
- (CmmMachOp (mo_wordUShr platform) [idx, mkIntExpr platform (pc_MUT_ARR_PTRS_CARD_BITS (platformConstants platform))])
+ (CmmMachOp (mo_wordUShr platform) [idx, mkIntExpr platform (toTargetInt (pc_MUT_ARR_PTRS_CARD_BITS (platformConstants platform)))])
) (CmmLit (CmmInt 1 W8))
mkBasicIndexedRead :: Bool -- Should this imply an acquire barrier
@@ -2922,14 +2922,14 @@ doNewByteArrayOp res_r n = do
let info_ptr = mkLblExpr mkArrWords_infoLabel
rep = arrWordsRep platform n
- tickyAllocPrim (mkIntExpr platform (arrWordsHdrSize profile))
- (mkIntExpr platform (nonHdrSize platform rep))
+ tickyAllocPrim (mkIntExpr platform (toTargetInt (arrWordsHdrSize profile)))
+ (mkIntExpr platform (toTargetInt (nonHdrSize platform rep)))
(zeroExpr platform)
let hdr_size = fixedHdrSize profile
base <- allocHeapClosure rep info_ptr (cccsExpr platform)
- [ (mkIntExpr platform n,
+ [ (mkIntExpr platform (toTargetInt n),
hdr_size + pc_OFFSET_StgArrBytes_bytes (platformConstants platform))
]
@@ -3169,8 +3169,8 @@ doNewArrayOp res_r rep info payload n init = do
let info_ptr = mkLblExpr info
- tickyAllocPrim (mkIntExpr platform (hdrSize profile rep))
- (mkIntExpr platform (nonHdrSize platform rep))
+ tickyAllocPrim (mkIntExpr platform (toTargetInt (hdrSize profile rep)))
+ (mkIntExpr platform (toTargetInt (nonHdrSize platform rep)))
(zeroExpr platform)
base <- allocHeapClosure rep info_ptr (cccsExpr platform) payload
@@ -3214,7 +3214,7 @@ doCopyArrayOp = emitCopyArray copy
-- they're of different types)
copy _src _dst dst_p src_p bytes =
do platform <- getPlatform
- emitCheckedMemcpyCall dst_p src_p (mkIntExpr platform bytes)
+ emitCheckedMemcpyCall dst_p src_p (mkIntExpr platform (toTargetInt bytes))
(wordAlignment platform)
@@ -3232,9 +3232,9 @@ doCopyMutableArrayOp = emitCopyArray copy
copy src dst dst_p src_p bytes = do
platform <- getPlatform
(moveCall, cpyCall) <- forkAltPair
- (getCode $ emitMemmoveCall dst_p src_p (mkIntExpr platform bytes)
+ (getCode $ emitMemmoveCall dst_p src_p (mkIntExpr platform (toTargetInt bytes))
(wordAlignment platform))
- (getCode $ emitMemcpyCall dst_p src_p (mkIntExpr platform bytes)
+ (getCode $ emitMemcpyCall dst_p src_p (mkIntExpr platform (toTargetInt bytes))
(wordAlignment platform))
emit =<< mkCmmIfThenElse (cmmEqWord platform src dst) moveCall cpyCall
@@ -3257,9 +3257,9 @@ emitCopyArray copy src0 src_off dst0 dst_off0 n =
dst_off <- assignTempE dst_off0
whenCheckBounds $ do
- emitRangeBoundsCheck src_off (mkIntExpr platform n)
+ emitRangeBoundsCheck src_off (mkIntExpr platform (toTargetInt n))
(ptrArraySize platform profile src)
- emitRangeBoundsCheck dst_off (mkIntExpr platform n)
+ emitRangeBoundsCheck dst_off (mkIntExpr platform (toTargetInt n))
(ptrArraySize platform profile dst)
-- Nonmoving collector write barrier
@@ -3291,7 +3291,7 @@ doCopySmallArrayOp = emitCopySmallArray copy
-- they're of different types)
copy _src _dst dst_p src_p bytes =
do platform <- getPlatform
- emitCheckedMemcpyCall dst_p src_p (mkIntExpr platform bytes)
+ emitCheckedMemcpyCall dst_p src_p (mkIntExpr platform (toTargetInt bytes))
(wordAlignment platform)
@@ -3305,9 +3305,9 @@ doCopySmallMutableArrayOp = emitCopySmallArray copy
copy src dst dst_p src_p bytes = do
platform <- getPlatform
(moveCall, cpyCall) <- forkAltPair
- (getCode $ emitMemmoveCall dst_p src_p (mkIntExpr platform bytes)
+ (getCode $ emitMemmoveCall dst_p src_p (mkIntExpr platform (toTargetInt bytes))
(wordAlignment platform))
- (getCode $ emitMemcpyCall dst_p src_p (mkIntExpr platform bytes)
+ (getCode $ emitMemcpyCall dst_p src_p (mkIntExpr platform (toTargetInt bytes))
(wordAlignment platform))
emit =<< mkCmmIfThenElse (cmmEqWord platform src dst) moveCall cpyCall
@@ -3329,9 +3329,9 @@ emitCopySmallArray copy src0 src_off dst0 dst_off n =
dst <- assignTempE dst0
whenCheckBounds $ do
- emitRangeBoundsCheck src_off (mkIntExpr platform n)
+ emitRangeBoundsCheck src_off (mkIntExpr platform (toTargetInt n))
(smallPtrArraySize platform profile src)
- emitRangeBoundsCheck dst_off (mkIntExpr platform n)
+ emitRangeBoundsCheck dst_off (mkIntExpr platform (toTargetInt n))
(smallPtrArraySize platform profile dst)
-- Nonmoving collector write barrier
@@ -3361,17 +3361,17 @@ emitCloneArray info_p res_r src src_off n = do
let info_ptr = mkLblExpr info_p
rep = arrPtrsRep platform n
- tickyAllocPrim (mkIntExpr platform (arrPtrsHdrSize profile))
- (mkIntExpr platform (nonHdrSize platform rep))
+ tickyAllocPrim (mkIntExpr platform (toTargetInt (arrPtrsHdrSize profile)))
+ (mkIntExpr platform (toTargetInt (nonHdrSize platform rep)))
(zeroExpr platform)
let hdr_size = fixedHdrSize profile
constants = platformConstants platform
base <- allocHeapClosure rep info_ptr (cccsExpr platform)
- [ (mkIntExpr platform n,
+ [ (mkIntExpr platform (toTargetInt n),
hdr_size + pc_OFFSET_StgMutArrPtrs_ptrs constants)
- , (mkIntExpr platform (nonHdrSizeW rep),
+ , (mkIntExpr platform (toTargetInt (nonHdrSizeW rep)),
hdr_size + pc_OFFSET_StgMutArrPtrs_size constants)
]
@@ -3382,9 +3382,9 @@ emitCloneArray info_p res_r src src_off n = do
(arrPtrsHdrSize profile)
src_p <- assignTempE $ cmmOffsetExprW platform src
(cmmAddWord platform
- (mkIntExpr platform (arrPtrsHdrSizeW profile)) src_off)
+ (mkIntExpr platform (toTargetInt (arrPtrsHdrSizeW profile))) src_off)
- emitMemcpyCall dst_p src_p (mkIntExpr platform (wordsToBytes platform n))
+ emitMemcpyCall dst_p src_p (mkIntExpr platform (toTargetInt (wordsToBytes platform n)))
(wordAlignment platform)
emit $ mkAssign (CmmLocal res_r) (CmmReg arr)
@@ -3402,14 +3402,14 @@ emitCloneSmallArray info_p res_r src src_off n = do
let info_ptr = mkLblExpr info_p
rep = smallArrPtrsRep n
- tickyAllocPrim (mkIntExpr platform (smallArrPtrsHdrSize profile))
- (mkIntExpr platform (nonHdrSize platform rep))
+ tickyAllocPrim (mkIntExpr platform (toTargetInt (smallArrPtrsHdrSize profile)))
+ (mkIntExpr platform (toTargetInt (nonHdrSize platform rep)))
(zeroExpr platform)
let hdr_size = fixedHdrSize profile
base <- allocHeapClosure rep info_ptr (cccsExpr platform)
- [ (mkIntExpr platform n,
+ [ (mkIntExpr platform (toTargetInt n),
hdr_size + pc_OFFSET_StgSmallMutArrPtrs_ptrs (platformConstants platform))
]
@@ -3420,9 +3420,9 @@ emitCloneSmallArray info_p res_r src src_off n = do
(smallArrPtrsHdrSize profile)
src_p <- assignTempE $ cmmOffsetExprW platform src
(cmmAddWord platform
- (mkIntExpr platform (smallArrPtrsHdrSizeW profile)) src_off)
+ (mkIntExpr platform (toTargetInt (smallArrPtrsHdrSizeW profile))) src_off)
- emitMemcpyCall dst_p src_p (mkIntExpr platform (wordsToBytes platform n))
+ emitMemcpyCall dst_p src_p (mkIntExpr platform (toTargetInt (wordsToBytes platform n)))
(wordAlignment platform)
emit $ mkAssign (CmmLocal res_r) (CmmReg arr)
@@ -3437,7 +3437,7 @@ emitSetCards dst_start dst_cards_start n = do
start_card <- assignTempE $ cardCmm platform dst_start
let end_card = cardCmm platform
(cmmSubWord platform
- (cmmAddWord platform dst_start (mkIntExpr platform n))
+ (cmmAddWord platform dst_start (mkIntExpr platform (toTargetInt n)))
(mkIntExpr platform 1))
emitMemsetCall (cmmAddWord platform dst_cards_start start_card)
(mkIntExpr platform 1)
@@ -3447,7 +3447,7 @@ emitSetCards dst_start dst_cards_start n = do
-- Convert an element index to a card index
cardCmm :: Platform -> CmmExpr -> CmmExpr
cardCmm platform i =
- cmmUShrWord platform i (mkIntExpr platform (pc_MUT_ARR_PTRS_CARD_BITS (platformConstants platform)))
+ cmmUShrWord platform i (mkIntExpr platform (toTargetInt (pc_MUT_ARR_PTRS_CARD_BITS (platformConstants platform))))
------------------------------------------------------------------------------
-- SmallArray PrimOp implementations
@@ -3794,10 +3794,10 @@ doByteArrayBoundsCheck idx arr idx_ty elem_ty = whenCheckBounds $ do
platform <- getPlatform
let elem_w = typeWidth elem_ty
idx_w = typeWidth idx_ty
- elem_sz = mkIntExpr platform $ widthInBytes elem_w
+ elem_sz = mkIntExpr platform $ toTargetInt (widthInBytes elem_w)
arr_sz = byteArraySize platform profile arr
effective_arr_sz =
- cmmUShrWord platform arr_sz (mkIntExpr platform (widthInLog idx_w))
+ cmmUShrWord platform arr_sz (mkIntExpr platform (toTargetInt (widthInLog idx_w)))
if elem_w == idx_w
then emitBoundsCheck idx effective_arr_sz -- aligned => simpler check
else assert (idx_w == W8) (emitRangeBoundsCheck idx elem_sz arr_sz)
@@ -3839,8 +3839,8 @@ emitCopyUpdRemSetPush platform hdr_size dst dst_off n =
lbl = mkLblExpr $ mkPrimCallLabel
$ PrimCall (fsLit "stg_copyArray_barrier") rtsUnit
args =
- [ mkIntExpr platform hdr_size
+ [ mkIntExpr platform (toTargetInt hdr_size)
, dst
, dst_off
- , mkIntExpr platform n
+ , mkIntExpr platform (toTargetInt n)
]
=====================================
compiler/GHC/StgToCmm/Prof.hs
=====================================
@@ -166,7 +166,7 @@ profDynAlloc rep ccs
= ifProfiling $
do profile <- getProfile
let platform = profilePlatform profile
- profAlloc (mkIntExpr platform (heapClosureSizeW profile rep)) ccs
+ profAlloc (mkIntExpr platform (toTargetInt (heapClosureSizeW profile rep))) ccs
-- | Record the allocation of a closure (size is given by a CmmExpr)
-- The size must be in words, because the allocation counter in a CCS counts
@@ -182,7 +182,7 @@ profAlloc words ccs
(CmmMachOp (MO_UU_Conv (wordWidth platform) (typeWidth alloc_rep))
-- subtract the "profiling overhead", which is the
-- profiling header in a closure.
- [CmmMachOp (mo_wordSub platform) [ words, mkIntExpr platform (profHdrSize profile)]]
+ [CmmMachOp (mo_wordSub platform) [ words, mkIntExpr platform (toTargetInt (profHdrSize profile))]]
)
-- -----------------------------------------------------------------------
@@ -224,7 +224,7 @@ emitCostCentreDecl :: CostCentre -> FCode ()
emitCostCentreDecl cc = do
{ ctx <- stgToCmmContext <$> getStgToCmmConfig
; platform <- getPlatform
- ; let is_caf | isCafCC cc = mkIntCLit platform (ord 'c') -- 'c' == is a CAF
+ ; let is_caf | isCafCC cc = mkIntCLit platform (toTargetInt (ord 'c')) -- 'c' == is a CAF
| otherwise = zero platform
-- NB. bytesFS: we want the UTF-8 bytes here (#5559)
; label <- newByteStringCLit (bytesFS $ costCentreUserNameFS cc)
@@ -347,7 +347,7 @@ dynLdvInit :: Platform -> CmmExpr
dynLdvInit platform =
-- (era << LDV_SHIFT) | LDV_STATE_CREATE
CmmMachOp (mo_wordOr platform) [
- CmmMachOp (mo_wordShl platform) [loadEra platform, mkIntExpr platform (pc_LDV_SHIFT (platformConstants platform))],
+ CmmMachOp (mo_wordShl platform) [loadEra platform, mkIntExpr platform (toTargetInt (pc_LDV_SHIFT (platformConstants platform)))],
CmmLit (mkWordCLit platform (pc_ILDV_STATE_CREATE (platformConstants platform)))
]
@@ -390,7 +390,7 @@ ldvEnterClosure closure_info node_reg = do
platform <- getPlatform
let tag = funTag platform closure_info
-- don't forget to subtract node's tag
- ldvEnter (cmmOffsetB platform (CmmReg node_reg) (-tag))
+ ldvEnter (cmmOffsetB platform (CmmReg node_reg) (-(fromDynTag tag)))
ldvEnter :: CmmExpr -> FCode ()
-- Argument is a closure pointer
=====================================
compiler/GHC/StgToCmm/Ticky.hs
=====================================
@@ -294,7 +294,7 @@ emitTickyData platform ctr_lbl arity fun_desc arg_desc json_desc info_tbl =
-- before, but the code generator wasn't handling that
-- properly and it led to chaos, panic and disorder.
[ zeroCLit platform, -- registered?
- mkIntCLit platform arity, -- Arity
+ mkIntCLit platform (toTargetInt arity), -- Arity
zeroCLit platform, -- Heap allocated for this thing
fun_desc,
arg_desc,
@@ -848,7 +848,7 @@ bumpHistogram lbl n = do
emitAddToMem :: CmmExpr -> Int -> FCode ()
emitAddToMem lhs n = do
platform <- getPlatform
- emitAddToMemE lhs (mkIntExpr platform n)
+ emitAddToMemE lhs (mkIntExpr platform (toTargetInt n))
emitAddToMemE :: CmmExpr -> CmmExpr -> FCode ()
emitAddToMemE lhs n = do
=====================================
compiler/GHC/StgToCmm/Utils.hs
=====================================
@@ -160,7 +160,7 @@ mkTaggedObjectLoad platform reg base offset tag
= mkAssign (CmmLocal reg)
(CmmLoad (cmmOffsetB platform
(CmmReg (CmmLocal base))
- (offset - tag))
+ (offset - fromDynTag tag))
(localRegType reg)
NaturallyAligned)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2df604e98d0caa4ac08f035fed5836f…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2df604e98d0caa4ac08f035fed5836f…
You're receiving this email because of your account on gitlab.haskell.org.
1
0