[Git][ghc/ghc][master] 2 commits: Add 'backendInfoTableMapValidity' backend predicate
by Marge Bot (@marge-bot) 07 Jul '26
by Marge Bot (@marge-bot) 07 Jul '26
07 Jul '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
66d1a5d5 by fendor at 2026-07-07T16:57:56-04:00
Add 'backendInfoTableMapValidity' backend predicate
Check whether the backend supports the `-finfo-table-map` flag and
ignore it otherwise.
Improve by-design documentation of `backendCodeOutput`.
`Backend` is **abstract by design**. Make this clearer in
`backendCodeOutput` which is incorrectly being used as a proxy for
`Backend`.
Instead, define the desired property predicates in GHC.Driver.Backend
In the process, make `backendCodeOutput` total.
- - - - -
74f1071d by fendor at 2026-07-07T16:57:56-04:00
Add failing test for `-finfo-table-map` and bytecode backend
If you compile a module using the bytecode backend, with
-finfo-table-map, then the info table map doesn't get populated for the
module.
This is because the -finfo-table-map code path is implemented mostly in
the StgToCmm phase which isn't run when creating bytecode.
Ticket #27039
- - - - -
10 changed files:
- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Main/Compile.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Session.hs
- testsuite/tests/deSugar/should_fail/all.T
- testsuite/tests/ghci/scripts/all.T
- + testsuite/tests/ghci/scripts/bytecodeIPE.hs
- + testsuite/tests/ghci/scripts/bytecodeIPE.script
- + testsuite/tests/ghci/scripts/bytecodeIPE.stdout
Changes:
=====================================
compiler/GHC/Driver/Backend.hs
=====================================
@@ -99,6 +99,7 @@ module GHC.Driver.Backend
, backendPostHscPipeline
, backendNormalSuccessorPhase
, backendName
+ , backendInfoTableMapValidity
, backendValidityOfCImport
, backendValidityOfCExport
@@ -117,7 +118,6 @@ import GHC.Driver.Phases
import GHC.Utils.Error
-import GHC.Utils.Panic
import GHC.Driver.Pipeline.Monad
import GHC.Platform
@@ -368,7 +368,8 @@ data PrimitiveImplementation
-- We expect one function per back end—or more precisely, one function
-- for each back end that writes code to a file. (The interpreter
-- does not write to files; its output lives only in memory.)
-
+--
+-- See Note [Backend Defunctionalization]
data DefunctionalizedCodeOutput
= NcgCodeOutput
| ViaCCodeOutput
@@ -680,6 +681,18 @@ backendSupportsBreakpoints = \case
Named Bytecode -> True
Named NoBackend -> False
+-- | Return is 'IsValid' if the backend supports @-finfo-table-map@.
+-- If 'backendInfoTableMapValidity' returns 'NotValid', then the driver ignores
+-- the flag @-finfo-table-map@, since the backend doesn't support generating
+-- the info table map.
+backendInfoTableMapValidity :: Backend -> Validity' String
+backendInfoTableMapValidity (Named NCG) = IsValid
+backendInfoTableMapValidity (Named LLVM) = NotValid "-finfo-table-map is incompatible with -fllvm and is disabled (See #26435)"
+backendInfoTableMapValidity (Named ViaC) = IsValid
+backendInfoTableMapValidity (Named JavaScript) = NotValid "-finfo-table-map is incompatible with the javascript backend"
+backendInfoTableMapValidity (Named Bytecode) = IsValid -- We are not generating any objects, so @-finfo-table-map@ is not expected to work. Avoid warning for GHCi.
+backendInfoTableMapValidity (Named NoBackend) = IsValid -- We are not generating code, so we ignore it any way
+
-- | If this flag is set, then the driver forces the
-- optimization level to 0, issuing a warning message if
-- the command line requested a higher optimization level.
@@ -768,20 +781,33 @@ backendCDefs (Named NoBackend) = NoCDefs
-- > -> Set UnitId -- ^ dependencies
-- > -> Stream IO RawCmmGroup a -- results from `StgToCmm`
-- > -> IO a
-backendCodeOutput :: Backend -> DefunctionalizedCodeOutput
-backendCodeOutput (Named NCG) = NcgCodeOutput
-backendCodeOutput (Named LLVM) = LlvmCodeOutput
-backendCodeOutput (Named ViaC) = ViaCCodeOutput
-backendCodeOutput (Named JavaScript) = JSCodeOutput
-backendCodeOutput (Named Bytecode) = panic "backendCodeOutput: bytecodeBackend"
-backendCodeOutput (Named NoBackend) = panic "backendCodeOutput: noBackend"
+--
+-- See Note [Backend Defunctionalization]
+--
+-- === __WARNING__
+--
+-- Do NOT use 'backendCodeOutput' (or other functions in this module) as a
+-- proxy for the 'Backend', which is __abstract by design__.
+--
+-- If you need to determine some property of the backend, do NOT match on
+-- 'DefunctionalizedCodeOutput'; Instead, write a new property predicate in
+-- this module. This makes it easier to add new backends because essentially
+-- all backend properties depended upon throughout the compiler are all found
+-- here.
+backendCodeOutput :: Backend -> Maybe DefunctionalizedCodeOutput
+backendCodeOutput (Named NCG) = Just NcgCodeOutput
+backendCodeOutput (Named LLVM) = Just LlvmCodeOutput
+backendCodeOutput (Named ViaC) = Just ViaCCodeOutput
+backendCodeOutput (Named JavaScript) = Just JSCodeOutput
+backendCodeOutput (Named Bytecode) = Nothing
+backendCodeOutput (Named NoBackend) = Nothing
backendUseJSLinker :: Backend -> Bool
backendUseJSLinker (Named NCG) = False
backendUseJSLinker (Named LLVM) = False
backendUseJSLinker (Named ViaC) = False
backendUseJSLinker (Named JavaScript) = True
-backendUseJSLinker (Named Bytecode) = False
+backendUseJSLinker (Named Bytecode) = False
backendUseJSLinker (Named NoBackend) = False
-- | This (defunctionalized) function tells the compiler
=====================================
compiler/GHC/Driver/CodeOutput.hs
=====================================
@@ -4,7 +4,6 @@
\section{Code output phase}
-}
-
module GHC.Driver.CodeOutput
( codeOutput
, outputForeignStubs
@@ -50,7 +49,7 @@ import GHC.Utils.Outputable
import GHC.Utils.Logger
import GHC.Utils.Exception ( bracket )
import GHC.Utils.Ppr (Mode(..))
-import GHC.Utils.Panic.Plain ( pgmError )
+import GHC.Utils.Panic.Plain ( panic, pgmError )
import GHC.Unit
import GHC.Unit.Finder ( mkStubPaths )
@@ -124,11 +123,12 @@ codeOutput logger tmpfs llvm_config dflags unit_state this_mod filenm location g
; let dus1 = newTagDUniqSupply CodeGenTag dus0
; (stubs, a) <- case backendCodeOutput (backend dflags) of
- NcgCodeOutput -> outputAsm logger dflags this_mod location filenm dus1
- final_stream
- ViaCCodeOutput -> outputC logger dflags filenm dus1 final_stream pkg_deps
- LlvmCodeOutput -> outputLlvm logger llvm_config dflags filenm dus1 final_stream
- JSCodeOutput -> outputJS logger llvm_config dflags filenm final_stream
+ Just NcgCodeOutput -> outputAsm logger dflags this_mod location filenm dus1
+ final_stream
+ Just ViaCCodeOutput -> outputC logger dflags filenm dus1 final_stream pkg_deps
+ Just LlvmCodeOutput -> outputLlvm logger llvm_config dflags filenm dus1 final_stream
+ Just JSCodeOutput -> outputJS logger llvm_config dflags filenm final_stream
+ Nothing -> panic $ "backendCodeOutput: " ++ show (backend dflags) ++ " doesn't support code output"
; stubs_exist <- outputForeignStubs logger tmpfs dflags unit_state this_mod location stubs
; return (filenm, stubs_exist, foreign_fps, a)
}
=====================================
compiler/GHC/Driver/Main/Compile.hs
=====================================
@@ -670,7 +670,7 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
-- next withTiming after this will be "Assembler" (hard code only).
withTiming logger (text "CodeGen"<+>brackets (ppr this_mod)) (const ())
$ case backendCodeOutput (backend dflags) of
- JSCodeOutput ->
+ Just JSCodeOutput ->
do
let js_config = initStgToJSConfig dflags
@@ -696,7 +696,7 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
stgToJS logger js_config stg_binds this_mod spt_entries foreign_stubs0 cost_centre_info output_filename
return (output_filename, stub_c_exists, foreign_fps, Just stg_cg_infos, Just cmm_cg_infos)
- _ ->
+ Just _ ->
do
cmms <- {-# SCC "StgToCmm" #-}
doCodeGen hsc_env this_mod denv tycons
@@ -724,6 +724,7 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
foreign_stubs foreign_files dependencies (initDUniqSupply 'n' 0) rawcmms1
return ( output_filename, stub_c_exists, foreign_fps
, Just stg_cg_infos, Just cmm_cg_infos)
+ Nothing -> panic $ "backendCodeOutput: " ++ show (backend dflags) ++ " doesn't support code output"
-- The part of CgGuts that we need for HscInteractive
=====================================
compiler/GHC/Driver/Pipeline.hs
=====================================
@@ -741,7 +741,7 @@ compileEmptyStub dflags hsc_env basename location mod_name = do
let home_unit = hsc_home_unit hsc_env
case backendCodeOutput (backend dflags) of
- JSCodeOutput -> do
+ Just JSCodeOutput -> do
empty_stub <- newTempName logger tmpfs (tmpDir dflags) TFL_CurrentModule "js"
let src = ppr (mkHomeModule home_unit mod_name) <+> text "= 0;"
writeFile empty_stub (showSDoc dflags (pprCode src))
@@ -750,7 +750,7 @@ compileEmptyStub dflags hsc_env basename location mod_name = do
_ <- runPipeline (hsc_hooks hsc_env) pipeline
pure ()
- _ -> do
+ Just _ -> do
empty_stub <- newTempName logger tmpfs (tmpDir dflags) TFL_CurrentModule "c"
let src = text "int" <+> ppr (mkHomeModule home_unit mod_name) <+> text "= 0;"
writeFile empty_stub (showSDoc dflags (pprCode src))
@@ -758,6 +758,7 @@ compileEmptyStub dflags hsc_env basename location mod_name = do
pipeline = viaCPipeline HCc pipe_env hsc_env (Just location) empty_stub
_ <- runPipeline (hsc_hooks hsc_env) pipeline
pure ()
+ Nothing -> panic $ "backendCodeOutput: " ++ show (backend dflags) ++ " doesn't support code output"
=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -276,7 +276,7 @@ import GHC.Data.FastString
import GHC.Utils.TmpFs
import GHC.Utils.Fingerprint
import GHC.Utils.Outputable
-import GHC.Utils.Error (emptyDiagOpts, logInfo)
+import GHC.Utils.Error (emptyDiagOpts, logInfo, Validity'(..))
import GHC.Settings
import GHC.CmmToAsm.CFG.Weight
import GHC.Core.Opt.CallerCC
@@ -3855,8 +3855,8 @@ makeDynFlagsConsistent dflags
&& os == OSMinGW32
&& arch == ArchAArch64
= case backendCodeOutput (backend dflags) of
- LlvmCodeOutput -> pgmError "-fllvm is incompatible with enabled TablesNextToCode at Windows Aarch64"
- NcgCodeOutput -> pgmError "-fasm is incompatible with enabled TablesNextToCode at Windows Aarch64"
+ Just LlvmCodeOutput -> pgmError "-fllvm is incompatible with enabled TablesNextToCode at Windows Aarch64"
+ Just NcgCodeOutput -> pgmError "-fasm is incompatible with enabled TablesNextToCode at Windows Aarch64"
_ -> (dflags, mempty, mempty)
-- When we do ghci, force using dyn ways if the target RTS linker
@@ -3902,9 +3902,8 @@ makeDynFlagsConsistent dflags
in dflags_c
| gopt Opt_InfoTableMap dflags
- , LlvmCodeOutput <- backendCodeOutput (backend dflags)
- = loop (gopt_unset dflags Opt_InfoTableMap)
- "-finfo-table-map is incompatible with -fllvm and is disabled (See #26435)"
+ , NotValid msg <- backendInfoTableMapValidity (backend dflags)
+ = loop (gopt_unset dflags Opt_InfoTableMap) msg
| otherwise = (dflags, mempty, mempty)
where loc = mkGeneralSrcSpan (fsLit "when making flags consistent")
=====================================
testsuite/tests/deSugar/should_fail/all.T
=====================================
@@ -6,7 +6,9 @@
test('DsStrictFail', exit_code(1), compile_and_run, [''])
test(
'T21701',
- [omit_ways(llvm_ways)], # -finfo-table-map does not work with -fllvm (#26435)
+ [ omit_ways(llvm_ways), # -finfo-table-map does not work with -fllvm (#26435)
+ when(js_arch(), skip) # javascript doesn't support -finfo-table-map yet and yields a warning we don't want to handle here
+ ],
compile,
['-Wall -finfo-table-map']
)
=====================================
testsuite/tests/ghci/scripts/all.T
=====================================
@@ -385,6 +385,14 @@ test('ListTuplePunsPpr', normal, ghci_script, ['ListTuplePunsPpr.script'])
test('ListTuplePunsPprNoAbbrevTuple', [limit_stdout_lines(14)], ghci_script, ['ListTuplePunsPprNoAbbrevTuple.script'])
test('T24459', normal, ghci_script, ['T24459.script'])
test('T24632', normal, ghci_script, ['T24632.script'])
+# bytecode backend doesn't support '-finfo-table-map' (#27039)
+test('bytecodeIPE',
+ [ extra_hc_opts('-finfo-table-map')
+ , extra_files(['bytecodeIPE.hs'])
+ , req_rts_linker
+ , when(arch('wasm32') or arch('javascript'), skip)
+ ],
+ ghci_script, ['bytecodeIPE.script'])
# Test package renaming in GHCi session
test('GhciPackageRename',
=====================================
testsuite/tests/ghci/scripts/bytecodeIPE.hs
=====================================
@@ -0,0 +1,12 @@
+module BytecodeIPE where
+
+import Data.Maybe (isJust)
+import GHC.InfoProv (whereFrom)
+
+marker :: String
+marker = id "bytecode-stub-init"
+{-# NOINLINE marker #-}
+
+-- `whereFrom` only succeeds if the module's IPE initializer ran.
+probe :: IO Bool
+probe = isJust <$> whereFrom marker
=====================================
testsuite/tests/ghci/scripts/bytecodeIPE.script
=====================================
@@ -0,0 +1,2 @@
+:load bytecodeIPE.hs
+probe
=====================================
testsuite/tests/ghci/scripts/bytecodeIPE.stdout
=====================================
@@ -0,0 +1 @@
+False
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/383ddcd4fd1e54ac2ddcdd42bdc780…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/383ddcd4fd1e54ac2ddcdd42bdc780…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/sjakobi/T16720] 126 commits: Add type family performance test for #26426
by Simon Jakobi (@sjakobi2) 07 Jul '26
by Simon Jakobi (@sjakobi2) 07 Jul '26
07 Jul '26
Simon Jakobi pushed to branch wip/sjakobi/T16720 at Glasgow Haskell Compiler / GHC
Commits:
40764930 by sheaf at 2026-06-12T14:54:43-04:00
Add type family performance test for #26426
Some GHC versions produced large numbers of coercions after typechecking
and desugaring when compiling the program in #26426:
Version | Typechecker time | Typechecker allocations | Coercions
-------:|-----------------:|------------------------:|---------:
9.6 | 47 ms | 48 MB | 110k
9.8 | 1000 ms | 486 MB | 10,437k
9.10 | 922 ms | 489 MB | 10,436k
9.12 | 906 ms | 482 MB | 10,437k
9.14 | 63 ms | 55 MB | 333k
10.0 | 47 ms | 64 MB | 35k
The improvement 9.12 -> 9.14 was due to commit 22d11fa818fae2c95c494fc0fac1f8cb4c6e7cb6,
while the improvement 9.14 -> 10.0 was due to commit 0b7df6db9e46df40e86fbff1a66dc10440b99db5.
As the behaviour of GHC seems better than it's ever been on this program,
we declare victory, adding this performance test to ensure we don't
regress on this program.
On the way, we update Note [Combining equalities] in GHC.Tc.SolveR.Equality
with the explanation of the 9.12 -> 9.14 improvement (getting rid of an
exponential blowup in coercion sizes), and we update
Note [Exploiting closed type families] in GHC.Tc.Solver.FunDeps with
the explanation of the 9.14 -> 10.0 improvement (bringing down coercion
size growth from cubic to quadratic).
- - - - -
0f3d0a71 by Zubin Duggal at 2026-06-12T14:55:30-04:00
compiler: mark tool messages as errors/warnings depending on the exit code
Fixes #27370
- - - - -
d9ea2d76 by mangoiv at 2026-06-13T04:41:51-04:00
libraries/process: bump submodule to v1.6.30.0
- bump the submodule to the appropriate tag
- suppress benign warning resulting from the change
- - - - -
6ebaaba3 by David Eichmann at 2026-06-13T04:42:37-04:00
ghc-toolchain: don't throw when candidate executables are not found
Fixes #27369
- - - - -
6c65e1e1 by David Eichmann at 2026-06-13T04:43:23-04:00
CI: lint-changelog checks for no-changelog label in script instead of rules
- - - - -
bab37cc6 by konsumlamm at 2026-06-13T19:10:21+02:00
Implement CLC proposal #378
Add `Data.Double` and `Data.Float` modules
Document that GHC uses IEEE 754
- - - - -
fb5246ad by fendor at 2026-06-15T18:07:23-04:00
Drop `preloadClosure` from `UnitState`
It is always hard-coded to the same value.
Backpack Unit instantiation isn't using it any more.
Allows us to simplify the API and get rid of `improveUnit`.
- - - - -
291ce3aa by ARATA Mizuki at 2026-06-15T18:08:26-04:00
RISC-V NCG: Zero-extend the result of castFloatToWord32
According to the ISA manual, FMV.X.W sign-extends the result.
We need to truncate the result to avoid creating an exotic Word32 value.
Fixes #27300
- - - - -
011be91f by ARATA Mizuki at 2026-06-15T18:08:26-04:00
RISC-V NCG: Treat d28-d31 (ft8-ft11) as caller-saved
According to the calling convention, the registers d28-d31 (ft8-ft11) are caller-saved.
Fixes #27306
- - - - -
e8a54713 by ARATA Mizuki at 2026-06-15T18:08:26-04:00
RISC-V NCG: Set rounding mode when emitting `truncate`
If we omit the rounding mode for `fcvt`, `dyn` will be used.
We do not want that for `truncate`, so we set `rtz`.
In other places, we set `rne` because we do not use the dynamic rounding mode.
Fixes #27303
- - - - -
9438bec7 by Zubin Duggal at 2026-06-15T18:09:11-04:00
rts: fix validate build with gcc 16. `__attribute__((regparm(1)))` is ignored on x86_64 and now
gcc warns that it is ignored:
rts/sm/Evac.h:35:1: error:
error: ‘regparm’ attribute ignored [-Werror=attributes]
See https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ccead81bbc39668376eb5cf47066a…
Fixes #27366
- - - - -
893e6133 by Andrew Lelechenko at 2026-06-15T23:55:36+01:00
base: more NonEmpty zips
CLC proposal: https://github.com/haskell/core-libraries-committee/issues/409
- - - - -
1314f2fd by David Eichmann at 2026-06-16T05:46:52-04:00
Hadrian: fix ghc-internal .def file name
- - - - -
7f72bcb3 by mangoiv at 2026-06-16T05:47:39-04:00
compiler: ignore camelCase and Eta reduce hlint hints
These do not cohere with the style used in GHC. After disabling them,
hlint lints are much less noisy again.
- - - - -
842bef9f by Alan Zimmerman at 2026-06-16T05:48:25-04:00
EPA: Use standard type family declaration for Anno
- - - - -
f6d30767 by Wolfgang Jeltsch at 2026-06-16T15:32:34-04:00
Fix two issues in the documentation of pipeline interruption
One issue is a typo (“interreuptible”), the other one the lack of an end
of a sentence, which has been reconstructed from the message of
633bbc1fd4762a2bb73ba1c5b9e0c279f1dd3c40, the commit that introduced
said documentation.
- - - - -
a3fa10e0 by Christian Georgii at 2026-06-16T15:33:26-04:00
Find plugins in sibling home units in multiple-home-unit sessions
In a multiple-home-unit session (e.g. `cabal repl --enable-multi-repl` or HLS), enabling a plugin with -fplugin that is defined in (or reexported by) another home unit failed with a "hidden package" error. The plugin module finder only searched the current home unit and the registered external packages, never the sibling home units.
findPluginModuleNoHsc now searches the home units that the current home unit depends on, following module reexports and respecting hidden modules, exactly as ordinary import resolution does in findImportedModuleNoHsc. To avoid two divergent copies of this logic, the shared home-unit search (the current home unit first, then its dependencies in priority order, with the accompanying ordering invariant) is extracted into findHomeModuleAmongDeps, which both findImportedModuleNoHsc and findPluginModuleNoHsc now call.
Add testsuite/tests/driver/multipleHomeUnits/plugin01, which loads a plugin as byte-code from a sibling home unit, and plugin02, in which the consumer enables a plugin reexported by a sibling home unit without depending on the plugin's own home unit directly.
Fixes #27349
- - - - -
d216412b by Ian-Woo Kim at 2026-06-16T20:25:57-04:00
Make the order of usages deterministic
It has been observed that the ordering of usages can be non-determinstic
in parallel builds. Therefore, this contribution introduces sorting of
usages based on a platform- and race-independent sorting criterion.
Resolves #26877.
Co-authored-by: Wolfgang Jeltsch <wolfgang(a)well-typed.com>
- - - - -
8e1cc105 by Wolfgang Jeltsch at 2026-06-16T20:25:57-04:00
Change the descriptions of two existing changelog entries
The descriptions now describe the changes in a user-friendly manner, as
opposed to describing the contributions that led to these changes in a
developer-friendly manner.
- - - - -
636c1c7a by Ian Duncan at 2026-06-16T20:26:50-04:00
AArch64: use SXTH, not SXTW, for W32 signExtendReg
signExtendReg was using SXTH (sign-extend halfword, 16-bit) for
W32-to-W64 sign extension. This should be SXTW (sign-extend word,
32-bit). SXTH only sign-extends the lower 16 bits, producing wrong
results for 32-bit values whose bit 15 differs from bit 31.
Other fixes:
- At sub-W64, code gen for MO_S_Mul2 should use W32 registers for
SMULL source operands as per the ARM spec (SMULL Xd, Wn, Wm),
and not W64.
- Ensure signExtendReg uses the source width for the source operand
in SXTW/SXTH/SXTB instructions. GNU as requires sxtw Xd,Wn (not
sxtw Xd,Xn), while LLVM's integrated assembler on macOS is lenient.
- Fix overflow flag computation for `MO_S_Mul2`. The overflow bit
was exactly inverted for sub-W64 operands.
Fixes #26978 and #27047
- - - - -
b734c75d by Igor Ranieri at 2026-06-16T20:27:32-04:00
haddock: Update CONTRIBUTING with missing step, add missing test
dependency
- - - - -
7fe4f2ec by Luite Stegeman at 2026-06-17T05:35:09-04:00
tag inference: don't confuse functions with their return values
inferTagRhs was mixing up taggedness for closures and return values
for function closures. We really shouldn't assign TagTuple to a
properly tagged function returning a tuple.
We fix this by keeping track of functions (TagFun) separately from
values (TagVal) and keeping track of their return value. TagFun is
also used for join points.
fixes #27005
- - - - -
4671c126 by Sebastian Graf at 2026-06-17T05:35:55-04:00
Seed the simplifier's in-scope set for open expressions
simplifyExpr simplifies expressions typed at the GHCi prompt and the
results of Template Haskell splices. Such an expression may be open: at a
GHCi debugger breakpoint its free variables include RuntimeUnk skolems
standing for as-yet-unknown types.
The simplifier began with an in-scope set holding only the wildcard
binder, so when it instantiated the unsafeCoerce# wrapper that GHCi
builds around a result, it formed a substitution whose range mentioned a
free skolem that was not in scope. That breaks the substitution invariant
and, in a compiler built with assertions, trips substTy's sanity check.
Seed the initial in-scope set with the free variables of the expression.
For a closed expression this adds nothing.
See Note [Seed the in-scope set for open expressions].
Fixes #17833 and its duplicate #21118.
- - - - -
67d41299 by Sebastian Graf at 2026-06-18T05:18:24-04:00
Desugar a `case` scrutinee only once (#27383, #20251)
In `dsExpr` for `HsCase` we desugared the scrutinee /twice/: once to
build the Core `case` itself, and again inside `matchWrapper`, which
re-desugared the source scrutinee (via `addHsScrutTmCs`) purely to
record long-distance information for the pattern-match checker.
For a single `case` that is merely wasteful. But for nested cases it
is catastrophic. Consider
case (case (case e of ... ) of ... ) of ...
Desugaring the outer scrutinee desugars the middle `case` twice, each
of which desugars the inner `case` twice, and so on. The work doubles
at every level, so desugaring takes O(2^n) time in the nesting depth.
That is the blowup reported in #27383; it is also what makes the
machine-generated program in #20251 take an age to compile.
The fix is simple. `matchWrapper` is handed the scrutinee anyway, so
we give it the Core expression we have /already/ desugared, and record
the long-distance term constraint with `addCoreScrutTmCs` instead of
re-desugaring from source. This is just what `matchSinglePatVar`
already does for single-pattern matches.
So:
* `matchWrapper` now takes `Maybe [CoreExpr]` rather than
`Maybe [LHsExpr GhcTc]`.
* The `HsCase` equation of `dsExpr` passes the already-desugared
`core_discrim`; the arrow desugarer passes its match variables.
* `addHsScrutTmCs` had no other use, so it is gone.
Desugaring is now linear in the nesting depth. (The coverage checker
still runs `simpleOptExpr` over each scrutinee, which leaves the total
at O(n^2); that is ample.) The long-distance information itself is
unchanged: the checker sees precisely the Core that backs the
generated code.
Test: deSugar/should_compile/T27383
- - - - -
fa5defde by Rodrigo Mesquita at 2026-06-18T05:19:11-04:00
fix: Save FastStrings in the PMC
There is no point in adding the unique to the occurrence FastString we
create, since it is part of the Id anyway.
Adding it to the FastString, meant each FastString was unique
unnecessarily!
In a separate branch, running the compiler on test `InstanceMatching`
observed 30000 `FastString`s created by this code path.
Plus, `fsLit "pm"` follows the existing pattern in `mkPmId`.
- - - - -
4efb4a66 by Alan Zimmerman at 2026-06-18T14:41:14-04:00
TTG: Add extension points to HsConDetails
Extend HsConDetails as
data HsConDetails p arg rec
= PrefixCon !(XPrefixCon p) [arg] -- C @t1 @t2 p1 p2 p3
| RecCon !(XRecCon p) rec -- C { x = p1, y = p2 }
| InfixCon !(XInfixCon p) arg arg -- p1 `C` p2
| XHsConDetails !(XXHsConDetails p)
type family XPrefixCon p
type family XRecCon p
type family XInfixCon p
type family XXHsConDetails p
- - - - -
c8d27dd4 by Simon Jakobi at 2026-06-18T14:41:59-04:00
CI: quiet submodule clean output in after_script and setup
The clean and cleanup_submodules functions ran 'git submodule foreach
git clean -xdf', flooding the job log with 'Entering ...' and
'Removing ...' lines. Pass --quiet to 'git submodule' and -q to 'git
clean' to drop the success output; errors are still reported.
Co-Authored-By: Claude Opus 4.8 <noreply(a)anthropic.com>
- - - - -
09326ca6 by Matthew Pickering at 2026-06-20T23:41:12+02:00
Add missing req_interp modifier to T18441fail3 and T18441fail19
These tests require the interpreter but they were failing in a different
way with the javascript backend because the interpreter was disabled and
stderr is ignored by the test.
- - - - -
521e55bf by Matthew Pickering at 2026-06-20T23:41:13+02:00
hadrian: Fill in more of the default.host toolchain file
When you are building a cross compiler this file will be used to build
stage1 and it's libraries, so we need enough information here to work
accurately. There is still more work to be done (see for example, word
size is still fixed).
- - - - -
23c9b6c3 by Matthew Pickering at 2026-06-20T23:42:52+02:00
hadrian: Build stage 2 cross compilers
* Most of hadrian is abstracted over the stage in order to remove the
assumption that the target of all stages is the same platform. This
allows the RTS to be built for two different targets for example.
* Abstracts the bindist creation logic to allow building either normal
or cross bindists. Normal bindists use stage 1 libraries and a stage 2
compiler. Cross bindists use stage 2 libararies and a stage 2
compiler.
* hadrian: Make binary-dist-dir the default build target. This allows us
to have the logic in one place about which libraries/stages to build
with cross compilers. Fixes #24192
New hadrian target:
* `binary-dist-dir-cross`: Build a cross compiler bindist (compiler =
stage 1, libraries = stage 2)
This commit also contains various changes to make stage2 compilers
feasible.
-------------------------
Metric Decrease:
LinkableUsage02
ManyAlternatives
ManyConstructors
MultiComponentModulesRecomp
MultiLayerModulesRecomp
RecordUpdPerf
T10421
T12150
T12227
T12425
T12707
T13035
T13379
T13820
T15703
T16577
T18140
T18282
T18698a
T18698b
T18923
T1969
T20049
T21839c
T3294
T4801
T5030
T5321FD
T5321Fun
T5631
T5642
T6048
T783
T9020
T9198
T9233
T9630
T9872d
T9961
parsing001
T3064
Metric Increase:
T26989
hard_hole_fits
-------------------------
Co-authored-by: Sven Tennie <sven.tennie(a)gmail.com>
- - - - -
26fed8ab by Matthew Pickering at 2026-06-20T23:42:52+02:00
ci: Test cross bindists
We remove the special logic for testing in-tree cross
compilers and instead test cross compiler bindists, like we do for all
other platforms.
- - - - -
80c8910e by Matthew Pickering at 2026-06-20T23:42:52+02:00
ci: Introduce CROSS_STAGE variable
In preparation for building and testing stage3 bindists we introduce the
CROSS_STAGE variable which is used by a CI job to determine what kind of
bindist the CI job should produce.
At the moment we are only using CROSS_STAGE=2 but in the future we will
have some jobs which set CROSS_STAGE=3 to produce native bindists for a
target, but produced by a cross compiler, which can be tested on by
another CI job on the native platform.
CROSS_STAGE=2: Build a normal cross compiler bindist
CROSS_STAGE=3: Build a stage 3 bindist, one which is a native compiler and library for the target
- - - - -
8215573d by Sven Tennie at 2026-06-20T23:42:52+02:00
ci: Increase timeout for emulators
Test runs with emulators naturally take longer than on native machines.
Generate jobs.yml
- - - - -
5acb7dbc by Matthew Pickering at 2026-06-20T23:42:52+02:00
ci: Javascript don't set CROSS_EMULATOR
There is no CROSS_EMULATOR needed to run javascript binaries, so we
don't set the CROSS_EMULATOR to some dummy value.
- - - - -
48345343 by Sven Tennie at 2026-06-20T23:42:52+02:00
Javascript skip T23697
See #22355 about how HSC2HS and the Javascript target don't play well
together.
- - - - -
5e44fd05 by Sven Tennie at 2026-06-20T23:42:52+02:00
Mark T24602 as fragile
It was skipped before (due to CROSS_EMULATOR being set, which changed
for JS), so we don't make things worse by marking it as fragile.
- - - - -
ab349ec2 by Sven Tennie at 2026-06-20T23:42:52+02:00
Fix T22744 for GHCJS
In fact, this test needs Template Haskell, not necessarily an
interpreter.
- - - - -
c73352d8 by Sven Tennie at 2026-06-20T23:42:52+02:00
haddock-test: fix GHCJS haddock test failures
Add --ghc-pkg-path flag support so haddock test runner can find
cross-prefixed ghc-pkg (e.g. javascript-unknown-ghcjs-ghc-pkg) which
is not on $PATH in cross install directories.
Skip haddockHtmlTest on GHCJS: Threaded.hs uses forkOS in a TH splice,
which GHCJS RTS doesn't support. Mark with js_skip in all.T.
- - - - -
5e814e76 by Andreas Klebinger at 2026-06-22T23:00:24-04:00
compiler: Deduplicate hscTidy
This function was accidentally duplicated during a refactor.
Fixes #27351
- - - - -
473b97eb by sheaf at 2026-06-22T23:01:22-04:00
Avoid mkTick in Core Prep breaking ANF (part II)
Hotfix for 2f9579765f55b3920ceb2e04995ff41a9d0e2d4e fixing a small
oversight in the call to tickTickedExpr from mkTick, in which we
improperly recursively called mkTick without passing on the preserve_anf
flag.
Fixes #27386
- - - - -
9284a1f7 by Simon Hengel at 2026-06-23T05:55:33-04:00
Don't use global variables to address concurrency bugs! (fixes #27234)
This was originally introduce with
88f38b03025386f0f1e8f5861eed67d80495168a to address #17922.
In this specific case a better fix would have been to synchronize on
stderr:
withHandle_ "stderrSupportsAnsiColors" stderr $ \ _ -> do
...
But apparently the dependency on `terminfo` was removed in
32ab07bf3d6ce45e8ea5b55e8095174a6b42a7f0, preventing #17922 in the first
place.
- - - - -
44309cd3 by Alan Zimmerman at 2026-06-23T05:56:20-04:00
EPA: remove LocatedL / SrcSpanAnnL and LocatedLI / SrcSpanAnnLI
This is part of a refactor towards only having LocatedA / SrcSpanAnnA
It removes the stated items, but has to add back one for BooleanFormula,
LocatedBF / SrcSpanAnnBF
This commit also use the HsConDetails RecCon extension point to
capture the braces in a record constructor
- - - - -
2f6a5534 by Simon Jakobi at 2026-06-23T15:46:20+02:00
Add -dstable-core-dump-order for stable Core dump ordering (#27296)
The order of top-level bindings in Core dumps (-ddump-simpl etc.) is the
compiler's Unique-sensitive internal processing order, so an unrelated
upstream change can reorder them and defeat a textual diff of two dumps.
This adds an opt-in flag -dstable-core-dump-order that reorders the
top-level bindings of dumps routed through dumpPassResult into a stable,
Unique-independent order, so two dumps line up across rebuilds. See
Note [Stable Core dump order] in GHC.Core.Ppr for the sort key and its
rationale.
Adds tests T27296 (binders GHC emits in non-source order by default,
asserted to come out stably ordered under the flag) and T27296b (an
untidied -ddump-float-out dump pinning the ordering of the anonymous lvl
floats by literal value).
Co-Authored-By: Claude Opus 4.8 <noreply(a)anthropic.com>
- - - - -
141986e3 by mangoiv at 2026-06-24T15:51:14-04:00
compiler: refactor error reporting code for ExplicitLevelImports
Refactors error reporting code for ExplicitLevelImports to pass in a
RdrName and a GlobalReaderElt to be able to report errors that are
faithful to the source and to more precisely distinguish between names
that are in scope from different qualifications.
Fixes #27385 and #26616
- - - - -
aa7df6b6 by Simon Hengel at 2026-06-24T15:52:18-04:00
Set GHC_VERSION when calling custom pre-processors (see #25952)
(so that pre-processors can emit backwards compatible code)
- - - - -
a9e494f2 by Simon Hengel at 2026-06-24T15:54:08-04:00
Add a flag to control GHCi specific error hints (close #27409)
- - - - -
a805b2a2 by Simon Hengel at 2026-06-24T15:55:20-04:00
Reference correct package in error messages for reexported modules
(fixes #27417)
- - - - -
f235d183 by Simon Jakobi at 2026-06-25T05:51:18-04:00
Add explicit setBit/clearBit/complementBit for instance Bits Integer (#21176)
The default setBit, clearBit, and complementBit methods allocate
intermediate Integers per call. Define them explicitly via the new
integerSetBit[#], integerClearBit[#] and integerComplementBit[#], built
on the BigNat# primitives, which avoid those allocations. Allocation is not
eliminated entirely -- the negative (IN) cases would need in-place mutation,
which is left as future work.
The default methods constant-folded on literal arguments via the
integerOr/integerAnd/integerXor rules, which fold literal Integers of any
size. The explicit functions have no such rule, so they (their Word-argument
wrappers, and the Bits Integer methods) are marked INLINE to expose the
underlying primops to the simplifier; see Note [INLINE for constant folding
of bit operations]. This restores folding only on the small-int (IS) path --
large literal Integers (IP/IN) are no longer constant-folded, a minor
regression for that case. T8832 covers the IS-path folding.
The new golden-output test T21176 checks all three operations against the
default implementations across the sign/size boundaries, recording each
result plus its integerCheck validity. The base and ghc-bignum interface-
stability export goldens gain the new functions.
The main changelog entry lives in changelog.d under a new ghc-internal
section (renamed from ghc-prim).
CLC proposal: https://github.com/haskell/core-libraries-committee/issues/423
Co-Authored-By: Claude Opus 4.7 <noreply(a)anthropic.com>
- - - - -
202ed264 by Marc Scholten at 2026-06-25T05:52:21-04:00
haddock: use Text in documentation pipeline
This patch moves Haddock's documentation pipeline from String to Text
where the data is already textual. It avoids repeated conversions while
keeping the existing decoding behavior for invalid UTF-8 docstring
chunks.
The main changes are:
* Render and carry docstrings as Text in Haddock-facing paths.
* Use the Binary Text instance from GHC.Utils.Binary for Haddock
interface files, and bump the Haddock binary interface version.
* Add a FastString HTML instance so XHTML rendering avoids
intermediate String allocation.
* Keep HsDocStringChunk decoding lenient, matching the previous
unpackHDSC behavior on invalid UTF-8 input.
* Update the xhtml submodule to 3000.4.1.0, which contains the
apostrophe escaping fix used by the Haddock test output.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot(a)users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply(a)anthropic.com>
Assisted-by: Codex <codex(a)openai.com>
- - - - -
a72ff58f by mangoiv at 2026-06-25T05:53:07-04:00
compiler: rename ZonkAny to UnusedType and add pretty printing logic
ZonkAny is a hard to understand name for users who do not know how the
compiler works internally. Additionally, it is confusing that ZonkAny,
while being a concrete type *represents* a meta variable, espeically in
the compiler output.
This patch changes the name of ZonkAny to UnusedType which is closer to
its intended semantics and adds special pretty printing logic to display
this type in the same fashion the compiler displays meta variables in
other places, whenever they leak from the implementation to the user.
It also exports the type from ghc-internal:GHC.Internal.Types in order
to expose documentation.
Fixes #27390
Co-Authored-By: Sam Derbyshire <sam.derbyshire(a)gmail.com>
- - - - -
6813f002 by Simon Jakobi at 2026-06-26T04:51:47-04:00
Reg.Linear: drop Platform argument from most FR (FreeRegs) methods
The FR class has one instance per CPU architecture, so any
architecture-constant information its methods derived from the Platform
argument can instead be baked into the instance. This removes the now
needless Platform argument from frAllocateReg, frGetFreeRegs and
frReleaseReg.
frInitFreeRegs keeps its Platform argument: the initial allocatable set is
genuinely platform-dependent, see Note [Aarch64 Register x18 at Darwin and
Windows].
Fixes #26665
Co-Authored-By: Claude Opus 4.8 <noreply(a)anthropic.com>
- - - - -
3b2a9409 by Zubin Duggal at 2026-06-26T04:52:39-04:00
testsuite: Report fragile failures as skipped in JUnit output
- - - - -
27463426 by Rodrigo Mesquita at 2026-06-26T20:54:58-04:00
perf: Share Module in Iface Symbol Table
This commit modifies the structure of the serialized `SymbolTable Name`
to then re-use and share the `Module` (both on disk and in memory) across
all `Name`s from the same module.
The new structure looks like:
<total name count>
$modules.size
for (mod, names) in $modules:
$mod
$names.size
for table_ix, occ in $names
$table_ix
$occ
i.e. we put the module just once, followed by all names in that module.
When deserializing, we deserialize the module just once, and all the
following `Name`s are constructed with a pointer to that same decoded
`Module`.
In `hoogle-test`, we must use `DNameEnv` rather than `Map Name`,
otherwise the output fixities order was susceptible to changes in the
uniques assigned to each Names, which is not stable.
Fixes #27401
-------------------------
Metric Decrease:
InstanceMatching
LinkableUsage01
LinkableUsage02
hard_hole_fits
-------------------------
- - - - -
412f1675 by Simon Hengel at 2026-06-26T20:55:41-04:00
Rename `MCDiagnostic` to `InternalMCDiagnostic`
`MCDiagnostic` is meant to be used for compiler diagnostics.
Any code that creates `MCDiagnostic` directly, without going through
`GHC.Driver.Errors.printMessage`, sidesteps `-fdiagnostics-as-json` (see
e.g. !14616, !14475, !14492 !14548).
To avoid this in the future, this change more narrowly controls who
creates `MCDiagnostic` (see #24113).
- - - - -
6f212121 by Facundo Domínguez at 2026-06-26T20:56:27-04:00
Encapsulate options of occurAnalysePgm in a record
- - - - -
adfbb179 by Facundo Domínguez at 2026-06-26T20:56:27-04:00
Allow to configure the occurrence analyser to retain some dead bindings
This is needed by plugins that are the only consumers of a binding which
is otherwise unused in the program.
See Note [Controlling elimination of dead bindings in occurrence analysis]
added in this commit, or
https://gitlab.haskell.org/ghc/ghc/-/issues/27240 for more discussion.
- - - - -
c745b11f by Copilot at 2026-06-26T20:56:27-04:00
Address documentation feedback
- - - - -
2c2a4a2a by Copilot at 2026-06-26T20:56:27-04:00
Keep the imp_rules parameter of occurPgmAnalysePgm and add occ_opts to OccEnv
- - - - -
e2262b0e by Copilot at 2026-06-26T20:56:27-04:00
Strengthen T27240.hs with a binding that should be removed
- - - - -
5f9d9268 by Copilot at 2026-06-26T20:56:27-04:00
Move the reference #27240 to a related paragraph
- - - - -
d86d2644 by Simon Hengel at 2026-06-26T20:57:10-04:00
Remove deprecated flag `-ddump-json` (see #24113)
This was first deprecated in 9.10.1.
- - - - -
3b15ff03 by Simon Jakobi at 2026-06-27T18:48:34+02:00
Tweak mk_mod_usage_info
* Use O(log n) `elemModuleEnv` instead of O(n) `elem` to filter the
direct imports.
* Use `nonDetModuleEnvKeys` to avoid sorting the ent_map keys twice.
* Prepend the presumably shorter list when creating all_mods with
`(++)`. Actually this eliminates the `(++)` entirely, as it seems to
fuse with the `filter` expression.
As a result there is a tiny speed-up when generating the .hi-files for
modules with many imports.
None of the changes affect compilation determinism as the module list
is explicitly sorted to ensure a canonical order.
- - - - -
2d0fd154 by Alan Zimmerman at 2026-06-29T11:44:00-04:00
EPA: Remove LocatedC / SrcSpanAnnC
This is part of a cleanup of the zoo of
SrcSpanAnnXXX types for exact print annotations.
This one removes SrcSpanAnnC used for storing exact print annotations
for contexts. It replaces it with an explicit `HsContext` data type
that carries the annotations and the context.
So, replace
type HsContext pass = [LHsType pass]
with
type HsContext pass = HsContextDetails pass (LHsType pass)
data HsContextDetails pass arg
= HsContext
{ hsc_ext :: !(XHsContext pass)
, hsc_ctxt :: [arg]
}
| XHsContextDetails !(XXHsContextDetails pass)
We need the parameterised HsContextDetails because it is used both for
HsQual carrying 'LHsExpr p' and "normal" contexts carrying 'LHsType p'.
- - - - -
cca0d589 by Luite Stegeman at 2026-06-30T13:33:40-04:00
rts: handle large AP closures in compacting GC
The function update_fwd_large in the compacting GC could run into
an unexpected object with the following error:
internal error: update_fwd_large: unknown/strange object 24
Closure type 24 is the AP closure, which was not handled in
upd_fwd_large. This patch adds handling them.
fixes #27434
- - - - -
42935858 by Luite Stegeman at 2026-06-30T13:33:40-04:00
testsuite: use compacting_gc way instead of hardcoding +RTS -c
- - - - -
bf7b5ce6 by Alan Zimmerman at 2026-06-30T13:34:23-04:00
EPA: Remove LocatedLW from LStmtLR
HsDo already had its XDo extension point for an
AnnList, which also appeared in LocatedLW.
So we remove the redundant one and use the one inside HsDo
as originally intended.
Also delete LocatedLC/LocatedLS as they were unused
- - - - -
d7cfea49 by Recursion Ninja at 2026-06-30T21:37:12-04:00
Decoupling 'L.H.S' from 'GHC.Types.SourceText'
* Migrated 'IntegralLit' to 'L.H.S.Lit'.
* Migrated 'FractionalLit' to 'L.H.S.Lit'.
* Migrated 'StringLiteral' to 'L.H.S.Lit'.
* Added TTG extension points to the types above.
* Added nice export list to 'GHC.Hs.Lit'.
* Added 'rnOverLitVal' and 'tcOverLitVal' functions to 'GHC.Hs.Lit'.
* Added instance 'Anno (StringLiteral (GhcPass p)) = SrcSpanAnnN'
* Moved [Notes] about 'SourceText' from 'L.H.S.*' to 'GHC.*'.
* Removed all references to 'SourceText' from 'L.H.S'.
* Removed the trailing comma record field from 'StringLiteral'
* Renamed exported functions for nomenclature consistency.
* Deprecated the renamed functions
Fixes #26953
- - - - -
a1f2558b by Recursion Ninja at 2026-06-30T21:37:12-04:00
Monomorphising GHC pass parameters where appropriate
- - - - -
7bf9e3c5 by Teo Camarasu at 2026-06-30T21:38:03-04:00
Make Q abstract
This patch aims to clearly demarcate the internal and external interfaces
of Q.
In the past the `Quasi` typeclass was both part of the external,
public-facing interface, and was used to give the implementation of `Q`.
Now we separate out these two distinct roles. `Quasi` continues to exist
in the public interface, but we introduce a new `MetaHandlers` type,
which is equivalent to `Dict Quasi`.
`Q a` is now defined to be `MetaHandlers -> IO a`, and, crucially,
the constructor and the new `MetaHandlers` type are not exposed from the
public interface.
This gives us the ability to vary the interface on the GHC side without
forcing a breaking change on the `template-haskell` side.
Similarly `template-haskell` has more freedom to change the `Quasi`
typeclass without needing any changes in `lib:ghc`.
Implements https://github.com/ghc-proposals/ghc-proposals/pull/700
Resolves #27341
- - - - -
4262af36 by L0neGamer at 2026-06-30T21:38:56-04:00
generically defines mconcat in terms of internal type's Semigroup instance
add changelog entry
use simpler definition for mconcat
`nonEmpty` isn't available yet; inline branches in case
add test case
fixup generically defines mconcat in terms of internal type's Semigroup instance
add comment on Generically and deriving mishaps
swap mconcat to foldr version
add some strictness testing for mconcat
add to `base` changelog entry
- - - - -
e22ad997 by Cheng Shao at 2026-06-30T21:39:43-04:00
hadrian/rts: fix unregisterised build for gcc 15+
This patch fixes unregisterised build for gcc 15+:
- Pass -optc-Wno-error in hadrian when +werror enables -optc-Werror,
see added comment for details.
- For RTS functions that the codegen would emit calls, ensure their
real prototype is hidden when the header is included in .hc fies
(IN_STG_CODE), and the dummy prototype is provided to match the EFF_
convention.
In the future we should get rid of EFF_ (#14647) and remove these
hacks, but for now this patch makes unregisterised work again on newer
toolchains. Fixes #27404.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
3f00f234 by Cheng Shao at 2026-06-30T21:40:32-04:00
compiler: fix missing handling of CmmUnsafeForeignCall node in LayoutStack
This patch fixes missing handling of `CmmUnsafeForeignCall` middle
node in the `LayoutStack` pass.
Before proc-points splitting, this pass computes liveliness of local
registers, and spills those alive across a Cmm native call onto the
stack. It need to traverse all middle nodes in each block and check
whether a local register is an assignee, if so then the previous
mapping in `sm_regs` is invalidated and needs to be dropped. However,
it didn't handle `CmmUnsafeForeignCall` node which may also assign to
a local register. When proc-points splitting is enabled, this can
produce an invalid basic block that doesn't properly backup the
updated local register to the stack before doing a Cmm call, resulting
in completely invalid runtime behavior.
The patch also adds a `T27447` regression test. With no-TNTC or with
LLVM backend, without the fix the test case would output a stale
0x1111111111111111 value, instead of the expected 0x2222222222222222
output.
Fixes #27447.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
701088db by Ben Gamari at 2026-07-01T10:34:03-04:00
gitlab-ci: Drop vestigial references to make build system
- - - - -
62d54a53 by Ben Gamari at 2026-07-01T10:34:03-04:00
gitlab-ci: Add support for running specifying a job's testsuite ways
- - - - -
7f97ac2c by Ben Gamari at 2026-07-01T10:34:03-04:00
gitlab-ci: Run llvm testsuite ways in llvm jobs
Addresses #25762.
- - - - -
7ea75116 by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Add normalise_ddump_deriv setup function
Some tests check the result of -ddump-deriv, which may contain INLINE pragmas depending on optimization flags.
With normalise_ddump_deriv setup function, INLINE pragmas are stripped off.
- - - - -
c7a8199f by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Use -dsuppress-idinfo to make tests more robust
Previously, T18052a and T21755 were failing on 'optasm' and 'optllvm' ways because of visibility of unfoldings.
- - - - -
a12122e5 by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Use a trick to keep large objects alive
Previously, T17574 and T19381 were failing on 'optasm' and 'optllvm' ways because of compiler optimizations.
Change them to use NOINLINE to prevent unwanted optimizations.
- - - - -
1a95b327 by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Only run T24224 in 'normal' way
This test is a frontend-only one and breaks if optimizations are enabled.
- - - - -
8abea737 by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Ignore T18118's stderr
When optimizations are enabled, the compiler emits a warning (You cannot SPECIALISE ...).
The message is not important, so ignore it.
- - - - -
9453a722 by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Mark T816 and tc216 broken with optimizations
These tests are about type checking, so we should not care too much if they are broken with optimizations.
See #26952
- - - - -
0aef9ec0 by Ben Gamari at 2026-07-01T10:34:03-04:00
testsuite: ds014 is not longer broken
It now appears to pass in the ways it was marked as broken in.
Closes #14901.
- - - - -
4692d1e4 by Ben Gamari at 2026-07-01T10:34:03-04:00
testsuite: Only run stack cloning tests in the normal way
These are too dependent upon code generation specifics to pass in most
other ways.
- - - - -
c154df26 by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Update options_ghc_fbyte-code
The `-fbyte-code` option used to be overriden by `-fllvm` but it is no longer true since !14872 was merged.
I updated the test to accept the new behavior.
Closes #27049
- - - - -
5d8bb7b5 by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Only run T22744 in 'normal' way
This test takes a long time on optimized ways.
- - - - -
d1e74c8e by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Disable tests that use -finfo-table-map on llvm ways
Currently, -finfo-table-map does not work with -fllvm. See #26435
- - - - -
3bf38c84 by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Don't run T24726 on optimized ways
If optimizations are enabled, the rewrite rule just fires and -drule-check will report nothing.
- - - - -
e4eef116 by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Use -fno-unoptimized-core-for-interpreter when running LinkableUsage01/02
Optimizations for the bytecode interpreter are considered experimental, and need a flag to be enabled.
- - - - -
234a9872 by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Suppress unwanted optimizations on T25284
- - - - -
99a2af2f by ARATA Mizuki at 2026-07-01T10:34:03-04:00
testsuite: Don't run stack_big_ret with optimizations
Stack layout may change with optimizations enabled.
- - - - -
04c836df by ARATA Mizuki at 2026-07-01T10:34:04-04:00
testsuite: Mark memo001 broken on optimized ways
See #27396
- - - - -
1a8a24f4 by ARATA Mizuki at 2026-07-01T10:34:04-04:00
testsuite: Mark syn-perf broken on optimized ways
See #27398
- - - - -
40412093 by Duncan Coutts at 2026-07-01T10:34:50-04:00
Add a test for thread scheduler fairness
It also tests that the interval timer and context switching works.
We also test that fairness is lost when the context switching interval
is too coarse for the duration of the test.
We add this test before doing surgery on the interval timer, so we have
decent coverage.
- - - - -
3f34d557 by Duncan Coutts at 2026-07-01T10:34:50-04:00
Make exported stop/startTimer no-ops, and rename internal functions
Specifically, internally rename:
stop/startTimer to pause/unpauseTimer
stop/startTicker to pause/unpauseTicker
and keep stop/startTimer as exported functions, but now as no-ops.
In the past the stop/startTicker actions were used incorrectly as if
they were synchronous, which they are not. See issue #27105. We now
document pause/unpackTicker as being async and not to be used for the
purpose of concurrency safety.
The existing stop/startTimer (note Timer not Ticker, the Timer calls the
Ticker!) are also exported from the RTS as a public API. This was
historically because the ticker used signals and it was important to
suspend the timer signel over a process fork. So these functions were
exported to be used by the process and unix libraries.
We cannot just remove the RTS exports, but we now make them no-ops, and
they can be removed from the process and unix library later. This
was already documented in a changelog.d entry no-more-timer-signal but
due to changes during the MR process the change to make stop/startTicker
into no-ops didn't make it into the earlier MR.
- - - - -
02e84e5f by Duncan Coutts at 2026-07-01T10:34:51-04:00
Make exitTicker/exitTimer unconditionally synchronous
We never use them asynchronously, and we should never need to do so.
And update some related comments.
- - - - -
13db6a72 by Duncan Coutts at 2026-07-01T10:34:51-04:00
posix ticker: update and improve comments on (un)pause and exit
Clarify what is async vs sync.
- - - - -
43d9a07d by Duncan Coutts at 2026-07-01T10:34:51-04:00
posix ticker: split out ppoll/select helper functions
Move the #ifdefs out of the main code body by introducing local helper
functions and types, which themselves have two implementations (with a
common API) based on ppoll or select.
This helps improve clarity/readability.
- - - - -
a5491baa by Duncan Coutts at 2026-07-01T10:34:51-04:00
posix ticker: improve the implementation
The existing implementation supported pausing and exiting, with the
implementation of pausing reling on a mutex and condition variable.
It needed to check the pause and stop shared variables on every
iteration. It relies on ppoll or select, to wait on the timeout and also
wait on an interrupt fd. The interrupt fd was only used for prompt
exit/shutdown, and not for pausing or other notification. The pause only
needed a lock and a memory operation, but the pause was not prompt. The
resume used a lock, and signaling a cond var.
The new implementation uses a somewhat more regular design: every
notification is done by setting a shared variable and
interrupting/notifying the ticker via the fd. The ticker thread does not
need to check any shared variables on normal timer expiry, only when it
recevies notification. This may be a micro-optimisation, but the tick
occurs 100 times a second by default so any improvements in the hot path
are amplified. When the ticker thread does receive notification it can
check the various shared variables and update its local state. The
blocking relies on using ppoll/select but without a timeout. This avoids
the condition var and also allows further notifications when paused
(also used for unpausing).
This design can be extended with further notification types if needed by
using and checking further shared vars (or making existing shared vars
an enum or counter). This may be used in future for additional
notifications to the ticker thread. This will likely be used to proxy
wakeUpRts from a single handler context for example. And this approach,
avoiding mutexes, is compatible with use from signal handlers.
So overall, it's:
* slightly simpler / more regular;
* easier to extend with additional notifications;
* probably slightly more efficient (but a micro-optimisation);
* and supports calling notification from signal handlers
- - - - -
5b20821e by Duncan Coutts at 2026-07-01T10:34:51-04:00
posix ticker: further minor local renaming for code clarity
Improve the clarity with better choice of names for several local vars
and function.
- - - - -
1f3ec5e0 by Duncan Coutts at 2026-07-01T10:34:51-04:00
win32 ticker: split out local helper functions
- - - - -
596e7307 by Duncan Coutts at 2026-07-01T10:34:51-04:00
win32 ticker: provide guarantee about concurrency and idempotency
Use a lock to ensure pause/unpause can be used concurrently. Use a
paused variable, protected by the lock, to ensure that pause and unpause
are both idempotent. This is what the portable API expects.
- - - - -
1870edd7 by Duncan Coutts at 2026-07-01T10:34:51-04:00
win32 ticker: make the initial tick be after one wait interval
There is no need to tick immediately. This is consistent with the
posix implementation.
- - - - -
7c15ab5b by Duncan Coutts at 2026-07-01T10:34:51-04:00
ticker: remove now-unnecessary layer of enable/disable
There was an atomic variable used to block *part* of the actions of the
tick handler. This still did not make stopTimer synchronous, even for
the part of the the handle_tick actions it covered. It also added a more
expensive (sequentuially consistent) atomic operation in the hot path
for the handle_tick action, whereas our new design requires no atomic
ops at all.
Now that we have eliminate the need for synchronous stop/startTicker,
we don't need this not-quite-working-anyway atomic protocol. The new
pause/unpauseTicker is explicitly asynchronous and idempotent.
- - - - -
8585f8cb by Duncan Coutts at 2026-07-01T10:34:51-04:00
ticker: add TODOs about issue #27250: too much being done from handle_tick
The handle_tick should not perform I/O, block, perform long-running
operations or call arbitrary user code. Unfortunately, everything to
do with the eventlog (at the moment) falls into all those categories.
- - - - -
6e381626 by Duncan Coutts at 2026-07-01T22:29:55+01:00
Adjust releaseCapability_ precondition to allow cap->running_task == NULL
There are two use cases for releaseCapability_:
1. The current Task (cap->running_task) releases the Capability.
The Capability is marked free, and if there is any work to do,
an appropriate Task is woken up.
2. There is no current task (cap->task == NULL), and thus the
Capability is idle, and we want to wake up an idle Task to animate
the Capability. This case uses always_wakeup.
Currently, the precondition for releaseCapability_ is
cap->running_task != NULL
and so the 2nd use cases have to set cap->running_task (which is then
immediately overwritten) just to satisfy the precondition. See the
use cases in sendMessage and prodCapability.
So we can relax the precondition to be:
cap->running_task != NULL || always_wakeup
so that in the always_wakeup case, we say it is ok for the
cap->running_task to be NULL.
This lets us simplify sendMessage and prodCapability. In particular it
will allow prodCapability to not need a Task parameter.
The ulterior motive for all this is that I want to be able to call
prodCapability from an OS thread that is not itself a Task, in persuit
of issue #27086: disentangle I/O managers from wakeUpRts. The most
straightforward way to wake the RTS is using prodCapability, but the
context in which we will need to do that are threads that are not Tasks.
- - - - -
89404ebc by Duncan Coutts at 2026-07-01T22:29:55+01:00
prodCapability no longer needs to take a Task param
Now that releaseCapability_ can accept cap->running_task == NULL then it
is no longer necessary for prodCapability to require a Task.
- - - - -
4e60c5f6 by Duncan Coutts at 2026-07-01T22:29:56+01:00
Define prodOneCapability
There was an existing declaration for this in the header file, but no
definition.
Similarly, there is a declaration for prodAllCapabilities but no
definition, and we don't need it, so remove the declaration.
- - - - -
2527026f by Duncan Coutts at 2026-07-01T22:29:56+01:00
Add a wakeUpRtsViaTicker feature to the posix ticker
It proxies a call to wakeUpRts, but crucially, this can be called from
a signal handler context. It will be used for ctl-c handling.
- - - - -
aa5a03a5 by Duncan Coutts at 2026-07-01T22:29:56+01:00
Change how wakeUpRts works
Previously it would call wakeupIOManager to get a capability to wake up
and run. This works but it entangles the I/O managers with unrelated
features: ctl-c handling and idle gc (the two features that use wakeUpRts).
The reason it used wakeupIOManager is that this action is safe to use
from a posix signal handler, since it just posts bytes to a pipe.
Otherwise the more direct approach (used e.g. by sendMessage when the
target capability is idle) is to use releaseCapability. But that uses
condition variables and mutexes, which are not safe to use from within a
signal handler.
So instead of entangling the (multiple) I/O managers with this, we make
wakeUpRts use the direct approach (using prodOneCapability). On win32
the ctl-c console handler can call wakeUpRts directly, since it is
called in a proper thread. On posix, to deal with the signal handler
problem, we make the signal handler ask the ticker thread to proxy the
call to wakeUpRts, since the ticker thread is also a proper thread.
This will allow the I/O managers to no longer be concerned with this.
This is good because there are many I/O managers (and they're
complicated), but there is (on posix) only one ticker implementation. So
this is an overall reduction in coupling and complexity.
Fixes issue #27086
- - - - -
c6d53c16 by sheaf at 2026-07-02T21:35:44-04:00
Test driver: normalise line numbers into libraries
When comparing the stdout of tests that print out callstacks, we can't
rely on the stability of exact line:column spans pointing into libraries
(e.g. ghc-internal), as any change (such as adding a comment) can change
them.
This commit addresses this by normalising away line:column in callstacks,
but only when those point into internal libraries. We don't do this in
general, as the exact span might be important to the test (e.g. for a
span within the test module itself).
Fixes #27387
- - - - -
81ee62e0 by Alan Zimmerman at 2026-07-02T21:36:33-04:00
EPA: Remove LocatedLW from MatchGroup
This is the last usage of LocatedLW / SrcSpanAnnLW
- - - - -
925959db by Recursion Ninja at 2026-07-04T04:14:12-04:00
Decoupling 'L.H.S' from 'GHC.Hs.Doc'
* Migrated 'GHC.Hs.Doc' and 'GHC.Hs.DocString' AST defintions from 'GHC.*' namespace,
to new 'Language.Haskell.Syntax.Doc' module in the 'L.H.S' "namespace."
* Updated 'HsDocString to be TTG-parameterised as 'HsDocString pass'.
* Added 'GHC.Hs.Extension.Pass': splits 'GhcPass'/'Pass' and all 'HsDocString'
TTG instances out of 'GHC.Hs.Extension', which re-exports it unchanged
(this is backwards compatible and prevents the introduction of a boot file).
* Deleted 'GHC.Hs.Doc.hs-boot'; removed all 'L.H.S.*' imports of 'GHC.Hs.Doc'.
* Updated 'GHC.Hs.DocString' to be TTG pass-parameterised throughout; moved
'mkHsDocStringChunk'/'unpackHDSC' here (require 'GHC.Utils.Encoding').
* Split 'GHC.Rename.Doc.rnHsDoc' from 'rnHsDocIdentifiersOnly'.
* Updated parser, renamer, typechecker, HIE, and exact-print for new types.
* Added 'HsDocString' TTG instances for 'DocNameI' to 'Haddock.Types'.
* Killed the last module loop between GHC.* and LHS.*.
- Only edges from LHS.* to GHC.Data.FastString now!
Resolves #26971
- - - - -
b7e24044 by mangoiv at 2026-07-04T04:14:56-04:00
ci: retry fetching test metrics
Retry fetching test metrics to make the CI not fail if the services is
temporarily unavailable
- - - - -
4180af3f by Zubin Duggal at 2026-07-04T04:15:38-04:00
Bump semaphore-compat submodule to 2.0.1
This versions includes some cruicial fixes for darwin
- - - - -
242d4317 by sheaf at 2026-07-04T04:16:19-04:00
Remove outdated comment in GHC.Data.ShortText
There was a long comment in GHC.Data.ShortText about a workaround that
was necessary when bootstrapping with GHC 9.2 and below. The actual
logic has since been dropped, but the comment remained. This commit
removes the vestigial comment.
- - - - -
9b714c4c by Zubin Duggal at 2026-07-05T09:40:36+05:30
CorePrep: Don't speculatively evaluate bindings that we have already discovered to be absent
In #25924, we segfault because speculation forces a projection out of a RUBBISH dictionary
(which we generated because it absent).
Solution: Don't speculate on bindings we already know are absent.
Fixes 25924
- - - - -
4a59b3ee by Zubin Duggal at 2026-07-05T09:40:36+05:30
Don't make absent fillers for terminating types
In #25924 we discovered that we could speculatively evaluate an absent filler
for a dictionary, and project a field (a superclass selector) out of it,
resulting in segfaults.
Solution: Never make an absent filler or rubbish literal for a terminating type
like a dictionary. mkAbsentFiller returns Nothing for isTerminatingType, so
worker/wrapper and the specialiser keep the real argument instead.
Some small metric decreases because we do a little less work in the
simplifier now.
Metric Decrease:
T9872a
T9872b
T9872c
TcPlugin_RewritePerf
- - - - -
383ddcd4 by Alan Zimmerman at 2026-07-06T07:08:16-04:00
EPA: Move the 'where' annotation for PatSynBind
This allows us to move it out of the MatchGroup exact print annotation
too
- - - - -
5635b035 by Simon Jakobi at 2026-07-07T22:43:40+02:00
testsuite: Repeat output of unexpected failures in the final summary
Previously the end-of-run summary named each unexpectedly failing test
with only a one-line reason such as "bad exit code (2)". The output
explaining *why* the test failed was printed mid-run, where it is
interleaved with unrelated test chatter and, in CI, buried thousands of
lines up the log (#16720).
The driver already captures a failing test's stdout/stderr in TestResult
for junit.xml, so reuse that: after the failure lists, print each
unexpected failure's captured output, truncated to 100 lines per stream
to keep pathological tests from flooding the log.
Also attach the captured run stdout/stderr to bad-exit-code failures in
simple_run, which previously recorded no output at all - neither
junit.xml nor the new summary section could explain such failures. The
interactive-run path already did this.
Addresses #16720.
Co-Authored-By: Claude Fable 5 <noreply(a)anthropic.com>
- - - - -
8f6cf95d by Simon Jakobi at 2026-07-07T22:43:40+02:00
testsuite: Colorize the failure-output summary, also in CI
Make the per-test blocks in the "Output of unexpected failures"
section easier to scan:
* the '=====> test(way) [reason]' header is red,
* the 'Captured stdout/stderr:' labels are cyan,
* a closing '<===== end of output of unexpected failures' marker,
also red, fences the section off from subsequent build output.
Colors were previously disabled in CI because the driver only emits
them when stdout is a tty, yet the GitLab log viewer renders ANSI
colors fine. Add a --force-colors driver flag and pass it from
.gitlab/ci.sh. Note that config.supports_colors stays tty-based, since
it also guards terminal-title escape sequences, which must not end up
in a CI log.
The SUMMARY header and the new section now honor summary()'s color
parameter, so the plain-text summary file no longer receives escape
codes when colors are enabled.
Co-Authored-By: Claude Fable 5 <noreply(a)anthropic.com>
- - - - -
4dd27764 by Simon Jakobi at 2026-07-07T22:43:40+02:00
testsuite: Reorder and bound the repeated failure output
Address review feedback on !16166:
- Print the repeated failure output first, so the TEST= list, counts and
failure lists stay at the very end of the log where readers look for them.
- Skip the output entirely above MAX_SUMMARY_OUTPUT_TESTS unexpected
failures, where the dump would drown out the summary and junit.xml is the
better tool.
Co-Authored-By: Claude Opus 4.8 <noreply(a)anthropic.com>
- - - - -
c78f05e5 by Simon Jakobi at 2026-07-07T22:43:40+02:00
DO NOT MERGE: Break some tests to exercise the failure summary
Deliberately break three tests, one per failure mode, to see the new
end-of-run failure output in CI:
* cgrun001: wrong expected stdout -> bad stdout (diff in summary)
* T18619: wrong expected stderr -> bad stderr (diff in summary)
* cgrun002: program now exits 3 and writes to stderr
-> bad exit code, exercising the newly captured
run stdout/stderr in simple_run
Co-Authored-By: Claude Fable 5 <noreply(a)anthropic.com>
- - - - -
6c16f9cb by Simon Jakobi at 2026-07-07T22:43:40+02:00
testsuite: Don't list unexpected failures twice in the summary
Previously a failing test could appear in three places in the summary:
its repeated output (=====> header), a separate 'Unexpected failures:'
directory list, and the concise TEST= rerun line. Collapse this so each
failing case is shown once, and place the repeated output where readers
look for it:
- When the output is shown (at most MAX_SUMMARY_OUTPUT_TESTS failures),
the =====> header is the only per-test listing; the test's directory
is folded into it and the separate directory list is dropped.
- When the output is omitted (too many failures), the failures are
listed in the directory list instead.
The repeated failure output and the TEST= rerun line are printed directly
above the SUMMARY counts: the verbose output blends with the run's inline
output, and TEST= sits right where the counts begin. The TEST= line always
includes the failures, so it is shown even when their output is.
Co-Authored-By: Claude Opus 4.8 <noreply(a)anthropic.com>
- - - - -
73a7d1e1 by Simon Jakobi at 2026-07-07T22:43:40+02:00
testsuite: Bundle identical failure output across ways
A test that fails identically in several ways (e.g. normal and g1) now
shares a single output block in the summary, with the ways collected in
the header, rather than repeating the same captured output once per way.
Co-Authored-By: Claude Opus 4.8 <noreply(a)anthropic.com>
- - - - -
6c50f856 by Simon Jakobi at 2026-07-07T22:43:40+02:00
testsuite: Show a stable source-relative directory in failure output
The failure-output summary derived the test's directory from opts.testdir,
which is relative to wherever make was invoked, so e.g. a test under
codeGen/should_run would show as should_run/... when make ran from codeGen/.
Record the directory as the test's source directory relative to the GHC
source root instead, so it reads the same regardless of the make working
directory and works for out-of-tree suites like libraries/base/tests. Drop
the now-redundant run-dir leaf (it just repeated the test name) and the
obsolete tempdir-stripping that the old /tmp-prefixed paths needed.
Co-Authored-By: Claude Opus 4.8 <noreply(a)anthropic.com>
- - - - -
f7d67acb by Simon Jakobi at 2026-07-07T22:47:47+02:00
Break test ElemNoFusion_O2.stderr
...as a test.
- - - - -
606 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/test-metrics.sh
- + changelog.d/26616
- + changelog.d/AbstractQ
- + changelog.d/T17833
- + changelog.d/T21176
- + changelog.d/T26978
- + changelog.d/T27047
- + changelog.d/T27308
- + changelog.d/T27386
- + changelog.d/add_can_drop_to_occurence_analyser
- changelog.d/config
- + changelog.d/deterministic-usage-order
- + changelog.d/fix-absent-dict-projection
- + changelog.d/fix-compacting-gc-ap-27434
- + changelog.d/fix-exponential-case-desugar-27383
- + changelog.d/fix-layout-stack-fcall
- + changelog.d/fix-plugin-finder-multi-home-unit.md
- + changelog.d/fix-unreg
- + changelog.d/generically-mconcat
- + changelog.d/interactive-error-hints
- changelog.d/module-graph-reuse-in-downsweep
- changelog.d/more-efficient-home-unit-imports-finding
- + changelog.d/pp-set-ghc-version
- + changelog.d/reexported-module-errors
- + changelog.d/remove-ddump-json-flag
- changelog.d/semaphore-v2
- + changelog.d/stable-core-dump-order-27296
- + changelog.d/stage2-cross-compilers
- + changelog.d/tag-inference-27005
- + changelog.d/tool-messages-27370
- + changelog.d/unused-type
- compiler/.hlint.yaml
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/RV64/CodeGen.hs
- compiler/GHC/CmmToAsm/RV64/Instr.hs
- compiler/GHC/CmmToAsm/RV64/Ppr.hs
- compiler/GHC/CmmToAsm/RV64/Regs.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs
- compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs
- compiler/GHC/CmmToAsm/Reg/Linear/X86.hs
- compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs
- compiler/GHC/CmmToAsm/X86/RegInfo.hs
- compiler/GHC/CmmToAsm/X86/Regs.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/Ppr.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Data/BooleanFormula.hs
- compiler/GHC/Data/IOEnv.hs
- compiler/GHC/Data/List/NonEmpty.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Config.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Errors.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main/Interactive.hs
- compiler/GHC/Driver/Main/Passes.hs
- compiler/GHC/Driver/Main/Passes.hs-boot
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Doc.hs
- − compiler/GHC/Hs/Doc.hs-boot
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Extension.hs
- + compiler/GHC/Hs/Extension/Pass.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Stats.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match.hs-boot
- compiler/GHC/HsToCore/Match/Constructor.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Pmc/Solver/Types.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/HsToCore/Usage.hs
- compiler/GHC/Iface/Binary.hs
- compiler/GHC/Iface/Errors.hs
- compiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Iface/Warnings.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/HaddockLex.x
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Doc.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Lit.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Splice.hs-boot
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Stg/EnforceEpt.hs
- compiler/GHC/Stg/EnforceEpt/Rewrite.hs
- compiler/GHC/Stg/EnforceEpt/TagSig.hs
- compiler/GHC/Stg/EnforceEpt/Types.hs
- compiler/GHC/SysTools/Process.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/GHC/SysTools/Terminal.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Hole/FitTypes.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Gen/Splice.hs-boot
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/FunDeps.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Error.hs
- − compiler/GHC/Types/Error.hs-boot
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Literal.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Types/PkgQual.hs
- compiler/GHC/Types/SourceError.hs
- compiler/GHC/Types/SourceText.hs
- compiler/GHC/Unit.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Finder/Types.hs
- compiler/GHC/Unit/Module/Deps.hs
- compiler/GHC/Unit/Module/Env.hs
- compiler/GHC/Unit/Module/Warnings.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Utils/Error.hs
- compiler/GHC/Utils/Logger.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Binds/InlinePragma.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Decls/Foreign.hs
- + compiler/Language/Haskell/Syntax/Doc.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Expr.hs-boot
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/Language/Haskell/Syntax/Pat.hs
- compiler/Language/Haskell/Syntax/Type.hs
- − compiler/Language/Haskell/Syntax/Type.hs-boot
- compiler/ghc.cabal.in
- configure.ac
- distrib/configure.ac.in
- docs/users_guide/bugs.rst
- docs/users_guide/debugging.rst
- docs/users_guide/ghci.rst
- docs/users_guide/phases.rst
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Exception.hs
- ghc/Main.hs
- hadrian/README.md
- hadrian/bindist/config.mk.in
- hadrian/cfg/default.host.target.in
- + hadrian/cfg/system.config.host.in
- hadrian/cfg/system.config.in
- + hadrian/cfg/system.config.target.in
- hadrian/hadrian.cabal
- hadrian/src/Base.hs
- + hadrian/src/BindistConfig.hs
- hadrian/src/Builder.hs
- hadrian/src/Context.hs
- hadrian/src/Expression.hs
- hadrian/src/Flavour.hs
- hadrian/src/Flavour/Type.hs
- hadrian/src/Hadrian/Builder.hs
- hadrian/src/Hadrian/Haskell/Hash.hs
- hadrian/src/Hadrian/Oracles/TextFile.hs
- hadrian/src/Main.hs
- hadrian/src/Oracles/Flag.hs
- hadrian/src/Oracles/Flavour.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Oracles/TestSettings.hs
- hadrian/src/Packages.hs
- hadrian/src/Rules.hs
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/CabalReinstall.hs
- hadrian/src/Rules/Changelog.hs
- hadrian/src/Rules/Compile.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Gmp.hs
- hadrian/src/Rules/Library.hs
- hadrian/src/Rules/Program.hs
- hadrian/src/Rules/Register.hs
- hadrian/src/Rules/Rts.hs
- hadrian/src/Rules/Test.hs
- hadrian/src/Settings.hs
- hadrian/src/Settings/Builders/Cabal.hs
- hadrian/src/Settings/Builders/Common.hs
- hadrian/src/Settings/Builders/Configure.hs
- hadrian/src/Settings/Builders/DeriveConstants.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Builders/Hsc2Hs.hs
- hadrian/src/Settings/Builders/RunTest.hs
- hadrian/src/Settings/Builders/SplitSections.hs
- hadrian/src/Settings/Default.hs
- hadrian/src/Settings/Flavours/GhcInGhci.hs
- hadrian/src/Settings/Flavours/Performance.hs
- hadrian/src/Settings/Flavours/QuickCross.hs
- hadrian/src/Settings/Packages.hs
- hadrian/src/Settings/Program.hs
- hadrian/src/Settings/Warnings.hs
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- + libraries/base/src/Data/Double.hs
- + libraries/base/src/Data/Float.hs
- libraries/base/src/Data/List/NonEmpty.hs
- libraries/base/src/GHC/Base.hs
- libraries/base/src/GHC/Exts.hs
- libraries/base/tests/all.T
- libraries/base/tests/perf/ElemNoFusion_O2.stderr
- libraries/ghc-bignum/changelog.md
- libraries/ghc-boot/GHC/Data/ShortText.hs
- libraries/ghc-experimental/src/GHC/PrimOps.hs
- libraries/ghc-heap/tests/all.T
- libraries/ghc-internal/src/GHC/Internal/Bignum/Integer.hs
- libraries/ghc-internal/src/GHC/Internal/Bits.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/Generics.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Lib.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Monad.hs
- libraries/ghc-internal/src/GHC/Internal/Types.hs
- libraries/ghci/GHCi/TH.hs
- libraries/process
- libraries/semaphore-compat
- libraries/template-haskell/Language/Haskell/TH/Syntax.hs
- libraries/xhtml
- m4/fp_find_nm.m4
- m4/prep_target_file.m4
- rts/Capability.c
- rts/Capability.h
- rts/Messages.c
- rts/RtsStartup.c
- rts/Schedule.c
- rts/Ticker.h
- rts/Timer.c
- rts/Timer.h
- rts/include/rts/NonMoving.h
- rts/include/rts/Timer.h
- rts/include/stg/MiscClosures.h
- rts/posix/Ticker.c
- rts/sm/Compact.c
- rts/sm/Evac.h
- rts/sm/GC.c
- rts/win32/Ticker.c
- testsuite/driver/junit.py
- testsuite/driver/runtests.py
- testsuite/driver/testlib.py
- testsuite/ghc-config/ghc-config.hs
- testsuite/tests/annotations/should_fail/annfail03.stderr
- testsuite/tests/annotations/should_fail/annfail04.stderr
- testsuite/tests/annotations/should_fail/annfail06.stderr
- testsuite/tests/annotations/should_fail/annfail09.stderr
- testsuite/tests/arityanal/should_compile/T21755.stderr
- testsuite/tests/arityanal/should_compile/all.T
- testsuite/tests/bytecode/TLinkable/all.T
- testsuite/tests/cmm/should_compile/all.T
- + testsuite/tests/cmm/should_run/T27447.hs
- + testsuite/tests/cmm/should_run/T27447.stdout
- + testsuite/tests/cmm/should_run/T27447_cmm.cmm
- testsuite/tests/cmm/should_run/all.T
- + testsuite/tests/codeGen/should_gen_asm/aarch64-sxth-mul2.asm
- + testsuite/tests/codeGen/should_gen_asm/aarch64-sxth-mul2.cmm
- + testsuite/tests/codeGen/should_gen_asm/aarch64-sxtw.asm
- + testsuite/tests/codeGen/should_gen_asm/aarch64-sxtw.cmm
- testsuite/tests/codeGen/should_gen_asm/all.T
- testsuite/tests/codeGen/should_run/T16617.hs
- testsuite/tests/codeGen/should_run/T16617.stdout
- + testsuite/tests/codeGen/should_run/aarch64-sxtw-cmm.cmm
- + testsuite/tests/codeGen/should_run/aarch64-sxtw-run.hs
- + testsuite/tests/codeGen/should_run/aarch64-sxtw-run.stdout
- testsuite/tests/codeGen/should_run/all.T
- testsuite/tests/codeGen/should_run/cgrun001.stdout
- testsuite/tests/codeGen/should_run/cgrun002.hs
- + testsuite/tests/concurrent/should_run/T27105.hs
- testsuite/tests/concurrent/should_run/all.T
- testsuite/tests/core-to-stg/T14895.stderr
- testsuite/tests/core-to-stg/T25284/Cls.hs
- + testsuite/tests/core-to-stg/T25924/B.hs
- + testsuite/tests/core-to-stg/T25924/Main.hs
- + testsuite/tests/core-to-stg/T25924/all.T
- + testsuite/tests/core-to-stg/T25924a.hs
- + testsuite/tests/core-to-stg/T25924a.stdout
- testsuite/tests/core-to-stg/all.T
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- + testsuite/tests/deSugar/should_compile/T27383.hs
- testsuite/tests/deSugar/should_compile/all.T
- testsuite/tests/deSugar/should_fail/all.T
- testsuite/tests/deSugar/should_run/all.T
- testsuite/tests/deriving/should_compile/all.T
- testsuite/tests/dmdanal/should_compile/T18982.stderr
- testsuite/tests/driver/T16167.stderr
- − testsuite/tests/driver/T16167.stdout
- + testsuite/tests/driver/T27370/Makefile
- + testsuite/tests/driver/T27370/T27370.hs
- + testsuite/tests/driver/T27370/T27370.pp
- + testsuite/tests/driver/T27370/T27370.stderr
- + testsuite/tests/driver/T27370/all.T
- testsuite/tests/driver/all.T
- testsuite/tests/driver/json2.stderr
- − testsuite/tests/driver/json_dump.hs
- − testsuite/tests/driver/json_dump.stderr
- + testsuite/tests/driver/multipleHomeUnits/plugin01/all.T
- + testsuite/tests/driver/multipleHomeUnits/plugin01/appunit
- + testsuite/tests/driver/multipleHomeUnits/plugin01/p/MyPlugin.hs
- + testsuite/tests/driver/multipleHomeUnits/plugin01/pluginunit
- + testsuite/tests/driver/multipleHomeUnits/plugin01/q/App.hs
- + testsuite/tests/driver/multipleHomeUnits/plugin02/all.T
- + testsuite/tests/driver/multipleHomeUnits/plugin02/appunit
- + testsuite/tests/driver/multipleHomeUnits/plugin02/p/MyPlugin.hs
- + testsuite/tests/driver/multipleHomeUnits/plugin02/pluginunit
- + testsuite/tests/driver/multipleHomeUnits/plugin02/q/App.hs
- + testsuite/tests/driver/multipleHomeUnits/plugin02/r/RexLib.hs
- + testsuite/tests/driver/multipleHomeUnits/plugin02/reexportunit
- testsuite/tests/driver/options_ghc/Mod_fbyte_code.hs
- testsuite/tests/driver/options_ghc/all.T
- testsuite/tests/driver/options_ghc/options_ghc_fbyte-code.stderr
- testsuite/tests/generics/GenDerivOutput.hs
- testsuite/tests/generics/GenDerivOutput1_0.hs
- testsuite/tests/generics/GenDerivOutput1_1.hs
- testsuite/tests/generics/T10604/T10604_deriving.hs
- testsuite/tests/generics/T10604/all.T
- + testsuite/tests/generics/T27245.hs
- + testsuite/tests/generics/T27245.stdout
- testsuite/tests/generics/all.T
- testsuite/tests/ghc-api/T25121_status.stdout
- + testsuite/tests/ghc-api/T27240.hs
- testsuite/tests/ghc-api/all.T
- testsuite/tests/ghc-api/annotations-literals/literals.stdout
- testsuite/tests/ghc-api/annotations-literals/parsed.hs
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/ghc-e/should_fail/all.T
- testsuite/tests/ghci.debugger/scripts/all.T
- testsuite/tests/ghci/prog-mhu002/prog-mhu002c.stdout
- testsuite/tests/ghci/scripts/ghci024.stdout
- testsuite/tests/ghci/scripts/ghci024.stdout-mingw32
- testsuite/tests/haddock/haddock_testsuite/Makefile
- testsuite/tests/haddock/haddock_testsuite/all.T
- 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/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/ghc-bignum-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/javascript/closure/all.T
- testsuite/tests/module/mod185.stderr
- testsuite/tests/numeric/should_run/T18619.stderr
- + testsuite/tests/numeric/should_run/T21176.hs
- + testsuite/tests/numeric/should_run/T21176.stdout
- + testsuite/tests/numeric/should_run/T21176.stdout-ws-32
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/overloadedrecflds/should_compile/DRFPatSynExport.stdout
- + testsuite/tests/package/ImportReexport.hs
- + testsuite/tests/package/ImportReexport.stderr
- testsuite/tests/package/all.T
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20718b.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/parser/should_compile/all.T
- testsuite/tests/perf/compiler/T11068.stdout
- + testsuite/tests/perf/compiler/T26426.hs
- testsuite/tests/perf/compiler/all.T
- testsuite/tests/pmcheck/should_compile/T12957.stderr
- testsuite/tests/printer/AnnotationNoListTuplePuns.stdout
- testsuite/tests/printer/T18052a.stderr
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test10309.hs
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/printer/all.T
- testsuite/tests/profiling/perf/T23103/all.T
- + testsuite/tests/profiling/should_compile/T27386.hs
- testsuite/tests/profiling/should_compile/all.T
- testsuite/tests/profiling/should_run/all.T
- testsuite/tests/profiling/should_run/staticcallstack002.stdout
- testsuite/tests/quasiquotation/qq001/qq001.stderr
- testsuite/tests/quasiquotation/qq002/qq002.stderr
- testsuite/tests/quasiquotation/qq003/qq003.stderr
- testsuite/tests/quasiquotation/qq004/qq004.stderr
- testsuite/tests/quotes/LiftErrMsg.stderr
- testsuite/tests/quotes/LiftErrMsgDefer.stderr
- testsuite/tests/quotes/LiftErrMsgTyped.stderr
- testsuite/tests/quotes/T10384.stderr
- testsuite/tests/quotes/T5721.stderr
- testsuite/tests/quotes/TH_localname.stderr
- testsuite/tests/rename/should_compile/T1792_imports.stdout
- testsuite/tests/rename/should_compile/T18264.stdout
- testsuite/tests/rename/should_compile/T4239.stdout
- testsuite/tests/rts/T17574.hs
- testsuite/tests/rts/T19381.hs
- + testsuite/tests/rts/T27434.hs
- + testsuite/tests/rts/T27434.stdout
- testsuite/tests/rts/all.T
- testsuite/tests/rts/ipe/T24005/all.T
- testsuite/tests/showIface/DocsInHiFile1.stdout
- testsuite/tests/showIface/DocsInHiFileTH.stdout
- testsuite/tests/showIface/HaddockSpanIssueT24378.stdout
- testsuite/tests/showIface/MagicHashInHaddocks.stdout
- testsuite/tests/showIface/NoExportList.stdout
- testsuite/tests/simplCore/should_compile/Makefile
- testsuite/tests/simplCore/should_compile/T13156.stdout
- testsuite/tests/simplCore/should_compile/T26615.stderr
- + testsuite/tests/simplCore/should_compile/T27296.hs
- + testsuite/tests/simplCore/should_compile/T27296.stdout
- + testsuite/tests/simplCore/should_compile/T27296b.hs
- + testsuite/tests/simplCore/should_compile/T27296b.stdout
- testsuite/tests/simplCore/should_compile/T4201.stdout
- testsuite/tests/simplCore/should_compile/T8832.hs
- testsuite/tests/simplCore/should_compile/T8832.stdout
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/simplCore/should_run/T27005.hs
- + testsuite/tests/simplCore/should_run/T27005.stdout
- + testsuite/tests/simplCore/should_run/T27005_aux.hs
- testsuite/tests/simplCore/should_run/all.T
- testsuite/tests/simplStg/should_compile/T24806.hs
- testsuite/tests/simplStg/should_compile/T24806.stderr
- + testsuite/tests/simplStg/should_compile/T27005b.hs
- + testsuite/tests/simplStg/should_compile/T27005b.stderr
- testsuite/tests/simplStg/should_compile/all.T
- testsuite/tests/simplStg/should_compile/inferTags004.hs
- testsuite/tests/simplStg/should_compile/inferTags004.stderr
- + testsuite/tests/simplStg/should_run/T27005a.hs
- + testsuite/tests/simplStg/should_run/T27005a.stdout
- testsuite/tests/simplStg/should_run/all.T
- testsuite/tests/splice-imports/SI03.stderr
- testsuite/tests/splice-imports/SI05.stderr
- testsuite/tests/splice-imports/SI08.stderr
- testsuite/tests/splice-imports/SI08_oneshot.stderr
- testsuite/tests/splice-imports/SI16.stderr
- testsuite/tests/splice-imports/SI18.stderr
- testsuite/tests/splice-imports/SI20.stderr
- testsuite/tests/splice-imports/SI25.stderr
- testsuite/tests/splice-imports/SI28.stderr
- testsuite/tests/splice-imports/SI29.stderr
- testsuite/tests/splice-imports/SI31.stderr
- testsuite/tests/splice-imports/SI36.stderr
- testsuite/tests/splice-imports/T26088.stderr
- testsuite/tests/splice-imports/T26090.stderr
- + testsuite/tests/splice-imports/T26616.hs
- + testsuite/tests/splice-imports/T26616.stderr
- testsuite/tests/splice-imports/all.T
- testsuite/tests/th/T16976z.stderr
- testsuite/tests/th/T17820a.stderr
- testsuite/tests/th/T17820b.stderr
- testsuite/tests/th/T17820c.stderr
- testsuite/tests/th/T17820d.stderr
- testsuite/tests/th/T17820e.stderr
- testsuite/tests/th/T21547.stderr
- testsuite/tests/th/T23829_hasty.stderr
- testsuite/tests/th/T23829_hasty_b.stderr
- testsuite/tests/th/T23829_tardy.ghc.stderr
- testsuite/tests/th/T26098_local.stderr
- testsuite/tests/th/T26098_quote.stderr
- testsuite/tests/th/T26098_splice.stderr
- testsuite/tests/th/T26099.stderr
- testsuite/tests/th/T26568.stderr
- testsuite/tests/th/T5795.stderr
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr
- testsuite/tests/typecheck/should_fail/T13292.stderr
- + testsuite/tests/typecheck/should_fail/T27390-explicit-kinds.stderr
- + testsuite/tests/typecheck/should_fail/T27390.hs
- + testsuite/tests/typecheck/should_fail/T27390.stderr
- + testsuite/tests/typecheck/should_fail/T27390a.hs
- testsuite/tests/typecheck/should_fail/all.T
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Preprocess.hs
- utils/check-exact/Utils.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Program.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Utils.hs
- utils/haddock/CONTRIBUTING.md
- utils/haddock/haddock-api/src/Haddock.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Meta.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Names.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/Doc.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Json.hs
- utils/haddock/haddock-api/src/Haddock/Interface/LexParseRn.hs
- utils/haddock/haddock-api/src/Haddock/Interface/ParseModuleHeader.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/Options.hs
- utils/haddock/haddock-api/src/Haddock/Parser.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- utils/haddock/haddock-api/src/Haddock/Utils/Json.hs
- utils/haddock/haddock-api/src/Haddock/Utils/Json/Parser.hs
- utils/haddock/haddock-api/src/Haddock/Utils/Json/Types.hs
- utils/haddock/haddock-library/src/Documentation/Haddock/Doc.hs
- utils/haddock/haddock-library/src/Documentation/Haddock/Markup.hs
- utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
- utils/haddock/haddock-library/src/Documentation/Haddock/Parser/Util.hs
- utils/haddock/haddock-library/src/Documentation/Haddock/Types.hs
- utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
- utils/haddock/haddock-test/haddock-test.cabal
- utils/haddock/haddock-test/src/Test/Haddock/Config.hs
- utils/haddock/html-test/ref/Hash.html
- utils/haddock/html-test/ref/Test.html
- utils/haddock/html-test/ref/TypeFamilies3.html
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/16d64293993d844d3fc84cce6d59a7…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/16d64293993d844d3fc84cce6d59a7…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/spj-reinstallable-base2] more fixes across platforms
by Rodrigo Mesquita (@alt-romes) 07 Jul '26
by Rodrigo Mesquita (@alt-romes) 07 Jul '26
07 Jul '26
Rodrigo Mesquita pushed to branch wip/spj-reinstallable-base2 at Glasgow Haskell Compiler / GHC
Commits:
8a94a8d4 by Rodrigo Mesquita at 2026-07-07T20:30:18+01:00
more fixes across platforms
- - - - -
3 changed files:
- libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable.hsc
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Encoding.hs
- libraries/ghc-internal/src/GHC/Internal/JS/Prim.hs
Changes:
=====================================
libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable.hsc
=====================================
@@ -25,6 +25,7 @@ import GHC.Internal.Maybe (Maybe(..))
import GHC.Internal.Foreign.Ptr
import GHC.Internal.Foreign.Storable
import GHC.Internal.Num as Rebindable( fromInteger ) -- For known-key names
+import qualified GHC.Internal.Stack.Types as Rebindable
-------------------------------------------------------------------------
-- Profiling specific code
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Encoding.hs
=====================================
@@ -26,6 +26,7 @@ module GHC.Internal.IO.Windows.Encoding
import GHC.Internal.Base (String, assert, return, ($), (.))
import qualified GHC.Internal.Base as Rebindable ((>>=))
+import qualified GHC.Internal.IO.Exception as Rebindable (assertError)
import GHC.Internal.Classes (Eq(..), Ord(..))
import qualified GHC.Internal.Num as Rebindable (fromInteger)
import GHC.Internal.Types (Int)
=====================================
libraries/ghc-internal/src/GHC/Internal/JS/Prim.hs
=====================================
@@ -50,6 +50,7 @@ import qualified GHC.Internal.Types as GHC (unpackCString#, unpackCStringUtf8#)
import GHC.Internal.IO
import GHC.Internal.Base
import GHC.Internal.Show
+import qualified GHC.Internal.Data.Typeable.Internal as Rebindable
{-
JSVal is a boxed type that can be used as FFI
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8a94a8d476b803e64a14fb022bca27e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8a94a8d476b803e64a14fb022bca27e…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/az/exactprint-annotation-rationalisation] 18 commits: EPA: Replace AnnListItem with simply [TrailingAnn]
by Alan Zimmerman (@alanz) 07 Jul '26
by Alan Zimmerman (@alanz) 07 Jul '26
07 Jul '26
Alan Zimmerman pushed to branch wip/az/exactprint-annotation-rationalisation at Glasgow Haskell Compiler / GHC
Commits:
6f2945bf by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Replace AnnListItem with simply [TrailingAnn]
Remove the unnecessary wrapper around a single field.
- - - - -
cc76aa8e by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Keep binds and sigs together in HsValBindsLR
This allows us to get rid of AnnSortKey BindTag
- - - - -
790f5445 by Alan Zimmerman at 2026-07-07T19:23:48+01:00
Keep decls together in ClassDecl
Keep binds and sigs together in HsValBindsLR
TBD
- - - - -
8618457a by Alan Zimmerman at 2026-07-07T19:23:48+01:00
Fix ppr for ClassDecl to include DocDs
- - - - -
e83e4a1e by Alan Zimmerman at 2026-07-07T19:23:48+01:00
Some tidy ups of the decls stuff. Squash it in
- - - - -
8408a4d9 by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: ClsInstDecl as list in GhcPs
- - - - -
ee24ac5d by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Remove LocatedP from OverlapMode
- - - - -
69ae4f61 by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Remove LocatedP from CType
- - - - -
daae45a0 by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Remove LocatedP, last use in WarningTxt
- - - - -
539148ac by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Remove LocatedE from WarningCategory
- - - - -
653e945f by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Remove LocateE from XCImport and XCExport
- - - - -
2347a37a by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Remove LocatedE from HsRecFields dot
- - - - -
97899ea3 by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Remove LocatedE completely, last usage for pats
- - - - -
cad662f0 by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Remove AnnList (EpToken "where") usages
This is moving toward removing the parameter from AnnList completely
- - - - -
8dcc8633 by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA remove AnnList (EpToken "rec") usages
- - - - -
ad174164 by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Remove last parameterised AnnList usage (EpaLocation)
Also remove the parameter
- - - - -
49315234 by Alan Zimmerman at 2026-07-07T19:23:48+01:00
TTG: Add extension points to BooleanFormula
They are currently unused, but will be used for exact print annotations next
- - - - -
6c4b2853 by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Remove LocatedBC / SrcSpanBF
- - - - -
89 changed files:
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/Core/Class.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Data/BooleanFormula.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Decls/Overlap.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Stats.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Warnings.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Class.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/ForeignCall.hs
- compiler/GHC/Unit/Module/Warnings.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/BooleanFormula.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- ghc/GHCi/UI.hs
- + hadrian/cfg/system.config.host
- + hadrian/cfg/system.config.target
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/haddock/haddock_examples/haddock.Test.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20718b.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/printer/AnnotationNoListTuplePuns.stdout
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/typecheck/should_compile/T15242.stderr
- testsuite/tests/typecheck/should_compile/all.T
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0d4d8f86bac596f599851614701e58…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0d4d8f86bac596f599851614701e58…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/az/epa-tidy-locatedxxx-6] EPA: Replace AnnListItem with simply [TrailingAnn]
by Alan Zimmerman (@alanz) 07 Jul '26
by Alan Zimmerman (@alanz) 07 Jul '26
07 Jul '26
Alan Zimmerman pushed to branch wip/az/epa-tidy-locatedxxx-6 at Glasgow Haskell Compiler / GHC
Commits:
6f2945bf by Alan Zimmerman at 2026-07-07T19:23:48+01:00
EPA: Replace AnnListItem with simply [TrailingAnn]
Remove the unnecessary wrapper around a single field.
- - - - -
35 changed files:
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Tc/Gen/Head.hs
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20718b.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/printer/AnnotationNoListTuplePuns.stdout
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/typecheck/should_compile/T15242.stderr
- testsuite/tests/typecheck/should_compile/all.T
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6f2945bf740fcbcb3049870e0dd6273…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6f2945bf740fcbcb3049870e0dd6273…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/spj-reinstallable-base2] fixup: fix build on Windows
by sheaf (@sheaf) 07 Jul '26
by sheaf (@sheaf) 07 Jul '26
07 Jul '26
sheaf pushed to branch wip/spj-reinstallable-base2 at Glasgow Haskell Compiler / GHC
Commits:
41d3e988 by sheaf at 2026-07-07T18:55:07+02:00
fixup: fix build on Windows
- - - - -
17 changed files:
- libraries/base/src/Control/Concurrent.hs
- libraries/ghc-internal/src/GHC/Internal/Conc/POSIX.hs
- libraries/ghc-internal/src/GHC/Internal/ConsoleHandler.hsc
- libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc
- libraries/ghc-internal/src/GHC/Internal/Event/Windows/Clock.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc
- libraries/ghc-internal/src/GHC/Internal/Event/Windows/FFI.hsc
- libraries/ghc-internal/src/GHC/Internal/Event/Windows/ManagedThreadPool.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows/Thread.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Encoding.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Encoding/CodePage/API.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock/Windows.hsc
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Windows.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Encoding.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
- libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
- libraries/ghc-internal/src/GHC/Internal/Windows.hs
Changes:
=====================================
libraries/base/src/Control/Concurrent.hs
=====================================
@@ -123,6 +123,11 @@ import GHC.Internal.Foreign.C.Types
import System.IO
import GHC.Internal.Data.Functor ( void )
import GHC.Internal.Int ( Int64 )
+#if __GLASGOW_HASKELL__ >= 1001
+import qualified GHC.Internal.Stack.Types as Rebindable
+ ( SrcLoc(..), pushCallStack, emptyCallStack )
+import qualified GHC.Internal.Types as Rebindable
+#endif
#else
import qualified GHC.Internal.Conc.IO as Conc
#endif
=====================================
libraries/ghc-internal/src/GHC/Internal/Conc/POSIX.hs
=====================================
@@ -46,6 +46,7 @@ module GHC.Internal.Conc.POSIX
import GHC.Internal.Data.Bits (shiftR)
import GHC.Internal.Base (fmap, foldr, otherwise, return, when, ($))
+import qualified GHC.Internal.Base as Rebindable
import GHC.Internal.Classes (Eq(..), Ord(..), not)
import GHC.Internal.Clock
import GHC.Internal.Conc.Sync
=====================================
libraries/ghc-internal/src/GHC/Internal/ConsoleHandler.hsc
=====================================
@@ -52,8 +52,8 @@ import GHC.Internal.Foreign.Storable
import GHC.Internal.Stable
import GHC.Internal.Conc.IO
import GHC.Internal.Control.Concurrent.MVar
-import GHC.Internal.Types (Bool, IO)
import GHC.Internal.Base as Rebindable
+import qualified GHC.Internal.Num as Rebindable
data Handler
= Default
=====================================
libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc
=====================================
@@ -109,6 +109,7 @@ import GHC.Internal.Base (
Semigroup(..), String, Monoid(..), const, fmap, otherwise, return, when,
($), (.), (++), (>>=), (=<<), (>>),
)
+import qualified GHC.Internal.Base as Rebindable
import GHC.Internal.Classes (Eq(..), Ord(..), not, (&&), (||))
import GHC.Internal.Conc.Bound
import GHC.Internal.Conc.Sync
@@ -118,10 +119,15 @@ import GHC.Internal.Num
import GHC.Internal.Real
import GHC.Internal.Bits
import GHC.Internal.Stable
+import qualified GHC.Internal.Stack.Types as Rebindable
+ ( SrcLoc(..), pushCallStack, emptyCallStack )
import GHC.Internal.Enum (maxBound)
+import qualified GHC.Internal.Enum as Rebindable
import GHC.Internal.Types (Bool(..), Int)
+import qualified GHC.Internal.Types as Rebindable
import GHC.Internal.Windows
import GHC.Internal.List (null)
+import qualified GHC.Internal.Show as Rebindable
import GHC.Internal.Text.Show
import GHC.Internal.Foreign.Ptr
import GHC.Internal.Foreign.Marshal.Utils
=====================================
libraries/ghc-internal/src/GHC/Internal/Event/Windows/Clock.hs
=====================================
@@ -15,9 +15,14 @@ import qualified GHC.Internal.Event.Windows.FFI as FFI
import GHC.Internal.Data.Maybe
import GHC.Internal.Base (Monad(..), fmap, liftM, ($!))
+import qualified GHC.Internal.Base as Rebindable
import GHC.Internal.Err (undefined)
+import qualified GHC.Internal.Num as Rebindable
import GHC.Internal.Real
+import qualified GHC.Internal.Stack.Types as Rebindable
+ ( SrcLoc(..), pushCallStack, emptyCallStack )
import GHC.Internal.Types (Double, IO)
+import qualified GHC.Internal.Types as Rebindable
-- | Monotonic clock
newtype Clock = Clock (IO Seconds)
=====================================
libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc
=====================================
@@ -24,17 +24,21 @@ module GHC.Internal.Event.Windows.ConsoleEvent (
) where
import GHC.Internal.Base (return, ($))
+import qualified GHC.Internal.Base as Rebindable
import GHC.Internal.Classes (Eq, Ord)
import GHC.Internal.Conc.Sync
import GHC.Internal.Data.Maybe (Maybe(..))
import GHC.Internal.Enum (Enum)
+import qualified GHC.Internal.Enum as Rebindable
import GHC.Internal.Err (errorWithoutStackTrace)
import GHC.Internal.IO (IO, unsafePerformIO)
import GHC.Internal.MVar
import GHC.Internal.Num (Num(..))
import GHC.Internal.Read (Read)
+import qualified GHC.Internal.Read as Rebindable
import GHC.Internal.Word (Word32)
import GHC.Internal.Show (Show)
+import qualified GHC.Internal.Show as Rebindable
#include <windows.h>
=====================================
libraries/ghc-internal/src/GHC/Internal/Event/Windows/FFI.hsc
=====================================
@@ -72,9 +72,11 @@ module GHC.Internal.Event.Windows.FFI (
import GHC.Internal.Data.Maybe
import GHC.Internal.Base (String, fmap, return, ($), (.), (++), (>>=))
+import qualified GHC.Internal.Base as Rebindable
import GHC.Internal.Classes (Eq(..), Ord, (||))
import GHC.Internal.Err (undefined)
import GHC.Internal.Num ((*))
+import qualified GHC.Internal.Num as Rebindable
import GHC.Internal.Foreign.Marshal.Alloc
import GHC.Internal.Foreign.Marshal.Utils
import GHC.Internal.Foreign.Storable
@@ -84,6 +86,8 @@ import GHC.Internal.Word
import GHC.Internal.Stable
import GHC.Internal.Real (fromIntegral)
import GHC.Internal.Show
+import qualified GHC.Internal.Stack.Types as Rebindable
+ ( SrcLoc(..), pushCallStack, emptyCallStack )
import GHC.Internal.Types (Bool(..), IO)
import GHC.Internal.Windows
import qualified GHC.Internal.Event.Array as A
=====================================
libraries/ghc-internal/src/GHC/Internal/Event/Windows/ManagedThreadPool.hs
=====================================
@@ -28,14 +28,18 @@ module GHC.Internal.Event.Windows.ManagedThreadPool
) where
import GHC.Internal.Base (return, ($))
+import qualified GHC.Internal.Base as Rebindable
import GHC.Internal.Control.Concurrent.MVar
import GHC.Internal.Data.Maybe
import GHC.Internal.Err (undefined)
import GHC.Internal.Num ((-), (+))
+import qualified GHC.Internal.Num as Rebindable
import qualified GHC.Internal.Event.Array as A
import GHC.Internal.IO.Handle.Internals (debugIO)
import GHC.Internal.Conc.Sync (ThreadId(..))
import GHC.Internal.RTS.Flags.Test
+import qualified GHC.Internal.Stack.Types as Rebindable
+ ( SrcLoc(..), pushCallStack, emptyCallStack )
import GHC.Internal.Types (Int, IO)
------------------------------------------------------------------------
=====================================
libraries/ghc-internal/src/GHC/Internal/Event/Windows/Thread.hs
=====================================
@@ -8,6 +8,7 @@ module GHC.Internal.Event.Windows.Thread (
) where
import GHC.Internal.Base (return, ($), (>>))
+import qualified GHC.Internal.Base as Rebindable
import GHC.Internal.Event.Windows
import GHC.Internal.IO
import GHC.Internal.MVar
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Encoding.hs
=====================================
@@ -47,6 +47,7 @@ import qualified GHC.Internal.IO.Encoding.Iconv as Iconv
#else
import qualified GHC.Internal.IO.Encoding.CodePage as CodePage
import GHC.Internal.Read (readsPrec)
+import qualified GHC.Internal.Num as Rebindable
#endif
import qualified GHC.Internal.IO.Encoding.Latin1 as Latin1
import qualified GHC.Internal.IO.Encoding.UTF8 as UTF8
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Encoding/CodePage/API.hs
=====================================
@@ -2,6 +2,7 @@
{-# LANGUAGE CPP, NoImplicitPrelude, NondecreasingIndentation,
RecordWildCards, ScopedTypeVariables,
UnboxedTuples #-}
+{-# LANGUAGE MagicHash #-}
{-# OPTIONS_GHC -Wno-name-shadowing #-}
module GHC.Internal.IO.Encoding.CodePage.API (
@@ -23,6 +24,7 @@ import GHC.Internal.Word
import GHC.Internal.Base (
String, const, fmap, otherwise, return, when, ($), (.), (>>),
)
+import qualified GHC.Internal.Base as Rebindable ((>>=))
import GHC.Internal.Classes (Eq(..), Ord(..), not, (&&), (||))
import GHC.Internal.Err (errorWithoutStackTrace, undefined)
import GHC.Internal.List
@@ -32,8 +34,11 @@ import GHC.Internal.IO.Encoding.Types
import GHC.Internal.IO.Encoding.UTF16
import GHC.Internal.Num
import GHC.Internal.Show
+import qualified GHC.Internal.Stack.Types as Rebindable
+ ( SrcLoc(..), pushCallStack, emptyCallStack )
import GHC.Internal.Real
import GHC.Internal.Types (Bool(..), Char, Int, IO(..), Ordering(..))
+import qualified GHC.Internal.Types as Rebindable
import GHC.Internal.Windows hiding (LPCSTR)
import GHC.Internal.ForeignPtr (castForeignPtr)
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock/Windows.hsc
=====================================
@@ -16,6 +16,7 @@ import GHC.Internal.Base as Rebindable
#include <windows.h>
+import GHC.Internal.Base as Rebindable
import GHC.Internal.Data.Bits
import GHC.Internal.Data.Function
import GHC.Internal.IO.Handle.Windows (handleToHANDLE)
@@ -30,6 +31,7 @@ import GHC.Internal.IO.Handle.FD
import GHC.Internal.IO.Handle.Types (Handle)
import GHC.Internal.IO.Handle.Lock.Common (LockMode(..))
import GHC.Internal.IO.SubSystem
+import qualified GHC.Internal.Num as Rebindable
import GHC.Internal.Windows
lockImpl :: Handle -> String -> LockMode -> Bool -> IO Bool
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Handle/Windows.hs
=====================================
@@ -25,6 +25,8 @@ import GHC.Internal.Data.Maybe
import GHC.Internal.Data.Typeable
import GHC.Internal.Base (String, fmap, otherwise, return, ($))
+import qualified GHC.Internal.Base as Rebindable
+import qualified GHC.Internal.Data.Typeable.Internal as Rebindable
import GHC.Internal.MVar
import GHC.Internal.IO
import GHC.Internal.IO.BufferedIO hiding (flushWriteBuffer)
@@ -35,6 +37,8 @@ import GHC.Internal.IO.IOMode
import GHC.Internal.IO.Handle.Types
import GHC.Internal.IO.Handle.Internals
import qualified GHC.Internal.IO.Windows.Handle as Win
+import qualified GHC.Internal.Stack.Types as Rebindable
+ ( SrcLoc(..), pushCallStack, emptyCallStack )
import GHC.Internal.Types (Bool(..))
-- ---------------------------------------------------------------------------
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Encoding.hs
=====================================
@@ -25,8 +25,11 @@ module GHC.Internal.IO.Windows.Encoding
) where
import GHC.Internal.Base (String, assert, return, ($), (.))
+import qualified GHC.Internal.Base as Rebindable ((>>=))
import GHC.Internal.Classes (Eq(..), Ord(..))
+import qualified GHC.Internal.Num as Rebindable (fromInteger)
import GHC.Internal.Types (Int)
+import qualified GHC.Internal.Types as Rebindable
import GHC.Internal.Word (Word8, Word16)
import GHC.Internal.Foreign.C.Types (CInt(..))
import GHC.Internal.Foreign.C.String (peekCAStringLen, peekCWStringLen,
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc
=====================================
@@ -63,14 +63,20 @@ import GHC.Internal.Base (
const, flip, fmap, liftM2, otherwise, return, when,
($), ($!), (.), (=<<), (>>),
)
+import qualified GHC.Internal.Base as Rebindable
import GHC.Internal.Classes (Eq(..), Ord(..), not, (&&), (||))
import GHC.Internal.Data.Maybe (Maybe(..))
import GHC.Internal.Enum
import GHC.Internal.Err (error, undefined)
import GHC.Internal.Num
import GHC.Internal.Real
+import qualified GHC.Internal.Show as Rebindable
+import qualified GHC.Internal.Stack.Types as Rebindable
+ ( SrcLoc(..), pushCallStack, emptyCallStack )
import GHC.Internal.List
import GHC.Internal.Types (Bool(..), Int)
+import qualified GHC.Internal.Types as Rebindable
+import qualified GHC.Internal.Data.Typeable.Internal as Rebindable
import GHC.Internal.Word (Word8, Word16, Word64)
import GHC.Internal.IO hiding (mask)
=====================================
libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
=====================================
@@ -47,6 +47,7 @@ import GHC.Internal.Foreign.C.String
import GHC.Internal.Base (String, otherwise, ($))
#if defined(mingw32_HOST_OS)
import GHC.Internal.Base ((.))
+import qualified GHC.Internal.Num as Rebindable
import GHC.Internal.Foreign.Ptr
import GHC.Internal.Windows
import GHC.Internal.Control.Monad
=====================================
libraries/ghc-internal/src/GHC/Internal/Windows.hs
=====================================
@@ -78,10 +78,8 @@ module GHC.Internal.Windows (
nullHANDLE,
) where
-import GHC.Internal.Classes (Eq(..), not)
import GHC.Internal.Data.Bits (finiteBitSize, shiftL, shiftR, (.|.), (.&.))
import GHC.Internal.Err (undefined)
-import GHC.Internal.Types (Bool(..))
import GHC.Internal.Unicode (isSpace)
import GHC.Internal.Data.OldList
import GHC.Internal.Data.Maybe
@@ -96,6 +94,7 @@ import GHC.Internal.Enum (maxBound)
import GHC.Internal.IO
import GHC.Internal.Num
import GHC.Internal.Real (fromIntegral)
+import qualified GHC.Internal.Stack.Types as Rebindable (SrcLoc(..), pushCallStack, emptyCallStack)
import GHC.Internal.System.IO.Error
import qualified GHC.Internal.Numeric
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/41d3e988c8af9b9da5f6caa0f9d907d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/41d3e988c8af9b9da5f6caa0f9d907d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/sjakobi/T25233] X86 NCG: use btr/bts/btc for single-bit operations
by Simon Jakobi (@sjakobi2) 07 Jul '26
by Simon Jakobi (@sjakobi2) 07 Jul '26
07 Jul '26
Simon Jakobi pushed to branch wip/sjakobi/T25233 at Glasgow Haskell Compiler / GHC
Commits:
8ff2e0e0 by Simon Jakobi at 2026-07-07T18:42:24+02:00
X86 NCG: use btr/bts/btc for single-bit operations
Lower the Cmm patterns
x & ~(1 << i) ==> btr i, x
x | (1 << i) ==> bts i, x
x ^ (1 << i) ==> btc i, x
(with non-literal i) to x86 bit-test instructions instead of a
mov/shl/not/and-style sequence. This makes e.g. clearBit on Word
compile to a single instruction, matching what C compilers produce.
See Note [Bit-test instructions] in GHC.CmmToAsm.X86.CodeGen.
Closes #25233
Assisted-by: Claude Fable 5
- - - - -
6 changed files:
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- + testsuite/tests/codeGen/should_gen_asm/T25233.asm
- + testsuite/tests/codeGen/should_gen_asm/T25233.hs
- testsuite/tests/codeGen/should_gen_asm/all.T
Changes:
=====================================
compiler/GHC/CmmToAsm/X86/CodeGen.hs
=====================================
@@ -1442,6 +1442,28 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps
(PUNPCKLQDQ fmt (OpReg dst) dst)
)
+-- Use the bit-test instructions btr/bts/btc for clearing, setting and
+-- complementing a single, variable bit: e.g. x .&. complement (1 `shiftL` i)
+-- is btr. See Note [Bit-test instructions].
+getRegister' _ is32Bit (CmmMachOp (MO_And w) [x, CmmMachOp (MO_Not w') [y]])
+ | w == w', Just i <- isSingleBit w y, bitTestOpWidthOK is32Bit w
+ = genBitTestCode (intFormat w) BTR x i
+getRegister' _ is32Bit (CmmMachOp (MO_And w) [CmmMachOp (MO_Not w') [y], x])
+ | w == w', Just i <- isSingleBit w y, bitTestOpWidthOK is32Bit w
+ = genBitTestCode (intFormat w) BTR x i
+getRegister' _ is32Bit (CmmMachOp (MO_Or w) [x, y])
+ | Just i <- isSingleBit w y, bitTestOpWidthOK is32Bit w
+ = genBitTestCode (intFormat w) BTS x i
+getRegister' _ is32Bit (CmmMachOp (MO_Or w) [y, x])
+ | Just i <- isSingleBit w y, bitTestOpWidthOK is32Bit w
+ = genBitTestCode (intFormat w) BTS x i
+getRegister' _ is32Bit (CmmMachOp (MO_Xor w) [x, y])
+ | Just i <- isSingleBit w y, bitTestOpWidthOK is32Bit w
+ = genBitTestCode (intFormat w) BTC x i
+getRegister' _ is32Bit (CmmMachOp (MO_Xor w) [y, x])
+ | Just i <- isSingleBit w y, bitTestOpWidthOK is32Bit w
+ = genBitTestCode (intFormat w) BTC x i
+
getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps
sse4_1 <- sse4_1Enabled
sse4_2 <- sse4_2Enabled
@@ -5883,6 +5905,68 @@ genTrivialCode rep instr a b = do
instr b_op dst
return (Any rep code)
+{- Note [Bit-test instructions]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+x86 has dedicated instructions for clearing (btr), setting (bts) and
+complementing (btc) a single bit whose index is given in a register. We use
+them for Cmm patterns such as
+
+ x & ~(1 << i) ==> btr i, x (#25233)
+
+replacing a mov/shl/not/and sequence with a single instruction. The
+shift-count register operand of shl is masked modulo the operand width, and
+the bit-offset register operand of btr/bts/btc is masked the same way, so
+the replacement is faithful even for out-of-range i (where the Cmm shift is
+in any case undefined).
+
+The bit-offset operand of these instructions must be an immediate or a
+register. We only use them when the bit index is a non-literal expression:
+when i is a literal, constant folding has already turned the mask into a
+literal, and an ordinary and/or/xor with an immediate is at least as good.
+
+We restrict the pattern to W32 and native-width W64: the instructions do not
+exist at width 8, and sub-word Cmm operations at W8/W16 are rare enough that
+they are not worth the extra care.
+-}
+
+-- | Match @1 << i@ with a non-literal @i@, returning @i@.
+-- See Note [Bit-test instructions].
+isSingleBit :: Width -> CmmExpr -> Maybe CmmExpr
+isSingleBit w (CmmMachOp (MO_Shl w') [CmmLit (CmmInt 1 _), i])
+ | w == w', not (isLit i) = Just i
+ where
+ isLit (CmmLit {}) = True
+ isLit _ = False
+isSingleBit _ _ = Nothing
+
+bitTestOpWidthOK :: Bool -> Width -> Bool
+bitTestOpWidthOK is32Bit w = w == W32 || (w == W64 && not is32Bit)
+
+-- | Generate code for @dst := x@ followed by a bit-test instruction
+-- (btr/bts/btc) with bit offset @i@. Analogous to 'genTrivialCode', but the
+-- offset operand must be a register, not memory.
+-- See Note [Bit-test instructions].
+genBitTestCode :: Format -> (Format -> Operand -> Operand -> Instr)
+ -> CmmExpr -> CmmExpr -> NatM Register
+genBitTestCode rep instr x i = do
+ (i_reg, i_code) <- getNonClobberedReg i
+ x_code <- getAnyReg x
+ tmp <- getNewRegNat rep
+ let
+ -- As in genTrivialCode, 'i' must stay alive across the computation of
+ -- 'x' into dst, so save it in a temporary if dst holds 'i'.
+ code dst
+ | dst == i_reg =
+ i_code `appOL`
+ unitOL (MOV rep (OpReg i_reg) (OpReg tmp)) `appOL`
+ x_code dst `snocOL`
+ instr rep (OpReg tmp) (OpReg dst)
+ | otherwise =
+ i_code `appOL`
+ x_code dst `snocOL`
+ instr rep (OpReg i_reg) (OpReg dst)
+ return (Any rep code)
+
regClashesWithOp :: Reg -> Operand -> Bool
reg `regClashesWithOp` OpReg reg2 = reg == reg2
reg `regClashesWithOp` OpAddr amode = any (==reg) (addrModeRegs amode)
=====================================
compiler/GHC/CmmToAsm/X86/Instr.hs
=====================================
@@ -193,6 +193,11 @@ data Instr
| SHLD Format Operand{-amount-} Operand Operand
| BT Format Imm Operand
+ -- Bit test-and-reset/set/complement; the bit offset must be an
+ -- immediate or a register (not memory).
+ | BTR Format Operand{-bit offset-} Operand
+ | BTS Format Operand{-bit offset-} Operand
+ | BTC Format Operand{-bit offset-} Operand
| NOP
@@ -496,6 +501,9 @@ regUsageOfInstr platform instr
SHLD fmt imm dst1 dst2 -> usageRMM fmt imm dst1 dst2
SHRD fmt imm dst1 dst2 -> usageRMM fmt imm dst1 dst2
BT fmt _ src -> mkRUR (use_R fmt src [])
+ BTR fmt off dst -> usageRM fmt off dst
+ BTS fmt off dst -> usageRM fmt off dst
+ BTC fmt off dst -> usageRM fmt off dst
PUSH fmt op -> mkRUR (use_R fmt op [])
POP fmt op -> mkRU [] (def_W fmt op)
@@ -830,6 +838,9 @@ patchRegsOfInstr platform instr env
SHLD fmt imm dst1 dst2 -> patch2 (SHLD fmt imm) dst1 dst2
SHRD fmt imm dst1 dst2 -> patch2 (SHRD fmt imm) dst1 dst2
BT fmt imm src -> patch1 (BT fmt imm) src
+ BTR fmt off dst -> patch2 (BTR fmt) off dst
+ BTS fmt off dst -> patch2 (BTS fmt) off dst
+ BTC fmt off dst -> patch2 (BTC fmt) off dst
TEST fmt src dst -> patch2 (TEST fmt) src dst
CMP fmt src dst -> patch2 (CMP fmt) src dst
PUSH fmt op -> patch1 (PUSH fmt) op
=====================================
compiler/GHC/CmmToAsm/X86/Ppr.hs
=====================================
@@ -862,6 +862,15 @@ pprInstr platform i = case i of
BT format imm src
-> pprFormatImmOp (text "bt") format imm src
+ BTR format off dst
+ -> pprFormatOpOp (text "btr") format off dst
+
+ BTS format off dst
+ -> pprFormatOpOp (text "bts") format off dst
+
+ BTC format off dst
+ -> pprFormatOpOp (text "btc") format off dst
+
CMP format src dst
| isFloatFormat format -> pprFormatOpOp (text "ucomi") format src dst -- SSE2
| otherwise -> pprFormatOpOp (text "cmp") format src dst
=====================================
testsuite/tests/codeGen/should_gen_asm/T25233.asm
=====================================
@@ -0,0 +1,3 @@
+btrq
+btsq
+btcq
=====================================
testsuite/tests/codeGen/should_gen_asm/T25233.hs
=====================================
@@ -0,0 +1,16 @@
+{-# LANGUAGE MagicHash #-}
+
+-- Check that clearing/setting/complementing a single, variable bit
+-- uses the btr/bts/btc instructions (#25233).
+module T25233 where
+
+import GHC.Exts
+
+myClearBit :: Word# -> Int# -> Word#
+myClearBit x i = x `and#` not# (1## `uncheckedShiftL#` i)
+
+mySetBit :: Word# -> Int# -> Word#
+mySetBit x i = x `or#` (1## `uncheckedShiftL#` i)
+
+myComplementBit :: Word# -> Int# -> Word#
+myComplementBit x i = x `xor#` (1## `uncheckedShiftL#` i)
=====================================
testsuite/tests/codeGen/should_gen_asm/all.T
=====================================
@@ -23,6 +23,8 @@ test('avx512-int64-minmax', [unless(arch('x86_64'), skip),
when(unregisterised(), skip)], compile_grep_asm, ['hs', True, '-mavx512vl'])
test('avx512-word64-minmax', [unless(arch('x86_64'), skip),
when(unregisterised(), skip)], compile_grep_asm, ['hs', True, '-mavx512vl'])
+test('T25233', [unless(arch('x86_64'), skip),
+ when(unregisterised(), skip)], compile_grep_asm, ['hs', True, '-O'])
is_aarch64_codegen = [
unless(arch('aarch64'), skip),
when(unregisterised(), skip),
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8ff2e0e01d9e6f4f2f786b2ec846e92…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8ff2e0e01d9e6f4f2f786b2ec846e92…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/andreask/fix-prof-segv] Fix a profiling race condition resulting in segfaults.
by Andreas Klebinger (@AndreasK) 07 Jul '26
by Andreas Klebinger (@AndreasK) 07 Jul '26
07 Jul '26
Andreas Klebinger pushed to branch wip/andreask/fix-prof-segv at Glasgow Haskell Compiler / GHC
Commits:
233005b3 by Andreas Klebinger at 2026-07-07T15:56:04+00:00
Fix a profiling race condition resulting in segfaults.
StgToCmm: Don't assume tagged FUN closures in closureCodeBody.
When entering a closure the self/node pointer might not be tagged in
some situations when a thunk is evaluated by multiple threads.
So we most AND away the tag bits rather than subtracting an expected tag.
Apply.cmm: Fix a race condition occuring when a thunk is mutated during GC.
In stg_ap_0_fast when might need to run GC before entering a thunk. If this happens
another thread or the GC itself might mutate the closure making entering it no longer
valid. We now check for this.
Add test and changelog for #27123 fixes.
- - - - -
5 changed files:
- + changelog.d/T27123.md
- compiler/GHC/StgToCmm/Bind.hs
- rts/Apply.cmm
- + testsuite/tests/rts/T27123.hs
- testsuite/tests/rts/all.T
Changes:
=====================================
changelog.d/T27123.md
=====================================
@@ -0,0 +1,7 @@
+section: compiler
+synopsis: Fix two crashes that could happen in a multithreaded setting when profiling.
+description: There were two bugs that could cause occasional segfaults or crashes with
+an `PAP object entered` error when profiling. They only happened when two threads
+where racing to evaluate the same thunk, and specific GC timings.
+mrs: !16214
+issues: #27123
=====================================
compiler/GHC/StgToCmm/Bind.hs
=====================================
@@ -587,9 +587,8 @@ closureCodeBody top_lvl bndr cl_info cc args@(arg0:_) body fv_details
-- ticky after heap check to avoid double counting
; tickyEnterFun cl_info
; enterCostCentreFun cc
- (CmmMachOp (mo_wordSub platform)
- [ CmmReg (CmmLocal node) -- See [NodeReg clobbered with loopification]
- , mkIntExpr platform (toTargetInt (fromDynTag (funTag platform cl_info))) ])
+ (cmmUntag platform (CmmReg (CmmLocal node))) -- See [NodeReg clobbered with loopification]
+
; fv_bindings <- mapM bind_fv fv_details
-- Load free vars out of closure *after*
-- heap check, to reduce live vars over check
=====================================
rts/Apply.cmm
=====================================
@@ -99,12 +99,14 @@ again:
W_ info;
P_ untaggedfun;
W_ arity;
+ W_ closure_type;
// We must obey the correct heap object observation pattern in
// Note [Heap memory barriers] in SMP.h.
untaggedfun = UNTAG(fun);
info = %INFO_PTR(untaggedfun);
+ closure_type = TO_W_( %INFO_TYPE(%STD_INFO(info)) );
switch [INVALID_OBJECT .. N_CLOSURE_TYPES]
- (TO_W_( %INFO_TYPE(%STD_INFO(info)) )) {
+ (closure_type) {
case
IND,
IND_STATIC:
@@ -212,10 +214,17 @@ again:
// We can't use the value of 'info' any more, because if
// STK_CHK_GEN() did a GC then the closure we're looking
// at may have changed, e.g. a THUNK_SELECTOR may have
- // been evaluated by the GC. So we reload the info
- // pointer now.
+ // been evaluated by the GC.
+ // We always reload the info pointer now. And if
+ // the closure type changed we need to take a different case
+ // alt altogether so we retry from the start in that case.
+
untaggedfun = UNTAG(fun);
info = %INFO_PTR(untaggedfun);
+ if(closure_type != TO_W_( %INFO_TYPE(%STD_INFO(info)) ) )
+ {
+ goto again;
+ }
jump %ENTRY_CODE(info)
(stg_restore_cccs_eval_info, CCCS)
=====================================
testsuite/tests/rts/T27123.hs
=====================================
@@ -0,0 +1,68 @@
+{-# OPTIONS_GHC -fno-full-laziness -fno-worker-wrapper #-}
+{-# LANGUAGE MagicHash, UnboxedTuples #-}
+
+-- This test checks that the auto-apply code (stg_ap_0_fast, stg_ap_p) is robust
+-- against another thread or the GC evaluating a closure at the same time.
+
+module Main
+ -- (main)
+where
+
+import Control.Monad
+import Control.Concurrent
+import System.IO
+import GHC.Data.SmallArray
+import GHC.Exts
+import GHC.IO
+
+type Arr = SmallMutableArray RealWorld (Int->Int)
+
+io :: (State# RealWorld -> (# State# RealWorld, a #)) -> IO a
+io f = IO f
+
+io_ :: (State# RealWorld -> State# RealWorld ) -> IO ()
+io_ f = IO (\s -> case f s of s2 -> (# s2, () #))
+
+{-# NOINLINE readSmallArray #-}
+readSmallArray (SmallMutableArray arr) (I# idx) = IO $ \s -> case readSmallArray# arr idx s of
+ (# s2, r #) -> (# s2, r #)
+
+-- Continually overwrites the array with unevaluated thunks that will evaluated to
+-- a PAP under profiling.
+{-# NOINLINE mkThunks #-}
+mkThunks :: Arr -> IO ()
+mkThunks arr = do
+ forever $ do
+ yield
+ forM_ [0..100] $ \_j -> do
+ forM_ [0..5 :: Int] $ \i -> do
+ -- With profiling results in a thunk that will evaluate to a PAP capturing the SCC
+ let g = {-# SCC g #-} succ
+ io_ (writeSmallArray arr i g)
+
+-- Evaluate the array repeatedly in the given order.
+{-# NOINLINE evaluateThunks #-}
+evaluateThunks :: Arr -> [Int] -> IO ()
+evaluateThunks arr idxs = do
+ forever $ do
+ yield
+ -- putStr "." >> hFlush stdout
+ forM [0..5000::Int] $ \j -> do
+ forM_ idxs $ \i -> do
+ !g <- readSmallArray arr i
+ seq (g i) (pure ())
+
+main :: IO ()
+main = do
+ -- We spawn three threads.
+ -- * Two are evaluating the thunks in the array in opposite directions
+ -- * One thread is writing thunks to the array.
+ -- The reading threads will race to evaluate the same thunk triggering potential
+ -- race conditions.
+ arr <- io (newSmallArray 6 (id))
+ _ <- forkIO $ do
+ evaluateThunks arr [0..5]
+ _ <- forkIO $ do
+ evaluateThunks arr [5,4..0]
+ forkIO $ mkThunks arr
+ threadDelay 10_000_000
=====================================
testsuite/tests/rts/all.T
=====================================
@@ -697,6 +697,8 @@ test('ClosureTable',
test('resizeMutableByteArrayInPlace', [req_cmm, extra_ways(['optasm', 'sanity']), only_ways(['optasm', 'sanity'])], compile_and_run, [''])
+test('T27123', [when(have_profiling(), extra_ways(['prof']))], compile_and_run, ['-O'])
+
test('T27434',
extra_ways(['compacting_gc']),
compile_and_run, [''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/233005b3d2f872f3992b40f7713c809…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/233005b3d2f872f3992b40f7713c809…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/sjakobi/cpr-docs] 15 commits: Adjust releaseCapability_ precondition to allow cap->running_task == NULL
by Simon Jakobi (@sjakobi2) 07 Jul '26
by Simon Jakobi (@sjakobi2) 07 Jul '26
07 Jul '26
Simon Jakobi pushed to branch wip/sjakobi/cpr-docs at Glasgow Haskell Compiler / GHC
Commits:
6e381626 by Duncan Coutts at 2026-07-01T22:29:55+01:00
Adjust releaseCapability_ precondition to allow cap->running_task == NULL
There are two use cases for releaseCapability_:
1. The current Task (cap->running_task) releases the Capability.
The Capability is marked free, and if there is any work to do,
an appropriate Task is woken up.
2. There is no current task (cap->task == NULL), and thus the
Capability is idle, and we want to wake up an idle Task to animate
the Capability. This case uses always_wakeup.
Currently, the precondition for releaseCapability_ is
cap->running_task != NULL
and so the 2nd use cases have to set cap->running_task (which is then
immediately overwritten) just to satisfy the precondition. See the
use cases in sendMessage and prodCapability.
So we can relax the precondition to be:
cap->running_task != NULL || always_wakeup
so that in the always_wakeup case, we say it is ok for the
cap->running_task to be NULL.
This lets us simplify sendMessage and prodCapability. In particular it
will allow prodCapability to not need a Task parameter.
The ulterior motive for all this is that I want to be able to call
prodCapability from an OS thread that is not itself a Task, in persuit
of issue #27086: disentangle I/O managers from wakeUpRts. The most
straightforward way to wake the RTS is using prodCapability, but the
context in which we will need to do that are threads that are not Tasks.
- - - - -
89404ebc by Duncan Coutts at 2026-07-01T22:29:55+01:00
prodCapability no longer needs to take a Task param
Now that releaseCapability_ can accept cap->running_task == NULL then it
is no longer necessary for prodCapability to require a Task.
- - - - -
4e60c5f6 by Duncan Coutts at 2026-07-01T22:29:56+01:00
Define prodOneCapability
There was an existing declaration for this in the header file, but no
definition.
Similarly, there is a declaration for prodAllCapabilities but no
definition, and we don't need it, so remove the declaration.
- - - - -
2527026f by Duncan Coutts at 2026-07-01T22:29:56+01:00
Add a wakeUpRtsViaTicker feature to the posix ticker
It proxies a call to wakeUpRts, but crucially, this can be called from
a signal handler context. It will be used for ctl-c handling.
- - - - -
aa5a03a5 by Duncan Coutts at 2026-07-01T22:29:56+01:00
Change how wakeUpRts works
Previously it would call wakeupIOManager to get a capability to wake up
and run. This works but it entangles the I/O managers with unrelated
features: ctl-c handling and idle gc (the two features that use wakeUpRts).
The reason it used wakeupIOManager is that this action is safe to use
from a posix signal handler, since it just posts bytes to a pipe.
Otherwise the more direct approach (used e.g. by sendMessage when the
target capability is idle) is to use releaseCapability. But that uses
condition variables and mutexes, which are not safe to use from within a
signal handler.
So instead of entangling the (multiple) I/O managers with this, we make
wakeUpRts use the direct approach (using prodOneCapability). On win32
the ctl-c console handler can call wakeUpRts directly, since it is
called in a proper thread. On posix, to deal with the signal handler
problem, we make the signal handler ask the ticker thread to proxy the
call to wakeUpRts, since the ticker thread is also a proper thread.
This will allow the I/O managers to no longer be concerned with this.
This is good because there are many I/O managers (and they're
complicated), but there is (on posix) only one ticker implementation. So
this is an overall reduction in coupling and complexity.
Fixes issue #27086
- - - - -
c6d53c16 by sheaf at 2026-07-02T21:35:44-04:00
Test driver: normalise line numbers into libraries
When comparing the stdout of tests that print out callstacks, we can't
rely on the stability of exact line:column spans pointing into libraries
(e.g. ghc-internal), as any change (such as adding a comment) can change
them.
This commit addresses this by normalising away line:column in callstacks,
but only when those point into internal libraries. We don't do this in
general, as the exact span might be important to the test (e.g. for a
span within the test module itself).
Fixes #27387
- - - - -
81ee62e0 by Alan Zimmerman at 2026-07-02T21:36:33-04:00
EPA: Remove LocatedLW from MatchGroup
This is the last usage of LocatedLW / SrcSpanAnnLW
- - - - -
925959db by Recursion Ninja at 2026-07-04T04:14:12-04:00
Decoupling 'L.H.S' from 'GHC.Hs.Doc'
* Migrated 'GHC.Hs.Doc' and 'GHC.Hs.DocString' AST defintions from 'GHC.*' namespace,
to new 'Language.Haskell.Syntax.Doc' module in the 'L.H.S' "namespace."
* Updated 'HsDocString to be TTG-parameterised as 'HsDocString pass'.
* Added 'GHC.Hs.Extension.Pass': splits 'GhcPass'/'Pass' and all 'HsDocString'
TTG instances out of 'GHC.Hs.Extension', which re-exports it unchanged
(this is backwards compatible and prevents the introduction of a boot file).
* Deleted 'GHC.Hs.Doc.hs-boot'; removed all 'L.H.S.*' imports of 'GHC.Hs.Doc'.
* Updated 'GHC.Hs.DocString' to be TTG pass-parameterised throughout; moved
'mkHsDocStringChunk'/'unpackHDSC' here (require 'GHC.Utils.Encoding').
* Split 'GHC.Rename.Doc.rnHsDoc' from 'rnHsDocIdentifiersOnly'.
* Updated parser, renamer, typechecker, HIE, and exact-print for new types.
* Added 'HsDocString' TTG instances for 'DocNameI' to 'Haddock.Types'.
* Killed the last module loop between GHC.* and LHS.*.
- Only edges from LHS.* to GHC.Data.FastString now!
Resolves #26971
- - - - -
b7e24044 by mangoiv at 2026-07-04T04:14:56-04:00
ci: retry fetching test metrics
Retry fetching test metrics to make the CI not fail if the services is
temporarily unavailable
- - - - -
4180af3f by Zubin Duggal at 2026-07-04T04:15:38-04:00
Bump semaphore-compat submodule to 2.0.1
This versions includes some cruicial fixes for darwin
- - - - -
242d4317 by sheaf at 2026-07-04T04:16:19-04:00
Remove outdated comment in GHC.Data.ShortText
There was a long comment in GHC.Data.ShortText about a workaround that
was necessary when bootstrapping with GHC 9.2 and below. The actual
logic has since been dropped, but the comment remained. This commit
removes the vestigial comment.
- - - - -
9b714c4c by Zubin Duggal at 2026-07-05T09:40:36+05:30
CorePrep: Don't speculatively evaluate bindings that we have already discovered to be absent
In #25924, we segfault because speculation forces a projection out of a RUBBISH dictionary
(which we generated because it absent).
Solution: Don't speculate on bindings we already know are absent.
Fixes 25924
- - - - -
4a59b3ee by Zubin Duggal at 2026-07-05T09:40:36+05:30
Don't make absent fillers for terminating types
In #25924 we discovered that we could speculatively evaluate an absent filler
for a dictionary, and project a field (a superclass selector) out of it,
resulting in segfaults.
Solution: Never make an absent filler or rubbish literal for a terminating type
like a dictionary. mkAbsentFiller returns Nothing for isTerminatingType, so
worker/wrapper and the specialiser keep the real argument instead.
Some small metric decreases because we do a little less work in the
simplifier now.
Metric Decrease:
T9872a
T9872b
T9872c
TcPlugin_RewritePerf
- - - - -
383ddcd4 by Alan Zimmerman at 2026-07-06T07:08:16-04:00
EPA: Move the 'where' annotation for PatSynBind
This allows us to move it out of the MatchGroup exact print annotation
too
- - - - -
7253248b by Simon Jakobi at 2026-07-07T17:37:29+02:00
GHC.Types.Cpr: add pointers to relevant Notes in other modules
Assisted-by: Claude Fable 5
- - - - -
105 changed files:
- .gitlab/test-metrics.sh
- + changelog.d/fix-absent-dict-projection
- changelog.d/semaphore-v2
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Doc.hs
- − compiler/GHC/Hs/Doc.hs-boot
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Extension.hs
- + compiler/GHC/Hs/Extension/Pass.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/HaddockLex.x
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Doc.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Hole/FitTypes.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Cpr.hs
- compiler/GHC/Types/Literal.hs
- compiler/Language/Haskell/Syntax.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- + compiler/Language/Haskell/Syntax/Doc.hs
- compiler/Language/Haskell/Syntax/Expr.hs-boot
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Type.hs
- − compiler/Language/Haskell/Syntax/Type.hs-boot
- compiler/ghc.cabal.in
- hadrian/src/Settings/Warnings.hs
- libraries/ghc-boot/GHC/Data/ShortText.hs
- libraries/semaphore-compat
- rts/Capability.c
- rts/Capability.h
- rts/Messages.c
- rts/Schedule.c
- rts/Ticker.h
- rts/posix/Ticker.c
- rts/sm/GC.c
- testsuite/driver/testlib.py
- + testsuite/tests/core-to-stg/T25924/B.hs
- + testsuite/tests/core-to-stg/T25924/Main.hs
- + testsuite/tests/core-to-stg/T25924/all.T
- + testsuite/tests/core-to-stg/T25924a.hs
- + testsuite/tests/core-to-stg/T25924a.stdout
- testsuite/tests/core-to-stg/all.T
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/dmdanal/should_compile/T18982.stderr
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/parser/should_compile/all.T
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/showIface/DocsInHiFile1.stdout
- testsuite/tests/showIface/HaddockSpanIssueT24378.stdout
- testsuite/tests/showIface/MagicHashInHaddocks.stdout
- testsuite/tests/showIface/NoExportList.stdout
- testsuite/tests/simplCore/should_compile/T26615.stderr
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Utils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/LexParseRn.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/56a35b2d200dc95ca89d4a05bbd0b9…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/56a35b2d200dc95ca89d4a05bbd0b9…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/sjakobi/udfm-placement] UDFM: restore list fusion for tiny eltsUDFM/udfmToList
by Simon Jakobi (@sjakobi2) 07 Jul '26
by Simon Jakobi (@sjakobi2) 07 Jul '26
07 Jul '26
Simon Jakobi pushed to branch wip/sjakobi/udfm-placement at Glasgow Haskell Compiler / GHC
Commits:
6990e63f by Simon Jakobi at 2026-07-07T17:28:20+02:00
UDFM: restore list fusion for tiny eltsUDFM/udfmToList
The n <= 1 shortcut was out of line, so each singleton call materialised
two cons cells (48 bytes) where the old INLINE eltsUDFM fused with its
consumer (~27 bytes). T13719 walks ~2M singleton instance envs and paid
~40 MB for this: the +0.7% ghc/alloc regression in the CI perf run.
Make eltsUDFM/udfmToList INLINE again, with the small case as a
build-based good producer and the placement/mergesort paths out of line
(elts_nonempty/to_list_nonempty). Fused, a tiny-map readout now allocates
nothing; unfused, one cons cell per element.
T13719 ghc/alloc (locally, perf flavour): -4.25% vs the previous commit,
-3.54% below master's baseline -- udfmToList's small case fusing is a
gain even over master, which never inlined udfmToList at all.
Assisted-by: Claude Fable 5
- - - - -
1 changed file:
- compiler/GHC/Types/Unique/DFM.hs
Changes:
=====================================
compiler/GHC/Types/Unique/DFM.hs
=====================================
@@ -83,7 +83,7 @@ import Data.List (sortBy)
import Data.Function (on)
import GHC.Types.Unique.FM (UniqFM, nonDetUFMToList, ufmToIntMap, unsafeIntMapToUFM)
import GHC.Data.SmallArray
-import GHC.Exts (State#)
+import GHC.Exts (State#, build)
import GHC.ST (ST(..), runST)
import Unsafe.Coerce
import qualified GHC.Data.Word64Set as W
@@ -388,10 +388,17 @@ if you don't need the deterministic order at all, use the nonDet functions.
--
-- See Note [Sorting a UDFM] and Note [Cost of deterministic iteration].
eltsUDFM :: UniqDFM key elt -> [elt]
+{-# INLINE eltsUDFM #-} -- so the small case is a good producer
eltsUDFM (UDFM m ub)
- | M.compareSize m 1 /= GT = map taggedFst (M.elems m)
- | usePlacement m ub = placementSort ub (\_ tv -> tv) m
- | otherwise = map taggedFst (sort_it m)
+ -- n <= 1: any order is trivially tag order, so read straight off the map
+ | M.compareSize m 1 /= GT = build (\c n -> M.foldr (c . taggedFst) n m)
+ | otherwise = elts_nonempty m ub
+
+-- Precondition: m is non-empty
+elts_nonempty :: M.Word64Map (TaggedVal elt) -> Int -> [elt]
+elts_nonempty m ub
+ | usePlacement m ub = placementSort ub (\_ tv -> tv) m
+ | otherwise = map taggedFst (sort_it m)
sort_it :: M.Word64Map (TaggedVal elt) -> [TaggedVal elt]
sort_it m = sortBy (compare `on` taggedSnd) (M.elems m)
@@ -497,11 +504,18 @@ udfmRestrictKeysSet (UDFM val_set i) set =
-- as this already incurs most of the cost of returning the full list.
-- See Note [Cost of deterministic iteration].
udfmToList :: UniqDFM key elt -> [(Unique, elt)]
+{-# INLINE udfmToList #-} -- so the small case is a good producer
udfmToList (UDFM m ub)
+ -- n <= 1: any order is trivially tag order, so read straight off the map
| M.compareSize m 1 /= GT =
- [ (mkUniqueGrimily k, taggedFst v) | (k, v) <- M.toList m ]
-
- -- Unlike eltsUDFM, this allocates a fresh TaggedVal + pair per element
+ build (\c n ->
+ M.foldrWithKey (\k tv r -> c (mkUniqueGrimily k, taggedFst tv) r) n m)
+ | otherwise = to_list_nonempty m ub
+
+-- Precondition: m is non-empty
+to_list_nonempty :: M.Word64Map (TaggedVal elt) -> Int -> [(Unique, elt)]
+to_list_nonempty m ub
+ -- Unlike elts_nonempty, this allocates a fresh TaggedVal + pair per element
-- (they make up the result).
| usePlacement m ub = placementSort ub
(\k tv -> TaggedVal (mkUniqueGrimily k, taggedFst tv) (taggedSnd tv)) m
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6990e63f1e7b454e5a7d29355670831…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6990e63f1e7b454e5a7d29355670831…
You're receiving this email because of your account on gitlab.haskell.org.
1
0