
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: hadrian: bump Stackage snapshot to LTS 24.2 / GHC 9.10.2
by Marge Bot (@marge-bot) 05 Aug '25
by Marge Bot (@marge-bot) 05 Aug '25
05 Aug '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
57d3b4a8 by Andrew Lelechenko at 2025-08-05T18:36:31-04:00
hadrian: bump Stackage snapshot to LTS 24.2 / GHC 9.10.2
In line with #25693 we should use GHC 9.10 as a boot compiler,
while Hadrian stack.yaml was stuck on GHC 9.6.
- - - - -
c2a78cea by Peng Fan at 2025-08-05T18:37:27-04:00
NCG/LA64: implement atomic write with finer-grained DBAR hints
Signed-off-by: Peng Fan <fanpeng(a)loongson.cn>
- - - - -
6482e6b1 by Andrew Lelechenko at 2025-08-05T19:12:09-04:00
Bump submodule text to 2.1.3
- - - - -
084314bf by Nikolaos Chatzikonstantinou at 2025-08-05T19:12:12-04:00
docs: fix internal import in getopt examples
This external-facing doc example shouldn't mention GHC internals when
using 'fromMaybe'.
- - - - -
5 changed files:
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
- hadrian/stack.yaml
- hadrian/stack.yaml.lock
- libraries/base/src/System/Console/GetOpt.hs
- libraries/text
Changes:
=====================================
compiler/GHC/CmmToAsm/LA64/CodeGen.hs
=====================================
@@ -1972,9 +1972,17 @@ genCCall target dest_regs arg_regs = do
(val, fmt_val, code_val) <- getSomeReg val_reg
let instrs = case ord of
MemOrderRelaxed -> unitOL $ ann moDescr (ST fmt_val (OpReg w val) (OpAddr $ AddrReg p))
- -- implement with AMSWAPDB
- MemOrderRelease -> unitOL $ ann moDescr (AMSWAPDB fmt_val (OpReg w zeroReg) (OpReg w val) (OpReg w p))
- MemOrderSeqCst -> unitOL $ ann moDescr (AMSWAPDB fmt_val (OpReg w zeroReg) (OpReg w val) (OpReg w p))
+ -- AMSWAP_DB* insns implentment a fully functional synchronization barrier, like DBAR 0x0.
+ -- This is terrible. And AMSWAPDB only supports ISA version greater than LA64V1_0. So,
+ -- implement with DBAR
+ MemOrderRelease -> toOL [
+ ann moDescr (DBAR HintRelease),
+ ST fmt_val (OpReg w val) (OpAddr $ AddrReg p)
+ ]
+ MemOrderSeqCst -> toOL [
+ ann moDescr (DBAR HintSeqcst),
+ ST fmt_val (OpReg w val) (OpAddr $ AddrReg p)
+ ]
_ -> panic $ "Unexpected MemOrderAcquire on an AtomicWrite" ++ show mo
moDescr = (text . show) mo
code =
=====================================
hadrian/stack.yaml
=====================================
@@ -1,6 +1,6 @@
-# GHC's configure script reports that GHC versions 9.6 and greater are required
+# GHC's configure script reports that GHC versions 9.10 and greater are required
# to build GHC from source.
-resolver: lts-22.44 # GHC 9.6.7
+resolver: lts-24.2 # GHC 9.10.2
packages:
- '.'
=====================================
hadrian/stack.yaml.lock
=====================================
@@ -1,7 +1,7 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
-# https://docs.haskellstack.org/en/stable/lock_files
+# https://docs.haskellstack.org/en/stable/topics/lock_files
packages:
- completed:
@@ -40,9 +40,9 @@ packages:
original:
hackage: filepath-1.4.300.2
- completed:
- hackage: process-1.6.25.0@sha256:092ab61596e914d21983aa2e9206a74c4faa38a5a636446b5c954305821cb496,2749
+ hackage: process-1.6.25.0@sha256:9a0b2ef8096517fa0e0c7a5e9a5c2ae5744ed824c3331005f9408245810df345,2640
pantry-tree:
- sha256: bdab416d3c454ad716d4fab1ced490cc75330658c1c7c66a0b6f4b3e5125017b
+ sha256: 9c7927cd4d7f2f4c64251256eb6904800b3922fa5c5424c60f0e08441693e12b
size: 1790
original:
hackage: process-1.6.25.0
@@ -55,7 +55,7 @@ packages:
hackage: unix-2.8.5.1
snapshots:
- completed:
- sha256: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9
- size: 721141
- url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/mast…
- original: lts-22.44
+ sha256: cd28bd74375205718f1d5fa221730a9c17a203059708b1eb95f4b20d68bf82d9
+ size: 724943
+ url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/mast…
+ original: lts-24.2
=====================================
libraries/base/src/System/Console/GetOpt.hs
=====================================
@@ -315,7 +315,7 @@ arguments:
> module Opts1 where
>
> import System.Console.GetOpt
-> import GHC.Internal.Data.Maybe ( fromMaybe )
+> import Data.Maybe ( fromMaybe )
>
> data Flag
> = Verbose | Version
@@ -356,7 +356,7 @@ A different approach is to group the option values in a record of type
> module Opts2 where
>
> import System.Console.GetOpt
-> import GHC.Internal.Data.Maybe ( fromMaybe )
+> import Data.Maybe ( fromMaybe )
>
> data Options = Options
> { optVerbose :: Bool
=====================================
libraries/text
=====================================
@@ -1 +1 @@
-Subproject commit f1a05704a153ecc6a9bd45f6df8dd99820e74a2d
+Subproject commit 5f343f668f421bfb30cead594e52d0ac6206ff67
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8b919f5892f7d4033b6d62d3ec099c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8b919f5892f7d4033b6d62d3ec099c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/warning-for-last-and-init] 65 commits: Specialise: Improve specialisation by refactoring interestingDict
by Bodigrim (@Bodigrim) 05 Aug '25
by Bodigrim (@Bodigrim) 05 Aug '25
05 Aug '25
Bodigrim pushed to branch wip/warning-for-last-and-init at Glasgow Haskell Compiler / GHC
Commits:
f707bab4 by Andreas Klebinger at 2025-07-12T14:56:16+01:00
Specialise: Improve specialisation by refactoring interestingDict
This MR addresses #26051, which concerns missed type-class specialisation.
The main payload of the MR is to completely refactor the key function
`interestingDict` in GHC.Core.Opt.Specialise
The main change is that we now also look at the structure of the
dictionary we consider specializing on, rather than only the type.
See the big `Note [Interesting dictionary arguments]`
- - - - -
ca7a9d42 by Simon Peyton Jones at 2025-07-12T14:56:16+01:00
Treat tuple dictionaries uniformly; don't unbox them
See `Note [Do not unbox class dictionaries]` in DmdAnal.hs,
sep (DNB1).
This MR reverses the plan in #23398, which suggested a special case to
unbox tuple dictionaries in worker/wrapper. But:
- This was the cause of a pile of complexity in the specialiser (#26158)
- Even with that complexity, specialision was still bad, very bad
See https://gitlab.haskell.org/ghc/ghc/-/issues/19747#note_626297
And it's entirely unnecessary! Specialision works fine without
unboxing tuple dictionaries.
- - - - -
be7296c9 by Andreas Klebinger at 2025-07-12T14:56:16+01:00
Remove complex special case from the type-class specialiser
There was a pretty tricky special case in Specialise which is no
longer necessary.
* Historical Note [Floating dictionaries out of cases]
* #26158
* #19747 https://gitlab.haskell.org/ghc/ghc/-/issues/19747#note_626297
This MR removes it. Hooray.
- - - - -
4acf3a86 by Ben Gamari at 2025-07-15T05:46:32-04:00
configure: bump version to 9.15
- - - - -
45efaf71 by Teo Camarasu at 2025-07-15T05:47:13-04:00
rts/nonmovingGC: remove n_free
We remove the nonmovingHeap.n_free variable.
We wanted this to track the length of nonmovingHeap.free.
But this isn't possible to do atomically.
When this isn't accurate we can get a segfault by going past the end of
the list.
Instead, we just count the length of the list when we grab it in
nonmovingPruneFreeSegment.
Resolves #26186
- - - - -
c635f164 by Ben Gamari at 2025-07-15T14:05:54-04:00
configure: Drop probing of ld.gold
As noted in #25716, `gold` has been dropped from binutils-2.44.
Fixes #25716.
Metric Increase:
size_hello_artifact_gzip
size_hello_unicode_gzip
ghc_prim_so
- - - - -
637bb538 by Ben Gamari at 2025-07-15T14:05:55-04:00
testsuite/recomp015: Ignore stderr
This is necessary since ld.bfd complains
that we don't have a .note.GNU-stack section,
potentially resulting in an executable stack.
- - - - -
d3cd4ec8 by Wen Kokke at 2025-07-15T14:06:39-04:00
Fix documentation for heap profile ID
- - - - -
73082769 by Ben Gamari at 2025-07-15T16:56:38-04:00
Bump win32-tarballs to v0.9
- - - - -
3b63b254 by Ben Gamari at 2025-07-15T16:56:39-04:00
rts/LoadArchive: Handle null terminated string tables
As of `llvm-ar` now emits filename tables terminated with null
characters instead of the usual POSIX `/\n` sequence.
Fixes #26150.
- - - - -
195f6527 by Tamar Christina at 2025-07-15T16:56:39-04:00
rts: rename label so name doesn't conflict with param
- - - - -
63373b95 by Tamar Christina at 2025-07-15T16:56:39-04:00
rts: Handle API set symbol versioning conflicts
- - - - -
48e9aa3e by Tamar Christina at 2025-07-15T16:56:39-04:00
rts: Mark API set symbols as HIDDEN and correct symbol type
- - - - -
959e827a by Tamar Christina at 2025-07-15T16:56:39-04:00
rts: Implement WEAK EXTERNAL undef redirection by target symbol name
- - - - -
65f19293 by Ben Gamari at 2025-07-15T16:56:39-04:00
rts/LoadArchive: Handle string table entries terminated with /
llvm-ar appears to terminate string table entries with `/\n` [1]. This
matters in the case of thin archives, since the filename is used. In the
past this worked since `llvm-ar` would produce archives with "small"
filenames when possible. However, now it appears to always use the
string table.
[1] https://github.com/llvm/llvm-project/blob/bfb686bb5ba503e9386dc899e1ebbe248…
- - - - -
9cbb3ef5 by Ben Gamari at 2025-07-15T16:56:39-04:00
testsuite: Mark T12497 as fixed
Thanks to the LLVM toolchain update.
Closes #22694.
- - - - -
2854407e by Ben Gamari at 2025-07-15T16:56:39-04:00
testsuite: Accept new output of T11223_link_order_a_b_2_fail on Windows
The archive member number changed due to the fact that llvm-ar now uses a
string table.
- - - - -
28439593 by Ben Gamari at 2025-07-15T16:56:39-04:00
rts/linker/PEi386: Implement IMAGE_REL_AMD64_SECREL
This appears to now be used by libc++ as distributed by msys2.
- - - - -
2b053755 by Tamar Christina at 2025-07-15T16:56:39-04:00
rts: Cleanup merge resolution residue in lookupSymbolInDLL_PEi386 and make safe without dependent
- - - - -
e8acd2e7 by Wen Kokke at 2025-07-16T08:37:04-04:00
Remove the `profile_id` parameter from various RTS functions.
Various RTS functions took a `profile_id` parameter, intended to be used to
distinguish parallel heap profile breakdowns (e.g., `-hT` and `-hi`). However,
this feature was never implemented and the `profile_id` parameter was set to 0
throughout the RTS. This commit removes the parameter but leaves the hardcoded
profile ID in the functions that emit the encoded eventlog events as to not
change the protocol.
The affected functions are `traceHeapProfBegin`, `postHeapProfBegin`,
`traceHeapProfSampleString`, `postHeapProfSampleString`,
`traceHeapProfSampleCostCentre`, and `postHeapProfSampleCostCentre`.
- - - - -
76d392a2 by Wen Kokke at 2025-07-16T08:37:04-04:00
Make `traceHeapProfBegin` an init event.
- - - - -
bbaa44a7 by Peng Fan at 2025-07-16T16:50:42-04:00
NCG/LA64: Support finer-grained DBAR hints
For LA664 and newer uarchs, they have made finer granularity hints
available:
Bit4: ordering or completion (0: completion, 1: ordering)
Bit3: barrier for previous read (0: true, 1: false)
Bit2: barrier for previous write (0: true, 1: false)
Bit1: barrier for succeeding read (0: true, 1: false)
Bit0: barrier for succeeding write (0: true, 1: false)
And not affect the existing models because other hints are treated
as 'dbar 0' there.
- - - - -
7da86e16 by Andreas Klebinger at 2025-07-16T16:51:25-04:00
Disable -fprof-late-overloaded-calls for join points.
Currently GHC considers cost centres as destructive to
join contexts. Or in other words this is not considered valid:
join f x = ...
in
... -> scc<tick> jmp
This makes the functionality of `-fprof-late-overloaded-calls` not feasible
for join points in general. We used to try to work around this by putting the
ticks on the rhs of the join point rather than around the jump. However beyond
the loss of accuracy this was broken for recursive join points as we ended up
with something like:
rec-join f x = scc<tick> ... jmp f x
Which similarly is not valid as the tick once again destroys the tail call.
One might think we could limit ourselves to non-recursive tail calls and do
something clever like:
join f x = scc<tick> ...
in ... jmp f x
And sometimes this works! But sometimes the full rhs would look something like:
join g x = ....
join f x = scc<tick> ... -> jmp g x
Which, would again no longer be valid. I believe in the long run we can make
cost centre ticks non-destructive to join points. Or we could keep track of
where we are/are not allowed to insert a cost centre. But in the short term I will
simply disable the annotation of join calls under this flag.
- - - - -
7ee22fd5 by ARATA Mizuki at 2025-07-17T06:05:30-04:00
x86 NCG: Better lowering for shuffleFloatX4# and shuffleDoubleX2#
The new implementation
* make use of specialized instructions like (V)UNPCK{L,H}{PS,PD}, and
* do not require -mavx.
Close #26096
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
- - - - -
c6cd2da1 by Jappie Klooster at 2025-07-17T06:06:20-04:00
Update interact docs to explain about buffering
We need to tell the user to set to the
appropriate buffer format.
Otherwise, this function may get randomly stuck,
or just behave confusingly.
issue: https://gitlab.haskell.org/ghc/ghc/-/issues/26131
NB, I'm running this with cabal *NOT* ghci. ghci messes with buffering anyway.
```haskell
interaction :: String -> String
interaction "jappie" = "hi"
interaction "jakob" = "hello"
interaction x = "unkown input: " <> x
main :: IO ()
main = interact interaction
```
so in my input (prefixed by `>`) I get:
```
> jappie
unkown input: jappie
```
we confirmed later this was due to lack of \n matching.
Anyway movnig on to more unexpected stuff:
```haskell
main :: IO ()
main = do
interact (concatMap interaction . lines)
```
get's stuck forever.
actually `^D` (ctrl+d) unstucks it and runs all input as expected.
for example you can get:
```
> sdfkds
> fakdsf
unkown input: sdfkdsunkown input: fakdsf
```
This program works!
```haskell
interaction :: String -> String
interaction "jappie" = "hi \n"
interaction "jakob" = "hello \n"
interaction x = "unkown input: " <> x <> "\n"
main :: IO ()
main = do
interact (concatMap interaction . lines)
```
the reason is that linebuffering is set for both in and output by default.
so lines eats the input lines, and all the \n postfixes make sure the buffer
is put out.
- - - - -
9fa590a6 by Zubin Duggal at 2025-07-17T06:07:03-04:00
fetch_gitlab: Ensure we copy users_guide.pdf and Haddock.pdf to the release docs directory
Fixes #24093
- - - - -
cc650b4b by Andrew Lelechenko at 2025-07-17T12:30:24-04:00
Add Data.List.NonEmpty.mapMaybe
As per https://github.com/haskell/core-libraries-committee/issues/337
- - - - -
360fa82c by Duncan Coutts at 2025-07-17T12:31:14-04:00
base: Deprecate GHC.Weak.Finalize.runFinalizerBatch
https://github.com/haskell/core-libraries-committee/issues/342
- - - - -
f4e8466c by Alan Zimmerman at 2025-07-17T12:31:55-04:00
EPA: Update exact printing based on GHC 9.14 tests
As a result of migrating the GHC ghc-9.14 branch tests to
ghc-exactprint in
https://github.com/alanz/ghc-exactprint/tree/ghc-9.14, a couple of
discrepancies were picked up
- The opening paren for a DefaultDecl was printed in the wrong place
- The import declaration level specifiers were not printed.
This commit adds those fixes, and some tests for them.
The tests brought to light that the ImportDecl ppr instance had not
been updated for level specifiers, so it updates that too.
- - - - -
8b731e3c by Matthew Pickering at 2025-07-21T13:36:43-04:00
level imports: Fix infinite loop with cyclic module imports
I didn't anticipate that downsweep would run before we checked for
cyclic imports. Therefore we need to use the reachability function which
handles cyclic graphs.
Fixes #26087
- - - - -
d751a9f1 by Pierre Thierry at 2025-07-21T13:37:28-04:00
Fix documentation about deriving from generics
- - - - -
f8d9d016 by Andrew Lelechenko at 2025-07-22T21:13:28-04:00
Fix issues with toRational for types capable to represent infinite and not-a-number values
This commit fixes all of the following pitfalls:
> toRational (read "Infinity" :: Double)
179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216 % 1
> toRational (read "NaN" :: Double)
269653970229347386159395778618353710042696546841345985910145121736599013708251444699062715983611304031680170819807090036488184653221624933739271145959211186566651840137298227914453329401869141179179624428127508653257226023513694322210869665811240855745025766026879447359920868907719574457253034494436336205824 % 1
> realToFrac (read "NaN" :: Double) -- With -O0
Infinity
> realToFrac (read "NaN" :: Double) -- With -O1
NaN
> realToFrac (read "NaN" :: Double) :: CDouble
Infinity
> realToFrac (read "NaN" :: CDouble) :: Double
Infinity
Implements https://github.com/haskell/core-libraries-committee/issues/338
- - - - -
5dabc718 by Zubin Duggal at 2025-07-22T21:14:10-04:00
haddock: Don't warn about missing link destinations for derived names.
Fixes #26114
- - - - -
9c3a0937 by Matthew Pickering at 2025-07-22T21:14:52-04:00
template haskell: use a precise condition when implicitly lifting
Implicit lifting corrects a level error by replacing references to `x`
with `$(lift x)`, therefore you can use a level `n` binding at level `n
+ 1`, if it can be lifted.
Therefore, we now have a precise check that the use level is 1 more than
the bind level.
Before this bug was not observable as you only had 0 and 1 contexts but
it is easily evident when using explicit level imports.
Fixes #26088
- - - - -
5144b22f by Andreas Klebinger at 2025-07-22T21:15:34-04:00
Add since tag and more docs for do-clever-arg-eta-expansion
Fixes #26113
- - - - -
c865623b by Andreas Klebinger at 2025-07-22T21:15:34-04:00
Add since tag for -fexpose-overloaded-unfoldings
Fixes #26112
- - - - -
49a44ab7 by Simon Hengel at 2025-07-23T17:59:55+07:00
Refactor GHC.Driver.Errors.printMessages
- - - - -
84711c39 by Simon Hengel at 2025-07-23T18:27:34+07:00
Respect `-fdiagnostics-as-json` for error messages from pre-processors
(fixes #25480)
- - - - -
d046b5ab by Simon Hengel at 2025-07-24T06:12:05-04:00
Include the rendered message in -fdiagnostics-as-json output
This implements #26173.
- - - - -
d2b89603 by Ben Gamari at 2025-07-24T06:12:47-04:00
rts/Interpreter: Factor out ctoi tuple info tables into data
Instead of a massive case let's put this into data which we can reuse
elsewhere.
- - - - -
4bc78496 by Sebastian Graf at 2025-07-24T16:19:34-04:00
CprAnal: Detect recursive newtypes (#25944)
While `cprTransformDataConWork` handles recursive data con workers, it
did not detect the case when a newtype is responsible for the recursion.
This is now detected in the `Cast` case of `cprAnal`.
The same reproducer made it clear that `isRecDataCon` lacked congruent
handling for `AppTy` and `CastTy`, now fixed.
Furthermore, the new repro case T25944 triggered this bug via an
infinite loop in `cprFix`, caused by the infelicity in `isRecDataCon`.
While it should be much less likely to trigger such an infinite loop now
that `isRecDataCon` has been fixed, I made sure to abort the loop after
10 iterations and emitting a warning instead.
Fixes #25944.
- - - - -
0a583689 by Sylvain Henry at 2025-07-24T16:20:26-04:00
STM: don't create a transaction in the rhs of catchRetry# (#26028)
We don't need to create a transaction for the rhs of (catchRetry#)
because contrary to the lhs we don't need to abort it on retry. Moreover
it is particularly harmful if we have code such as (#26028):
let cN = readTVar vN >> retry
tree = c1 `orElse` (c2 `orElse` (c3 `orElse` ...))
atomically tree
Because it will stack transactions for the rhss and the read-sets of all
the transactions will be iteratively merged in O(n^2) after the
execution of the most nested retry.
- - - - -
a49eca26 by Simon Peyton Jones at 2025-07-25T09:49:58+01:00
Renaming around predicate types
.. we were (as it turned out) abstracting over
type-class selectors in SPECIALISATION rules!
Wibble isEqPred
- - - - -
f80375dd by Simon Peyton Jones at 2025-07-25T09:49:58+01:00
Refactor of Specialise.hs
This patch just tidies up `specHeader` a bit, removing one
of its many results, and adding some comments.
No change in behaviour.
Also add a few more `HasDebugCallStack` contexts.
- - - - -
1bd12371 by Simon Peyton Jones at 2025-07-25T09:49:58+01:00
Improve treatment of SPECIALISE pragmas -- again!
This MR does another major refactor of the way that SPECIALISE
pragmas work, to fix #26115, #26116, #26117.
* We now /always/ solve forall-constraints in an all-or-nothing way.
See Note [Solving a Wanted forall-constraint] in GHC.Tc.Solver.Solve
This means we might have unsolved quantified constraints, which need
to be reported. See `inert_insts` in `getUnsolvedInerts`.
* I refactored the short-cut solver for type classes to work by
recursively calling the solver rather than by having a little baby
solver that kept being not clever enough.
See Note [Shortcut solving] in GHC.Tc.Solver.Dict
* I totally rewrote the desugaring of SPECIALISE pragmas, again.
The new story is in Note [Desugaring new-form SPECIALISE pragmas]
in GHC.HsToCore.Binds
Both old-form and new-form SPECIALISE pragmas now route through the same
function `dsSpec_help`. The tricky function `decomposeRuleLhs` is now used only
for user-written RULES, not for SPECIALISE pragmas.
* I improved `solveOneFromTheOther` to account for rewriter sets. Previously
it would solve a non-rewritten dict from a rewritten one. For equalities
we were already dealing with this, in
Some incidental refactoring
* A small refactor: `ebv_tcvs` in `EvBindsBar` now has a list of coercions, rather
than a set of tyvars. We just delay taking the free vars.
* GHC.Core.FVs.exprFVs now returns /all/ free vars.
Use `exprLocalFVs` for Local vars.
Reason: I wanted another variant for /evidence/ variables.
* Ues `EvId` in preference to `EvVar`. (Evidence variables are always Ids.)
Rename `isEvVar` to `isEvId`.
* I moved `inert_safehask` out of `InertCans` and into `InertSet` where it
more properly belongs.
Compiler-perf changes:
* There was a palpable bug (#26117) which this MR fixes in
newWantedEvVar, which bypassed all the subtle overlapping-Given
and shortcutting logic. (See the new `newWantedEvVar`.) Fixing this
but leads to extra dictionary bindings; they are optimised away quickly
but they made CoOpt_Read allocate 3.6% more.
* Hpapily T15164 improves.
* The net compiler-allocation change is 0.0%
Metric Decrease:
T15164
Metric Increase:
CoOpt_Read
T12425
- - - - -
953fd8f1 by Simon Peyton Jones at 2025-07-25T09:49:58+01:00
Solve forall-constraints immediately, or not at all
This MR refactors the constraint solver to solve forall-constraints immediately,
rather than emitting an implication constraint to be solved later.
The most immediate motivation was that when solving quantified constraints
in SPECIALISE pragmas, we really really don't want to leave behind half-
solved implications. Also it's in tune with the approach of the new
short-cut solver, which recursively invokes the solver.
It /also/ saves quite a bit of plumbing; e.g
- The `wl_implics` field of `WorkList` is gone,
- The types of `solveSimpleWanteds` and friends are simplified.
- An EvFun contains binding, rather than an EvBindsVar ref-cell that
will in the future contain bindings. That makes `evVarsOfTerm`
simpler. Much nicer.
It also improves error messages a bit.
All described in Note [Solving a Wanted forall-constraint] in
GHC.Tc.Solver.Solve.
One tiresome point: in the tricky case of `inferConstraintsCoerceBased`
we make a forall-constraint. This we /do/ want to partially solve, so
we can infer a suitable context. (I'd be quite happy to force the user to
write a context, bt I don't want to change behavior.) So we want to generate
an /implication/ constraint in `emitPredSpecConstraints` rather than a
/forall-constraint/ as we were doing before. Discussed in (WFA3) of
the above Note.
Incidental refactoring
* `GHC.Tc.Deriv.Infer.inferConstraints` was consulting the state monad for
the DerivEnv that the caller had just consulted. Nicer to pass it as an
argument I think, so I have done that. No change in behaviour.
- - - - -
6921ab42 by Simon Peyton Jones at 2025-07-25T09:49:58+01:00
Remove duplicated code in Ast.hs for evTermFreeVars
This is just a tidy up.
- - - - -
1165f587 by Simon Peyton Jones at 2025-07-25T09:49:58+01:00
Small tc-tracing changes only
- - - - -
0776ffe0 by Simon Hengel at 2025-07-26T04:54:20-04:00
Respect `-fdiagnostics-as-json` for core diagnostics (see #24113)
- - - - -
cc1116e0 by Andrew Lelechenko at 2025-07-26T04:55:01-04:00
docs: add since pragma to Data.List.NonEmpty.mapMaybe
- - - - -
ee2dc248 by Simon Hengel at 2025-07-31T06:25:35-04:00
Update comments on `OptKind` to reflect the code reality
- - - - -
b029633a by Wen Kokke at 2025-07-31T06:26:21-04:00
rts: Disable --eventlog-flush-interval unless compiled with -threaded.
This commit fixes issue #26222:
Using --eventlog-flush-interval with the non-threaded RTS leads to eventlog corruption.
https://gitlab.haskell.org/ghc/ghc/-/issues/26222
This commit makes three changes when code is compiled against the non-threaded RTS:
1. It disables the --eventlog-flush-interval flag.
2. It disables the documentation for the --eventlog-flush-interval flag.
3. It disables the relevant state from RtsConfig and code from Timer.
4. It updates the entry for --eventlog-flush-interval in the users guide.
- - - - -
31159f1d by Wen Kokke at 2025-07-31T06:26:21-04:00
rts: Split T20006 into tests with and without -threaded
- - - - -
618687ef by Simon Hengel at 2025-07-31T06:27:03-04:00
docs/users_guide/win32-dlls.rst: Remove references to `readline`
- - - - -
083e40f1 by Rodrigo Mesquita at 2025-08-01T04:38:23-04:00
debugger: Uniquely identify breakpoints by internal id
Since b85b11994e0130ff2401dd4bbdf52330e0bcf776 (support inlining
breakpoints), a breakpoint has been identified at runtime by *two* pairs
of <module,index>.
- The first, aka a 'BreakpointId', uniquely identifies a breakpoint in
the source of a module by using the Tick index. A Tick index can index
into ModBreaks.modBreaks_xxx to fetch source-level information about
where that tick originated.
- When a user specifies e.g. a line breakpoint using :break, we'll reverse
engineer what a Tick index for that line
- We update the `BreakArray` of that module (got from the
LoaderState) at that tick index to `breakOn`.
- A BCO we can stop at is headed by a BRK_FUN instruction. This
instruction stores in an operand the `tick index` it is associated
to. We look it up in the associated `BreakArray` (also an operand)
and check wheter it was set to `breakOn`.
- The second, aka the `ibi_info_mod` + `ibi_info_ix` of the
`InternalBreakpointId`, uniquely index into the `imodBreaks_breakInfo`
-- the information we gathered during code generation about the
existing breakpoint *ocurrences*.
- Note that with optimisation there may be many occurrences of the
same source-tick-breakpoint across different modules. The
`ibi_info_ix` is unique per occurrence, but the `bi_tick_ix` may be
shared. See Note [Breakpoint identifiers] about this.
- Note that besides the tick ids, info ids are also stored in
`BRK_FUN` so the break handler can refer to the associated
`CgBreakInfo`.
In light of that, the driving changes come from the desire to have the
info_id uniquely identify the breakpoint at runtime, and the source tick
id being derived from it:
- An InternalBreakpointId should uniquely identify a breakpoint just
from the code-generation identifiers of `ibi_info_ix` and `ibi_info_mod`.
So we drop `ibi_tick_mod` and `ibi_tick_ix`.
- A BRK_FUN instruction need only record the "internal breakpoint id",
not the tick-level id.
So we drop the tick mod and tick index operands.
- A BreakArray should be indexed by InternalBreakpointId rather than
BreakpointId
That means we need to do some more work when setting a breakpoint.
Specifically, we need to figure out the internal ids (occurrences of a
breakpoint) from the source-level BreakpointId we want to set the
breakpoint at (recall :break refers to breaks at the source level).
Besides this change being an improvement to the handling of breakpoints
(it's clearer to have a single unique identifier than two competing
ones), it unlocks the possibility of generating "internal" breakpoints
during Cg (needed for #26042).
It should also be easier to introduce multi-threaded-aware `BreakArrays`
following this change (needed for #26064).
Se also the new Note [ModBreaks vs InternalModBreaks]
On i386-linux:
-------------------------
Metric Decrease:
interpreter_steplocal
-------------------------
- - - - -
bf03bbaa by Simon Hengel at 2025-08-01T04:39:05-04:00
Don't use MCDiagnostic for `ghcExit`
This changes the error message of `ghcExit` from
```
<no location info>: error:
Compilation had errors
```
to
```
Compilation had errors
```
- - - - -
a889ec75 by Simon Hengel at 2025-08-01T04:39:05-04:00
Respect `-fdiagnostics-as-json` for driver diagnostics (see #24113)
- - - - -
81577fe7 by Ben Gamari at 2025-08-02T04:29:39-04:00
configure: Allow override of CrossCompiling
As noted in #26236, the current inference logic is a bit simplistic. In
particular, there are many cases (e.g. building for a new libc) where
the target and host triples may differ yet we are still able to run the
produced artifacts as native code.
Closes #26236.
- - - - -
01136779 by Andreas Klebinger at 2025-08-02T04:30:20-04:00
rts: Support COFF BigObj files in archives.
- - - - -
1f9e4f54 by Stephen Morgan at 2025-08-03T15:14:08+10:00
refactor: Modify Data.List.sortOn to use (>) instead of compare. (#26184)
This lets a more efficient (>) operation be used if one exists.
This is technically a breaking change for malformed Ord instances, where
x > y is not equivalent to compare x y == GT.
Discussed by the CLC in issue #332: https://github.com/haskell/core-libraries-committee/issues/332
- - - - -
4f6bc9cf by fendor at 2025-08-04T17:50:06-04:00
Revert "base: Expose Backtraces constructor and fields"
This reverts commit 17db44c5b32fff82ea988fa4f1a233d1a27bdf57.
- - - - -
bcdec657 by Zubin Duggal at 2025-08-05T10:37:29+05:30
compiler: Export a version of `newNameCache` that is not prone to footguns.
`newNameCache` must be initialized with both a non-"reserved" unique tag, as well
as a list of known key names. Failing to do so results in hard to debug unique conflicts.
It is difficult for API users to tell which unique tags are safe to use. So instead of leaving
this up to the user to decide, we now export a version of `newNameCache` which uses a guaranteed
non-reserved unique tag. In fact, this is now the way the unique tag is initialized for all invocations
of the compiler.
The original version of `newNameCache` is now exported as `newNameCache'` for advanced users.
We also deprecate `initNameCache` as it is also prone to footguns and is completely subsumed in
functionality by `newNameCache` and `newNameCache'`.
Fixes #26135 and #26055
- - - - -
57d3b4a8 by Andrew Lelechenko at 2025-08-05T18:36:31-04:00
hadrian: bump Stackage snapshot to LTS 24.2 / GHC 9.10.2
In line with #25693 we should use GHC 9.10 as a boot compiler,
while Hadrian stack.yaml was stuck on GHC 9.6.
- - - - -
c2a78cea by Peng Fan at 2025-08-05T18:37:27-04:00
NCG/LA64: implement atomic write with finer-grained DBAR hints
Signed-off-by: Peng Fan <fanpeng(a)loongson.cn>
- - - - -
d79bc713 by Mike Pilgrem at 2025-08-05T23:40:41+01:00
Re CLC issue 292 Warn GHC.Internal.List.{init,last} are partial
Also corrects the warning for `tail` to refer to `Data.List.uncons` (like the existing warning for `head`).
In module `Settings.Warnings`, applies `-Wno-unrecognised-warning-flags` `-Wno-x-partial` to the `Cabal`, `filepath`, `hsc2hs`, `hpc`, `parsec`, `text` and `time` packages (outside GHC's repository).
- - - - -
241 changed files:
- .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
- compiler/GHC/CmmToAsm/LA64/Instr.hs
- compiler/GHC/CmmToAsm/LA64/Ppr.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/FVs.hs
- compiler/GHC/Core/LateCC/OverloadedCalls.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CprAnal.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/Monad.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/Subst.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/Unfold/Make.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Driver/CmdLine.hs
- compiler/GHC/Driver/Errors.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Session/Units.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Breakpoints.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/HsToCore/Pmc/Solver/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser.y
- compiler/GHC/Prelude/Basic.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Runtime/Debugger/Breakpoints.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/SysTools/Process.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Infer.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Rewrite.hs
- compiler/GHC/Tc/Solver/Solve.hs
- + compiler/GHC/Tc/Solver/Solve.hs-boot
- compiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Types/Name/Cache.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Utils/Error.hs
- compiler/GHC/Utils/Logger.hs
- configure.ac
- docs/users_guide/9.14.1-notes.rst
- + docs/users_guide/diagnostics-as-json-schema-1_2.json
- docs/users_guide/eventlog-formats.rst
- docs/users_guide/profiling.rst
- docs/users_guide/runtime_control.rst
- docs/users_guide/using-optimisation.rst
- docs/users_guide/using.rst
- docs/users_guide/win32-dlls.rst
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Monad.hs
- ghc/Main.hs
- hadrian/src/Settings/Warnings.hs
- hadrian/stack.yaml
- hadrian/stack.yaml.lock
- libraries/Cabal
- libraries/base/changelog.md
- libraries/base/src/Control/Exception/Backtrace.hs
- libraries/base/src/Data/List/NonEmpty.hs
- libraries/base/src/GHC/Generics.hs
- libraries/base/src/GHC/Weak/Finalize.hs
- libraries/filepath
- libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
- libraries/ghc-internal/src/GHC/Internal/Data/OldList.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/List.hs
- libraries/ghc-internal/src/GHC/Internal/Real.hs
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs
- libraries/ghci/GHCi/Debugger.hs
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/Run.hs
- libraries/template-haskell/vendored-filepath/System/FilePath/Posix.hs
- libraries/template-haskell/vendored-filepath/System/FilePath/Windows.hs
- m4/find_ld.m4
- mk/get-win32-tarballs.py
- rts/Disassembler.c
- rts/Exception.cmm
- rts/Interpreter.c
- rts/PrimOps.cmm
- rts/ProfHeap.c
- rts/RaiseAsync.c
- rts/RetainerSet.c
- rts/RtsFlags.c
- rts/STM.c
- rts/Timer.c
- rts/Trace.c
- rts/Trace.h
- rts/eventlog/EventLog.c
- rts/eventlog/EventLog.h
- rts/include/rts/Flags.h
- rts/linker/LoadArchive.c
- rts/linker/PEi386.c
- rts/sm/NonMoving.c
- rts/sm/NonMoving.h
- rts/sm/NonMovingAllocate.c
- rts/sm/Sanity.c
- testsuite/tests/corelint/T21115b.stderr
- + testsuite/tests/cpranal/sigs/T25944.hs
- + testsuite/tests/cpranal/sigs/T25944.stderr
- testsuite/tests/cpranal/sigs/all.T
- testsuite/tests/deriving/should_compile/T20815.hs
- testsuite/tests/deriving/should_fail/T12768.stderr
- testsuite/tests/deriving/should_fail/T1496.stderr
- testsuite/tests/deriving/should_fail/T5498.stderr
- testsuite/tests/deriving/should_fail/T7148.stderr
- testsuite/tests/deriving/should_fail/T7148a.stderr
- testsuite/tests/dmdanal/should_compile/T23398.hs
- testsuite/tests/dmdanal/should_compile/T23398.stderr
- testsuite/tests/driver/j-space/jspace.hs
- testsuite/tests/driver/json.stderr
- testsuite/tests/driver/json_warn.stderr
- testsuite/tests/driver/recomp015/all.T
- testsuite/tests/haddock/haddock_testsuite/Makefile
- + testsuite/tests/haddock/haddock_testsuite/T26114.hs
- + testsuite/tests/haddock/haddock_testsuite/T26114.stdout
- testsuite/tests/haddock/haddock_testsuite/all.T
- testsuite/tests/hiefile/should_run/HieQueries.stdout
- testsuite/tests/hiefile/should_run/TestUtils.hs
- testsuite/tests/impredicative/T17332.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- + testsuite/tests/lib/stm/T26028.hs
- + testsuite/tests/lib/stm/T26028.stdout
- + testsuite/tests/lib/stm/all.T
- testsuite/tests/numeric/should_run/T9810.stdout
- + testsuite/tests/perf/should_run/SpecTyFamRun.hs
- + testsuite/tests/perf/should_run/SpecTyFamRun.stdout
- + testsuite/tests/perf/should_run/SpecTyFam_Import.hs
- testsuite/tests/perf/should_run/all.T
- testsuite/tests/printer/Makefile
- + testsuite/tests/printer/TestLevelImports.hs
- + testsuite/tests/printer/TestNamedDefaults.hs
- testsuite/tests/printer/all.T
- testsuite/tests/quantified-constraints/T15290a.stderr
- testsuite/tests/quantified-constraints/T19690.stderr
- testsuite/tests/quantified-constraints/T19921.stderr
- testsuite/tests/quantified-constraints/T21006.stderr
- testsuite/tests/roles/should_fail/RolesIArray.stderr
- testsuite/tests/rts/KeepCafsBase.hs
- testsuite/tests/rts/all.T
- testsuite/tests/rts/flags/all.T
- testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32
- testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-64-mingw32
- testsuite/tests/simd/should_run/all.T
- + testsuite/tests/simd/should_run/doublex2_shuffle.hs
- + testsuite/tests/simd/should_run/doublex2_shuffle.stdout
- + testsuite/tests/simd/should_run/doublex2_shuffle_baseline.hs
- + testsuite/tests/simd/should_run/doublex2_shuffle_baseline.stdout
- + testsuite/tests/simd/should_run/floatx4_shuffle.hs
- + testsuite/tests/simd/should_run/floatx4_shuffle.stdout
- + testsuite/tests/simd/should_run/floatx4_shuffle_baseline.hs
- + testsuite/tests/simd/should_run/floatx4_shuffle_baseline.stdout
- + testsuite/tests/simplCore/should_compile/T26051.hs
- + testsuite/tests/simplCore/should_compile/T26051.stderr
- + testsuite/tests/simplCore/should_compile/T26051_Import.hs
- + testsuite/tests/simplCore/should_compile/T26115.hs
- + testsuite/tests/simplCore/should_compile/T26115.stderr
- + testsuite/tests/simplCore/should_compile/T26116.hs
- + testsuite/tests/simplCore/should_compile/T26116.stderr
- + testsuite/tests/simplCore/should_compile/T26117.hs
- + testsuite/tests/simplCore/should_compile/T26117.stderr
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/splice-imports/T26087.stderr
- + testsuite/tests/splice-imports/T26087A.hs
- + testsuite/tests/splice-imports/T26087B.hs
- + testsuite/tests/splice-imports/T26088.stderr
- + testsuite/tests/splice-imports/T26088A.hs
- + testsuite/tests/splice-imports/T26088B.hs
- testsuite/tests/splice-imports/all.T
- testsuite/tests/typecheck/should_compile/T12427a.stderr
- testsuite/tests/typecheck/should_compile/T23171.hs
- testsuite/tests/typecheck/should_compile/TcSpecPragmas.stderr
- testsuite/tests/typecheck/should_fail/T14605.hs
- testsuite/tests/typecheck/should_fail/T14605.stderr
- testsuite/tests/typecheck/should_fail/T15801.stderr
- testsuite/tests/typecheck/should_fail/T18640a.stderr
- testsuite/tests/typecheck/should_fail/T18640b.stderr
- testsuite/tests/typecheck/should_fail/T19627.stderr
- testsuite/tests/typecheck/should_fail/T21530b.stderr
- testsuite/tests/typecheck/should_fail/T22912.stderr
- testsuite/tests/typecheck/should_fail/tcfail174.stderr
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Utils.hs
- utils/ghc-pkg/Main.hs
- utils/ghc-toolchain/src/GHC/Toolchain/CheckArm.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Link.hs
- utils/haddock/haddock-api/haddock-api.cabal
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
- utils/hpc
- utils/hsc2hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dfabdcc0be64c68d200e25614ab639…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dfabdcc0be64c68d200e25614ab639…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][master] NCG/LA64: implement atomic write with finer-grained DBAR hints
by Marge Bot (@marge-bot) 05 Aug '25
by Marge Bot (@marge-bot) 05 Aug '25
05 Aug '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
c2a78cea by Peng Fan at 2025-08-05T18:37:27-04:00
NCG/LA64: implement atomic write with finer-grained DBAR hints
Signed-off-by: Peng Fan <fanpeng(a)loongson.cn>
- - - - -
1 changed file:
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
Changes:
=====================================
compiler/GHC/CmmToAsm/LA64/CodeGen.hs
=====================================
@@ -1972,9 +1972,17 @@ genCCall target dest_regs arg_regs = do
(val, fmt_val, code_val) <- getSomeReg val_reg
let instrs = case ord of
MemOrderRelaxed -> unitOL $ ann moDescr (ST fmt_val (OpReg w val) (OpAddr $ AddrReg p))
- -- implement with AMSWAPDB
- MemOrderRelease -> unitOL $ ann moDescr (AMSWAPDB fmt_val (OpReg w zeroReg) (OpReg w val) (OpReg w p))
- MemOrderSeqCst -> unitOL $ ann moDescr (AMSWAPDB fmt_val (OpReg w zeroReg) (OpReg w val) (OpReg w p))
+ -- AMSWAP_DB* insns implentment a fully functional synchronization barrier, like DBAR 0x0.
+ -- This is terrible. And AMSWAPDB only supports ISA version greater than LA64V1_0. So,
+ -- implement with DBAR
+ MemOrderRelease -> toOL [
+ ann moDescr (DBAR HintRelease),
+ ST fmt_val (OpReg w val) (OpAddr $ AddrReg p)
+ ]
+ MemOrderSeqCst -> toOL [
+ ann moDescr (DBAR HintSeqcst),
+ ST fmt_val (OpReg w val) (OpAddr $ AddrReg p)
+ ]
_ -> panic $ "Unexpected MemOrderAcquire on an AtomicWrite" ++ show mo
moDescr = (text . show) mo
code =
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c2a78cea95d2d6cdd26a1c42556aad1…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c2a78cea95d2d6cdd26a1c42556aad1…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][master] hadrian: bump Stackage snapshot to LTS 24.2 / GHC 9.10.2
by Marge Bot (@marge-bot) 05 Aug '25
by Marge Bot (@marge-bot) 05 Aug '25
05 Aug '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
57d3b4a8 by Andrew Lelechenko at 2025-08-05T18:36:31-04:00
hadrian: bump Stackage snapshot to LTS 24.2 / GHC 9.10.2
In line with #25693 we should use GHC 9.10 as a boot compiler,
while Hadrian stack.yaml was stuck on GHC 9.6.
- - - - -
2 changed files:
- hadrian/stack.yaml
- hadrian/stack.yaml.lock
Changes:
=====================================
hadrian/stack.yaml
=====================================
@@ -1,6 +1,6 @@
-# GHC's configure script reports that GHC versions 9.6 and greater are required
+# GHC's configure script reports that GHC versions 9.10 and greater are required
# to build GHC from source.
-resolver: lts-22.44 # GHC 9.6.7
+resolver: lts-24.2 # GHC 9.10.2
packages:
- '.'
=====================================
hadrian/stack.yaml.lock
=====================================
@@ -1,7 +1,7 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
-# https://docs.haskellstack.org/en/stable/lock_files
+# https://docs.haskellstack.org/en/stable/topics/lock_files
packages:
- completed:
@@ -40,9 +40,9 @@ packages:
original:
hackage: filepath-1.4.300.2
- completed:
- hackage: process-1.6.25.0@sha256:092ab61596e914d21983aa2e9206a74c4faa38a5a636446b5c954305821cb496,2749
+ hackage: process-1.6.25.0@sha256:9a0b2ef8096517fa0e0c7a5e9a5c2ae5744ed824c3331005f9408245810df345,2640
pantry-tree:
- sha256: bdab416d3c454ad716d4fab1ced490cc75330658c1c7c66a0b6f4b3e5125017b
+ sha256: 9c7927cd4d7f2f4c64251256eb6904800b3922fa5c5424c60f0e08441693e12b
size: 1790
original:
hackage: process-1.6.25.0
@@ -55,7 +55,7 @@ packages:
hackage: unix-2.8.5.1
snapshots:
- completed:
- sha256: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9
- size: 721141
- url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/mast…
- original: lts-22.44
+ sha256: cd28bd74375205718f1d5fa221730a9c17a203059708b1eb95f4b20d68bf82d9
+ size: 724943
+ url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/mast…
+ original: lts-24.2
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/57d3b4a82e97f379cc8f41d61675d8c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/57d3b4a82e97f379cc8f41d61675d8c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][master] compiler: Export a version of `newNameCache` that is not prone to footguns.
by Marge Bot (@marge-bot) 05 Aug '25
by Marge Bot (@marge-bot) 05 Aug '25
05 Aug '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
bcdec657 by Zubin Duggal at 2025-08-05T10:37:29+05:30
compiler: Export a version of `newNameCache` that is not prone to footguns.
`newNameCache` must be initialized with both a non-"reserved" unique tag, as well
as a list of known key names. Failing to do so results in hard to debug unique conflicts.
It is difficult for API users to tell which unique tags are safe to use. So instead of leaving
this up to the user to decide, we now export a version of `newNameCache` which uses a guaranteed
non-reserved unique tag. In fact, this is now the way the unique tag is initialized for all invocations
of the compiler.
The original version of `newNameCache` is now exported as `newNameCache'` for advanced users.
We also deprecate `initNameCache` as it is also prone to footguns and is completely subsumed in
functionality by `newNameCache` and `newNameCache'`.
Fixes #26135 and #26055
- - - - -
3 changed files:
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Types/Name/Cache.hs
- testsuite/tests/hiefile/should_run/TestUtils.hs
Changes:
=====================================
compiler/GHC/Driver/Main.hs
=====================================
@@ -245,7 +245,7 @@ import GHC.Types.IPE
import GHC.Types.SourceFile
import GHC.Types.SrcLoc
import GHC.Types.Name
-import GHC.Types.Name.Cache ( newNameCache, knownKeysOrigNameCache )
+import GHC.Types.Name.Cache ( newNameCache )
import GHC.Types.Name.Reader
import GHC.Types.Name.Ppr
import GHC.Types.TyThing
@@ -322,7 +322,7 @@ newHscEnv top_dir dflags = do
newHscEnvWithHUG :: FilePath -> DynFlags -> UnitId -> HomeUnitGraph -> IO HscEnv
newHscEnvWithHUG top_dir top_dynflags cur_unit home_unit_graph = do
- nc_var <- newNameCache 'r' knownKeysOrigNameCache
+ nc_var <- newNameCache
fc_var <- initFinderCache
logger <- initLogger
tmpfs <- initTmpFs
=====================================
compiler/GHC/Types/Name/Cache.hs
=====================================
@@ -4,6 +4,7 @@
module GHC.Types.Name.Cache
( NameCache (..)
, newNameCache
+ , newNameCacheWith
, initNameCache
, takeUniqFromNameCache
, updateNameCache'
@@ -140,11 +141,27 @@ extendOrigNameCache nc mod occ name
where
combine _ occ_env = extendOccEnv occ_env occ name
-newNameCache :: Char -> OrigNameCache -> IO NameCache
-newNameCache c nc = NameCache c <$> newMVar nc
+-- | Initialize a new name cache
+newNameCache :: IO NameCache
+newNameCache = newNameCacheWith 'r' knownKeysOrigNameCache
+-- | This is a version of `newNameCache` that lets you supply your
+-- own unique tag and set of known key names. This can go wrong if the tag
+-- supplied is one reserved by GHC for internal purposes. See #26055 for
+-- an example.
+--
+-- Use `newNameCache` when possible.
+newNameCacheWith :: Char -> OrigNameCache -> IO NameCache
+newNameCacheWith c nc = NameCache c <$> newMVar nc
+
+-- | This takes a tag for uniques to be generated and the list of knownKeyNames
+-- These must be initialized properly to ensure that names generated from this
+-- NameCache do not conflict with known key names.
+--
+-- Use `newNameCache` or `newNameCacheWith` instead
+{-# DEPRECATED initNameCache "Use newNameCache or newNameCacheWith instead" #-}
initNameCache :: Char -> [Name] -> IO NameCache
-initNameCache c names = newNameCache c (initOrigNames names)
+initNameCache c names = newNameCacheWith c (initOrigNames names)
initOrigNames :: [Name] -> OrigNameCache
initOrigNames names = foldl' extendOrigNameCache' emptyModuleEnv names
=====================================
testsuite/tests/hiefile/should_run/TestUtils.hs
=====================================
@@ -25,9 +25,6 @@ import GHC.Iface.Ext.Utils
import GHC.Driver.Session
import GHC.SysTools
-makeNc :: IO NameCache
-makeNc = initNameCache 'z' []
-
dynFlagsForPrinting :: String -> IO DynFlags
dynFlagsForPrinting libdir = do
systemSettings <- initSysTools libdir
@@ -37,7 +34,7 @@ readTestHie :: FilePath -> IO (DynFlags, HieFile)
readTestHie fp = do
libdir:_ <- getArgs
df <- dynFlagsForPrinting libdir
- nc <- makeNc
+ nc <- newNameCache
hfr <- readHieFile nc fp
pure (df, hie_file_result hfr)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bcdec6572a098f984efeb85bf45ff7c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bcdec6572a098f984efeb85bf45ff7c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Ben Gamari pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC
Commits:
3ca40248 by Ben Gamari at 2025-08-05T16:00:11-04:00
Move addImplicitBinds
- - - - -
1 changed file:
- compiler/GHC/Driver/Main.hs
Changes:
=====================================
compiler/GHC/Driver/Main.hs
=====================================
@@ -1925,6 +1925,14 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
dflags = hsc_dflags hsc_env
logger = hsc_logger hsc_env
+ -------------------
+ -- ADD IMPLICIT BINDINGS
+ -- NB: we must feed mkImplicitBinds through corePrep too
+ -- so that they are suitably cloned and eta-expanded
+ let cp_pgm_cfg :: CorePrepPgmConfig
+ cp_pgm_cfg = initCorePrepPgmConfig (hsc_dflags hsc_env)
+ (interactiveInScope $ hsc_IC hsc_env)
+ binds_with_implicits <- addImplicitBinds cp_pgm_cfg mod_loc (cg_tycons cgguts) core_binds
-------------------
-- INSERT LATE COST CENTRES, based on the provided flags.
@@ -1957,7 +1965,7 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
}
(late_cc_binds, late_cc_state) <-
- addLateCostCenters logger late_cc_config core_binds
+ addLateCostCenters logger late_cc_config binds_with_implicits
when (dopt Opt_D_dump_late_cc dflags || dopt Opt_D_verbose_core2core dflags) $
putDumpFileMaybe logger Opt_D_dump_late_cc "LateCC" FormatCore (vcat (map ppr late_cc_binds))
@@ -1972,7 +1980,7 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
cg_foreign_files = foreign_files,
cg_dep_pkgs = dependencies,
cg_spt_entries = spt_entries,
- cg_binds = late_binds,
+ cg_binds = binds_to_prep,
cg_ccs = late_local_ccs
}
, _
@@ -1997,15 +2005,6 @@ hscGenHardCode hsc_env cgguts mod_loc output_filename = do
llvm_config = hsc_llvm_config hsc_env
profile = targetProfile dflags
- -------------------
- -- ADD IMPLICIT BINDINGS
- -- NB: we must feed mkImplicitBinds through corePrep too
- -- so that they are suitably cloned and eta-expanded
- let cp_pgm_cfg :: CorePrepPgmConfig
- cp_pgm_cfg = initCorePrepPgmConfig (hsc_dflags hsc_env)
- (interactiveInScope $ hsc_IC hsc_env)
- binds_to_prep <- addImplicitBinds cp_pgm_cfg mod_loc tycons late_binds
-
-------------------
-- PREPARE FOR CODE GENERATION
-- Do saturation and convert to A-normal form
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3ca4024884440b8b03fdcb509c1ea01…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3ca4024884440b8b03fdcb509c1ea01…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: Revert "base: Expose Backtraces constructor and fields"
by Marge Bot (@marge-bot) 05 Aug '25
by Marge Bot (@marge-bot) 05 Aug '25
05 Aug '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
4f6bc9cf by fendor at 2025-08-04T17:50:06-04:00
Revert "base: Expose Backtraces constructor and fields"
This reverts commit 17db44c5b32fff82ea988fa4f1a233d1a27bdf57.
- - - - -
bcdec657 by Zubin Duggal at 2025-08-05T10:37:29+05:30
compiler: Export a version of `newNameCache` that is not prone to footguns.
`newNameCache` must be initialized with both a non-"reserved" unique tag, as well
as a list of known key names. Failing to do so results in hard to debug unique conflicts.
It is difficult for API users to tell which unique tags are safe to use. So instead of leaving
this up to the user to decide, we now export a version of `newNameCache` which uses a guaranteed
non-reserved unique tag. In fact, this is now the way the unique tag is initialized for all invocations
of the compiler.
The original version of `newNameCache` is now exported as `newNameCache'` for advanced users.
We also deprecate `initNameCache` as it is also prone to footguns and is completely subsumed in
functionality by `newNameCache` and `newNameCache'`.
Fixes #26135 and #26055
- - - - -
8429f85c by Andrew Lelechenko at 2025-08-05T12:15:10-04:00
hadrian: bump Stackage snapshot to LTS 24.2 / GHC 9.10.2
In line with #25693 we should use GHC 9.10 as a boot compiler,
while Hadrian stack.yaml was stuck on GHC 9.6.
- - - - -
8b919f58 by Peng Fan at 2025-08-05T12:15:24-04:00
NCG/LA64: implement atomic write with finer-grained DBAR hints
Signed-off-by: Peng Fan <fanpeng(a)loongson.cn>
- - - - -
12 changed files:
- compiler/GHC/CmmToAsm/LA64/CodeGen.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Types/Name/Cache.hs
- hadrian/stack.yaml
- hadrian/stack.yaml.lock
- libraries/base/changelog.md
- libraries/base/src/Control/Exception/Backtrace.hs
- testsuite/tests/hiefile/should_run/TestUtils.hs
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
Changes:
=====================================
compiler/GHC/CmmToAsm/LA64/CodeGen.hs
=====================================
@@ -1972,9 +1972,17 @@ genCCall target dest_regs arg_regs = do
(val, fmt_val, code_val) <- getSomeReg val_reg
let instrs = case ord of
MemOrderRelaxed -> unitOL $ ann moDescr (ST fmt_val (OpReg w val) (OpAddr $ AddrReg p))
- -- implement with AMSWAPDB
- MemOrderRelease -> unitOL $ ann moDescr (AMSWAPDB fmt_val (OpReg w zeroReg) (OpReg w val) (OpReg w p))
- MemOrderSeqCst -> unitOL $ ann moDescr (AMSWAPDB fmt_val (OpReg w zeroReg) (OpReg w val) (OpReg w p))
+ -- AMSWAP_DB* insns implentment a fully functional synchronization barrier, like DBAR 0x0.
+ -- This is terrible. And AMSWAPDB only supports ISA version greater than LA64V1_0. So,
+ -- implement with DBAR
+ MemOrderRelease -> toOL [
+ ann moDescr (DBAR HintRelease),
+ ST fmt_val (OpReg w val) (OpAddr $ AddrReg p)
+ ]
+ MemOrderSeqCst -> toOL [
+ ann moDescr (DBAR HintSeqcst),
+ ST fmt_val (OpReg w val) (OpAddr $ AddrReg p)
+ ]
_ -> panic $ "Unexpected MemOrderAcquire on an AtomicWrite" ++ show mo
moDescr = (text . show) mo
code =
=====================================
compiler/GHC/Driver/Main.hs
=====================================
@@ -245,7 +245,7 @@ import GHC.Types.IPE
import GHC.Types.SourceFile
import GHC.Types.SrcLoc
import GHC.Types.Name
-import GHC.Types.Name.Cache ( newNameCache, knownKeysOrigNameCache )
+import GHC.Types.Name.Cache ( newNameCache )
import GHC.Types.Name.Reader
import GHC.Types.Name.Ppr
import GHC.Types.TyThing
@@ -322,7 +322,7 @@ newHscEnv top_dir dflags = do
newHscEnvWithHUG :: FilePath -> DynFlags -> UnitId -> HomeUnitGraph -> IO HscEnv
newHscEnvWithHUG top_dir top_dynflags cur_unit home_unit_graph = do
- nc_var <- newNameCache 'r' knownKeysOrigNameCache
+ nc_var <- newNameCache
fc_var <- initFinderCache
logger <- initLogger
tmpfs <- initTmpFs
=====================================
compiler/GHC/Types/Name/Cache.hs
=====================================
@@ -4,6 +4,7 @@
module GHC.Types.Name.Cache
( NameCache (..)
, newNameCache
+ , newNameCacheWith
, initNameCache
, takeUniqFromNameCache
, updateNameCache'
@@ -140,11 +141,27 @@ extendOrigNameCache nc mod occ name
where
combine _ occ_env = extendOccEnv occ_env occ name
-newNameCache :: Char -> OrigNameCache -> IO NameCache
-newNameCache c nc = NameCache c <$> newMVar nc
+-- | Initialize a new name cache
+newNameCache :: IO NameCache
+newNameCache = newNameCacheWith 'r' knownKeysOrigNameCache
+-- | This is a version of `newNameCache` that lets you supply your
+-- own unique tag and set of known key names. This can go wrong if the tag
+-- supplied is one reserved by GHC for internal purposes. See #26055 for
+-- an example.
+--
+-- Use `newNameCache` when possible.
+newNameCacheWith :: Char -> OrigNameCache -> IO NameCache
+newNameCacheWith c nc = NameCache c <$> newMVar nc
+
+-- | This takes a tag for uniques to be generated and the list of knownKeyNames
+-- These must be initialized properly to ensure that names generated from this
+-- NameCache do not conflict with known key names.
+--
+-- Use `newNameCache` or `newNameCacheWith` instead
+{-# DEPRECATED initNameCache "Use newNameCache or newNameCacheWith instead" #-}
initNameCache :: Char -> [Name] -> IO NameCache
-initNameCache c names = newNameCache c (initOrigNames names)
+initNameCache c names = newNameCacheWith c (initOrigNames names)
initOrigNames :: [Name] -> OrigNameCache
initOrigNames names = foldl' extendOrigNameCache' emptyModuleEnv names
=====================================
hadrian/stack.yaml
=====================================
@@ -1,6 +1,6 @@
-# GHC's configure script reports that GHC versions 9.6 and greater are required
+# GHC's configure script reports that GHC versions 9.10 and greater are required
# to build GHC from source.
-resolver: lts-22.44 # GHC 9.6.7
+resolver: lts-24.2 # GHC 9.10.2
packages:
- '.'
=====================================
hadrian/stack.yaml.lock
=====================================
@@ -1,7 +1,7 @@
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
-# https://docs.haskellstack.org/en/stable/lock_files
+# https://docs.haskellstack.org/en/stable/topics/lock_files
packages:
- completed:
@@ -40,9 +40,9 @@ packages:
original:
hackage: filepath-1.4.300.2
- completed:
- hackage: process-1.6.25.0@sha256:092ab61596e914d21983aa2e9206a74c4faa38a5a636446b5c954305821cb496,2749
+ hackage: process-1.6.25.0@sha256:9a0b2ef8096517fa0e0c7a5e9a5c2ae5744ed824c3331005f9408245810df345,2640
pantry-tree:
- sha256: bdab416d3c454ad716d4fab1ced490cc75330658c1c7c66a0b6f4b3e5125017b
+ sha256: 9c7927cd4d7f2f4c64251256eb6904800b3922fa5c5424c60f0e08441693e12b
size: 1790
original:
hackage: process-1.6.25.0
@@ -55,7 +55,7 @@ packages:
hackage: unix-2.8.5.1
snapshots:
- completed:
- sha256: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9
- size: 721141
- url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/mast…
- original: lts-22.44
+ sha256: cd28bd74375205718f1d5fa221730a9c17a203059708b1eb95f4b20d68bf82d9
+ size: 724943
+ url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/mast…
+ original: lts-24.2
=====================================
libraries/base/changelog.md
=====================================
@@ -30,7 +30,6 @@
* `GHC.TypeNats.Internal`
* `GHC.ExecutionStack.Internal`.
* Deprecate `GHC.JS.Prim.Internal.Build`, as per [CLC #329](https://github.com/haskell/core-libraries-committee/issues/329)
- * Expose constructor and field of `Backtraces` from `Control.Exception.Backtrace`, as per [CLC #199](https://github.com/haskell/core-libraries-committee/issues/199#issuecomment-1954662391)
* Fix incorrect results of `integerPowMod` when the base is 0 and the exponent is negative, and `integerRecipMod` when the modulus is zero ([#26017](https://gitlab.haskell.org/ghc/ghc/-/issues/26017)).
* Fix the rewrite rule for `scanl'` not being strict in the first element of the output list ([#26143](https://gitlab.haskell.org/ghc/ghc/-/issues/26143)).
=====================================
libraries/base/src/Control/Exception/Backtrace.hs
=====================================
@@ -51,7 +51,7 @@ module Control.Exception.Backtrace
, getBacktraceMechanismState
, setBacktraceMechanismState
-- * Collecting backtraces
- , Backtraces(..)
+ , Backtraces
, displayBacktraces
, collectBacktraces
) where
=====================================
testsuite/tests/hiefile/should_run/TestUtils.hs
=====================================
@@ -25,9 +25,6 @@ import GHC.Iface.Ext.Utils
import GHC.Driver.Session
import GHC.SysTools
-makeNc :: IO NameCache
-makeNc = initNameCache 'z' []
-
dynFlagsForPrinting :: String -> IO DynFlags
dynFlagsForPrinting libdir = do
systemSettings <- initSysTools libdir
@@ -37,7 +34,7 @@ readTestHie :: FilePath -> IO (DynFlags, HieFile)
readTestHie fp = do
libdir:_ <- getArgs
df <- dynFlagsForPrinting libdir
- nc <- makeNc
+ nc <- newNameCache
hfr <- readHieFile nc fp
pure (df, hie_file_result hfr)
=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -323,7 +323,7 @@ module Control.Exception.Backtrace where
type BacktraceMechanism :: *
data BacktraceMechanism = CostCentreBacktrace | HasCallStackBacktrace | ExecutionBacktrace | IPEBacktrace
type Backtraces :: *
- data Backtraces = Backtraces {btrCostCentre :: GHC.Internal.Maybe.Maybe (GHC.Internal.Ptr.Ptr GHC.Internal.Stack.CCS.CostCentreStack), btrHasCallStack :: GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.CallStack, btrExecutionStack :: GHC.Internal.Maybe.Maybe [GHC.Internal.ExecutionStack.Internal.Location], btrIpe :: GHC.Internal.Maybe.Maybe [GHC.Internal.Stack.CloneStack.StackEntry]}
+ data Backtraces = ...
collectBacktraces :: (?callStack::GHC.Internal.Stack.Types.CallStack) => GHC.Internal.Types.IO Backtraces
displayBacktraces :: Backtraces -> GHC.Internal.Base.String
getBacktraceMechanismState :: BacktraceMechanism -> GHC.Internal.Types.IO GHC.Internal.Types.Bool
=====================================
testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
=====================================
@@ -323,7 +323,7 @@ module Control.Exception.Backtrace where
type BacktraceMechanism :: *
data BacktraceMechanism = CostCentreBacktrace | HasCallStackBacktrace | ExecutionBacktrace | IPEBacktrace
type Backtraces :: *
- data Backtraces = Backtraces {btrCostCentre :: GHC.Internal.Maybe.Maybe (GHC.Internal.Ptr.Ptr GHC.Internal.Stack.CCS.CostCentreStack), btrHasCallStack :: GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.CallStack, btrExecutionStack :: GHC.Internal.Maybe.Maybe [GHC.Internal.ExecutionStack.Internal.Location], btrIpe :: GHC.Internal.Maybe.Maybe [GHC.Internal.Stack.CloneStack.StackEntry]}
+ data Backtraces = ...
collectBacktraces :: (?callStack::GHC.Internal.Stack.Types.CallStack) => GHC.Internal.Types.IO Backtraces
displayBacktraces :: Backtraces -> GHC.Internal.Base.String
getBacktraceMechanismState :: BacktraceMechanism -> GHC.Internal.Types.IO GHC.Internal.Types.Bool
=====================================
testsuite/tests/interface-stability/base-exports.stdout-mingw32
=====================================
@@ -323,7 +323,7 @@ module Control.Exception.Backtrace where
type BacktraceMechanism :: *
data BacktraceMechanism = CostCentreBacktrace | HasCallStackBacktrace | ExecutionBacktrace | IPEBacktrace
type Backtraces :: *
- data Backtraces = Backtraces {btrCostCentre :: GHC.Internal.Maybe.Maybe (GHC.Internal.Ptr.Ptr GHC.Internal.Stack.CCS.CostCentreStack), btrHasCallStack :: GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.CallStack, btrExecutionStack :: GHC.Internal.Maybe.Maybe [GHC.Internal.ExecutionStack.Internal.Location], btrIpe :: GHC.Internal.Maybe.Maybe [GHC.Internal.Stack.CloneStack.StackEntry]}
+ data Backtraces = ...
collectBacktraces :: (?callStack::GHC.Internal.Stack.Types.CallStack) => GHC.Internal.Types.IO Backtraces
displayBacktraces :: Backtraces -> GHC.Internal.Base.String
getBacktraceMechanismState :: BacktraceMechanism -> GHC.Internal.Types.IO GHC.Internal.Types.Bool
=====================================
testsuite/tests/interface-stability/base-exports.stdout-ws-32
=====================================
@@ -323,7 +323,7 @@ module Control.Exception.Backtrace where
type BacktraceMechanism :: *
data BacktraceMechanism = CostCentreBacktrace | HasCallStackBacktrace | ExecutionBacktrace | IPEBacktrace
type Backtraces :: *
- data Backtraces = Backtraces {btrCostCentre :: GHC.Internal.Maybe.Maybe (GHC.Internal.Ptr.Ptr GHC.Internal.Stack.CCS.CostCentreStack), btrHasCallStack :: GHC.Internal.Maybe.Maybe GHC.Internal.Stack.Types.CallStack, btrExecutionStack :: GHC.Internal.Maybe.Maybe [GHC.Internal.ExecutionStack.Internal.Location], btrIpe :: GHC.Internal.Maybe.Maybe [GHC.Internal.Stack.CloneStack.StackEntry]}
+ data Backtraces = ...
collectBacktraces :: (?callStack::GHC.Internal.Stack.Types.CallStack) => GHC.Internal.Types.IO Backtraces
displayBacktraces :: Backtraces -> GHC.Internal.Base.String
getBacktraceMechanismState :: BacktraceMechanism -> GHC.Internal.Types.IO GHC.Internal.Types.Bool
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6eb6065c6cf2fc6d329c711f7cb70e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6eb6065c6cf2fc6d329c711f7cb70e…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/rafl/cover-data] Add release notes for 9.16.1 and move description of latest HPC changes there.
by Florian Ragwitz (@rafl) 05 Aug '25
by Florian Ragwitz (@rafl) 05 Aug '25
05 Aug '25
Florian Ragwitz pushed to branch wip/rafl/cover-data at Glasgow Haskell Compiler / GHC
Commits:
3631eb1b by Florian Ragwitz at 2025-08-05T08:17:02-07:00
Add release notes for 9.16.1 and move description of latest HPC changes there.
- - - - -
3 changed files:
- − docs/users_guide/9.14.1-notes.rst
- + docs/users_guide/9.16.1-notes.rst
- docs/users_guide/release-notes.rst
Changes:
=====================================
docs/users_guide/9.14.1-notes.rst deleted
=====================================
@@ -1,296 +0,0 @@
-.. _release-9-14-1:
-
-Version 9.14.1
-==============
-
-The significant changes to the various parts of the compiler are listed in the
-following sections. See the `migration guide
-<https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.14>`_ on the GHC Wiki
-for specific guidance on migrating programs to this release.
-
-Language
-~~~~~~~~
-
-* `GHC proposal 493: allow expressions in SPECIALISE pragmas <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0493-s…>`_
- has been implemented. SPECIALISE pragmas now allow arbitrary expressions such as: ::
-
- {-# SPECIALISE f @Int False :: Int -> Char #-}
-
- The ability to specify multiple specialisations in a single SPECIALISE pragma,
- with syntax of the form (note the comma between the type signatures): ::
-
- {-# SPECIALISE g : Int -> Int, Float -> Float #-}
-
- has been deprecated, and is scheduled to be removed in GHC 9.18.
- This deprecation is controlled by the newly introduced ``-Wdeprecated-pragmas``
- flag in ``-Wdefault``.
-
-* ``-Wincomplete-record-selectors`` is now part of `-Wall`, as specified
- by `GHC Proposal 516: add warning for incomplete record selectors <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0516-i…>`_.
- Hence, if a library is compiled with ``-Werror``, compilation may now fail. Solution: fix the library.
- Workaround: add ``-Werror=no-incomplete-record-selectors``.
-
- Note that this warning is at least
- as serious as a warning about missing patterns from a function definition, perhaps even
- more so, since it is invisible in the source program.
-
-* The combination of :extension:`ScopedTypeVariables` and :extension:`TypeApplications`
- no longer enables type applications in patterns, which now always requires
- :extension:`TypeAbstractions`. The warning flag``deprecated-type-abstractions``
- has also been removed from the compiler.
-
-* :extension:`OverloadedRecordUpdate` now passes the arguments to a ``setField`` function
- in the flipped order, as specified by `GHC Proposal 583: HasField redesign <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0583-h…>`_.
-
- Previously GHC expected ``setField`` to have this type: ::
-
- setField :: forall (fld :: Symbol) a r. r -> a -> r
-
- And that's what GHC expects now: ::
-
- setField :: forall (fld :: Symbol) a r. a -> r -> r
-
- That will break the combination of :extension:`OverloadedRecordUpdate` with :extension:`RebindableSyntax`.
-
-* Multiline strings are now accepted in foreign imports. (#25157)
-
-* GHC now does a better job at inferring types in calls to ``coerce``: instead of
- complaining about ambiguous type variables, GHC will consider that such type
- variables are determined by the ``Coercible`` constraints they appear in.
-
-* With :extension:`LinearTypes` record fields can now be non-linear. This means that
- the following record declaration is now valid:
-
- ::
-
- data Record = Rec { x %'Many :: Int, y :: Char }
-
- This causes the constructor to have type ``Rec :: Int %'Many -> Char %1 -> Record``.
-
-* The :extension:`ExplicitNamespaces` extension now allows the ``data``
- namespace specifier in import and export lists.
-
-* The ``-Wdata-kinds-tc`` warning has been deprecated, and the use of promoted
- data types in kinds is now an error (rather than a warning) unless the
- :extension:`DataKinds` extension is enabled. For example, the following code
- will be rejected unless :extension:`DataKinds` is on:
-
- import Data.Kind (Type)
- import GHC.TypeNats (Nat)
-
- -- Nat shouldn't be allowed here without DataKinds
- data Vec :: Nat -> Type -> Type
-
- (The ``-Wdata-kinds-tc`` warning was introduced in GHC 9.10 as part of a fix
- for an accidental oversight in which programs like the one above were
- mistakenly accepted without the use of :extension:`DataKinds`.)
-
-* The :extension:`MonadComprehensions` extension now implies :extension:`ParallelListComp` as was originally intended (see `Monad Comprehensions <https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/monad_comprehension…>`_).
-
-* In accordance with `GHC Proposal #281 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0281-v…>`_,
- section 4.7 "Data constructors", the :extension:`RequiredTypeArguments`
- extension now allows visible forall in types of data constructors
- (:ghc-ticket:`25127`). The following declaration is now accepted by GHC:
-
- ::
-
- data T a where
- Typed :: forall a -> a -> T a
-
- See :ref:`visible-forall-in-gadts` for details.
-
-Compiler
-~~~~~~~~
-
-- An improved error message is introduced to refer users to the heap-controlling flags of the RTS when there is a heap overflow during compilation. (#25198)
-
-- The kind checker now does a better job of finding type family instances for
- use in the kinds of other declarations in the same module. This fixes a number
- of tickets:
- :ghc-ticket:`12088`, :ghc-ticket:`12239`, :ghc-ticket:`14668`, :ghc-ticket:`15561`,
- :ghc-ticket:`16410`, :ghc-ticket:`16448`, :ghc-ticket:`16693`, :ghc-ticket:`19611`,
- :ghc-ticket:`20875`, :ghc-ticket:`21172`, :ghc-ticket:`22257`, :ghc-ticket:`25238`,
- :ghc-ticket:`25834`.
-
-- The compiler no longer accepts invalid ``type`` namespace specifiers in
- subordinate import lists (:ghc-ticket:`22581`).
-
-- A new flag, :ghc-flag:`-Wuseless-specialisations`, controls warnings emitted when GHC
- determines that a SPECIALISE pragma would have no effect.
-
-- A new flag, :ghc-flag:`-Wrule-lhs-equalities`, controls warnings emitted for RULES
- whose left-hand side attempts to quantify over equality constraints that
- previous GHC versions accepted quantifying over. GHC will now drop such RULES,
- emitting a warning message controlled by this flag.
-
- This warning is intended to give visibility to the fact that the RULES that
- previous GHC versions generated in such circumstances could never fire.
-
-- A new flag, :ghc-flag:`-Wunusable-unpack-pragmas`, controls warnings emitted
- when GHC is unable to unpack a data constructor field annotated by the
- ``{-# UNPACK #-}`` pragma.
-
- Previous GHC versions issued this warning unconditionally. Now it is possible
- to disable it with ``-Wno-unusable-unpack-pragmas`` or turn it into an error
- with ``-Werror=unusable-unpack-pragmas``.
-
-- Introduce a new warning :ghc-flag:`-Wpattern-namespace-specifier` to detect
- uses of the now deprecated ``pattern`` namespace specifier in import/export
- lists. See `GHC Proposal #581, section 2.3 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0581-n…>`_.
-
-- Code coverage (:ghc-flag:`-fhpc`) now treats uses of record fields
- (including via :extension:`RecordWildCards` or :extension:`NamedFieldPuns`)
- as if the fields were accessed using the generated record selector functions,
- marking the fields as covered in coverage reports (:ghc-ticket:`17834`,
- :ghc-ticket:`26191`). Note that this currently only works when record fields
- (or values contained within them) are bound to variables, and usage of those
- variables marks the record selectors as covered. That is, a pattern like
- ``Foo{bar = Bar{baz = b}}`` will mark ``bar`` and ``baz`` as covered if ``b``
- is used, but the similar pattern ``Foo{bar = Bar{baz = 42}}`` will mark
- neither as covered.
-
-- SIMD support in the X86 native code generator has been extended with 128-bit
- integer operations. Also, ``shuffleFloatX4#`` and ``shuffleDoubleX2#`` no longer
- require ``-mavx``.
-
-- JSON diagnostics produced with (:ghc-flag:`-fdiagnostics-as-json`) now
- include the `rendered` diagnostics message, in the exact same format as what
- GHC would have produced without -fdiagnostics-as-json (including ANSI escape
- sequences).
-
-GHCi
-~~~~
-
-- :ghci-cmd:`:info` now outputs type declarations with @-binders that are
- considered semantically significant. See the documentation for :ghci-cmd:`:info`
- itself for a more detailed explanation.
-
-- GHCi errors and warnings now have their own numeric error codes that are
- displayed alongside the error.
-
-Runtime system
-~~~~~~~~~~~~~~
-
-- Add new runtime flag :rts-flag:`--optimistic-linking` which instructs the
- runtime linker to continue in the presence of unknown symbols. By default this
- flag is not passed, preserving previous behavior.
-
-Cmm
-~~~
-
-``base`` library
-~~~~~~~~~~~~~~~~
-
-``ghc-prim`` library
-~~~~~~~~~~~~~~~~~~~~
-
-``ghc`` library
-~~~~~~~~~~~~~~~
-
-* The `UnknownDiagnostic` constructor now takes an additional type argument
- for the type of hints corresponding to the diagnostic, and an additional
- value-level argument used for existential wrapping of the hints of the inner
- diagnostic.
-
-* Changes to the HPT and HUG interface:
-
- - `addToHpt` and `addListToHPT` were moved from `GHC.Unit.Home.ModInfo` to `GHC.Unit.Home.PackageTable` and deprecated in favour of `addHomeModInfoToHpt` and `addHomeModInfosToHpt`.
- - `UnitEnvGraph` and operations `unitEnv_lookup_maybe`, `unitEnv_foldWithKey, `unitEnv_singleton`, `unitEnv_adjust`, `unitEnv_insert`, `unitEnv_new` were moved from `GHC.Unit.Env` to `GHC.Unit.Home.Graph`.
- - The HomePackageTable (HPT) is now exported from `GHC.Unit.Home.PackageTable`,
- and is now backed by an IORef to avoid by construction very bad memory leaks.
- This means the API to the HPT now is for the most part in IO. For instance,
- `emptyHomePackageTable` and `addHomeModInfoToHpt` are now in IO.
- - `mkHomeUnitEnv` was moved to `GHC.Unit.Home.PackageTable`, and now takes two
- extra explicit arguments. To restore previous behaviour, pass `emptyUnitState`
- and `Nothing` as the first two arguments additionally.
- - `hugElts` was removed. Users should prefer `allUnits` to get the keys of the
- HUG (the typical use case), or `traverse` or `unitEnv_foldWithKey` in other
- cases.
-
-* Changes to `Language.Haskell.Syntax.Expr`
-
- - The `ParStmtBlock` list argument of the `ParStmt` constructor of `StmtLR` is now `NonEmpty`.
-
-* As part of the implementation of `GHC proposal 493 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0493-s…>`_,
- the `SpecSig` constructor of `Sig` has been deprecated. It is replaced by
- the constructor `SpecSigE` which supports expressions at the head, rather than
- a lone variable.
-
-``ghc-heap`` library
-~~~~~~~~~~~~~~~~~~~~
-
-* The functions `getClosureInfoTbl_maybe`, `getClosureInfoTbl`,
- `getClosurePtrArgs` and `getClosurePtrArgs_maybe` have been added to allow
- reading of the relevant Closure attributes without reliance on incomplete
- selectors.
-
-``ghc-experimental`` library
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-- ``ghc-experimental`` now exposes ``GHC.RTS.Flags`` and ``GHC.Stats`` as
- ``GHC.RTS.Flags.Experimental`` and ``GHC.Stats.Experimental``. These are
- *also* exposed in ``base``, however the ``base`` versions will be deprecated as
- part of the split base project. See `CLC proposal 289
- <https://github.com/haskell/core-libraries-committee/issues/289>`__.
- Downstream consumers of these flags are encouraged to migrate to the
- ``ghc-experimental`` versions.
-
-
-
-``template-haskell`` library
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-- As part of the implementation of `GHC proposal 493 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0493-s…>`_,
- the ``SpecialiseP`` constructor of the Template Haskell ``Pragma`` type, as
- well as the helpers ``pragSpecD`` and ``pragSpecInlD``, have been deprecated.
-
- They are replaced, respectively, by ``SpecialiseEP``, ``pragSpecED`` and
- ``pragSpecInlED``.
-
-Included libraries
-~~~~~~~~~~~~~~~~~~
-
-The package database provided with this distribution also contains a number of
-packages other than GHC itself. See the changelogs provided with these packages
-for further change information.
-
-.. ghc-package-list::
-
- libraries/array/array.cabal: Dependency of ``ghc`` library
- libraries/base/base.cabal: Core library
- libraries/binary/binary.cabal: Dependency of ``ghc`` library
- libraries/bytestring/bytestring.cabal: Dependency of ``ghc`` library
- libraries/Cabal/Cabal/Cabal.cabal: Dependency of ``ghc-pkg`` utility
- libraries/Cabal/Cabal-syntax/Cabal-syntax.cabal: Dependency of ``ghc-pkg`` utility
- libraries/containers/containers/containers.cabal: Dependency of ``ghc`` library
- libraries/deepseq/deepseq.cabal: Dependency of ``ghc`` library
- libraries/directory/directory.cabal: Dependency of ``ghc`` library
- libraries/exceptions/exceptions.cabal: Dependency of ``ghc`` and ``haskeline`` library
- libraries/filepath/filepath.cabal: Dependency of ``ghc`` library
- compiler/ghc.cabal: The compiler itself
- libraries/ghci/ghci.cabal: The REPL interface
- libraries/ghc-boot/ghc-boot.cabal: Internal compiler library
- libraries/ghc-boot-th/ghc-boot-th.cabal: Internal compiler library
- libraries/ghc-compact/ghc-compact.cabal: Core library
- libraries/ghc-heap/ghc-heap.cabal: GHC heap-walking library
- libraries/ghc-prim/ghc-prim.cabal: Core library
- utils/haddock/haddock-api/haddock-api.cabal: Dependency of ``haddock`` executable
- utils/haddock/haddock-library/haddock-library.cabal: Dependency of ``haddock`` executable
- libraries/haskeline/haskeline.cabal: Dependency of ``ghci`` executable
- libraries/hpc/hpc.cabal: Dependency of ``hpc`` executable
- libraries/integer-gmp/integer-gmp.cabal: Core library
- libraries/mtl/mtl.cabal: Dependency of ``Cabal`` library
- libraries/parsec/parsec.cabal: Dependency of ``Cabal`` library
- libraries/pretty/pretty.cabal: Dependency of ``ghc`` library
- libraries/process/process.cabal: Dependency of ``ghc`` library
- libraries/stm/stm.cabal: Dependency of ``haskeline`` library
- libraries/template-haskell/template-haskell.cabal: Core library
- libraries/terminfo/terminfo.cabal: Dependency of ``haskeline`` library
- libraries/text/text.cabal: Dependency of ``Cabal`` library
- libraries/time/time.cabal: Dependency of ``ghc`` library
- libraries/transformers/transformers.cabal: Dependency of ``ghc`` library
- libraries/unix/unix.cabal: Dependency of ``ghc`` library
- libraries/Win32/Win32.cabal: Dependency of ``ghc`` library
- libraries/xhtml/xhtml.cabal: Dependency of ``haddock`` executable
- libraries/os-string/os-string.cabal: Dependency of ``filepath`` library
- libraries/file-io/file-io.cabal: Dependency of ``directory`` library
=====================================
docs/users_guide/9.16.1-notes.rst
=====================================
@@ -0,0 +1,21 @@
+.. _release-9-16-1:
+
+Version 9.16.1
+==============
+
+The significant changes to the various parts of the compiler are listed in the
+following sections. See the `migration guide
+<https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.14>`_ on the GHC Wiki
+for specific guidance on migrating programs to this release.
+
+Compiler
+~~~~~~~~
+
+- Code coverage's (:ghc-flag:`-fhpc`) treatment of record fields now extends
+ beyond record fields accessed via :extension:`RecordWildCards` and
+ :extension:`NamedFieldPuns`, and also handles access to nested record fields.
+ That is, in a pattern such as ``Foo{bar = Bar{baz = b}}`` both ``bar`` and
+ ``baz`` will now be marked as covered if ``b`` is evaluated. Note that this
+ currently only works when record fields (or values contained within them) are
+ bound to variables. The very similar pattern ``Foo{bar = Bar{baz = 42}}``
+ will will not yet mark ``bar`` or ``baz`` as covered.
=====================================
docs/users_guide/release-notes.rst
=====================================
@@ -4,4 +4,4 @@ Release notes
.. toctree::
:maxdepth: 1
- 9.14.1-notes
+ 9.16.1-notes
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3631eb1b02251ca69a0c959930bb4a3…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3631eb1b02251ca69a0c959930bb4a3…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/fendor/ccs-index-table] HashTable in IndexTable
by Hannes Siebenhandl (@fendor) 05 Aug '25
by Hannes Siebenhandl (@fendor) 05 Aug '25
05 Aug '25
Hannes Siebenhandl pushed to branch wip/fendor/ccs-index-table at Glasgow Haskell Compiler / GHC
Commits:
b328b307 by fendor at 2025-08-05T09:03:05+02:00
HashTable in IndexTable
- - - - -
15 changed files:
- libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/PeekProfInfo_ProfilingEnabled.hsc
- rts/Hash.c
- rts/Hash.h
- + rts/IndexTable.c
- rts/ProfilerReport.c
- rts/ProfilerReportJson.c
- rts/Profiling.c
- rts/Profiling.h
- rts/include/Rts.h
- rts/include/rts/prof/CCS.h
- + rts/include/rts/prof/IndexTable.h
- rts/rts.cabal
- testsuite/tests/perf/should_run/T26147.stdout
- testsuite/tests/perf/should_run/all.T
- testsuite/tests/perf/should_run/genT26147
Changes:
=====================================
libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/PeekProfInfo_ProfilingEnabled.hsc
=====================================
@@ -138,21 +138,21 @@ peekCostCentre costCenterCacheRef ptr = do
peekIndexTable :: AddressSet -> IORef (AddressMap CostCentre) -> Ptr indexTable -> IO (Maybe IndexTable)
peekIndexTable _ _ ptr | ptr == nullPtr = return Nothing
-peekIndexTable loopBreakers costCenterCacheRef ptr = do
- it_cc_ptr <- (#peek struct IndexTable_, cc) ptr
- it_cc' <- peekCostCentre costCenterCacheRef it_cc_ptr
- it_ccs_ptr <- (#peek struct IndexTable_, ccs) ptr
- it_ccs' <- peekCostCentreStack loopBreakers costCenterCacheRef it_ccs_ptr
- it_next_ptr <- (#peek struct IndexTable_, next) ptr
- it_next' <- peekIndexTable loopBreakers costCenterCacheRef it_next_ptr
- it_back_edge' <- (#peek struct IndexTable_, back_edge) ptr
-
- return $ Just IndexTable {
- it_cc = it_cc',
- it_ccs = it_ccs',
- it_next = it_next',
- it_back_edge = it_back_edge'
- }
+peekIndexTable _ _ _ = pure Nothing
+ -- it_cc_ptr <- (#peek struct IndexTable_, cc) ptr
+ -- it_cc' <- peekCostCentre costCenterCacheRef it_cc_ptr
+ -- it_ccs_ptr <- (#peek struct IndexTable_, ccs) ptr
+ -- it_ccs' <- peekCostCentreStack loopBreakers costCenterCacheRef it_ccs_ptr
+ -- it_next_ptr <- (#peek struct IndexTable_, next) ptr
+ -- it_next' <- peekIndexTable loopBreakers costCenterCacheRef it_next_ptr
+ -- it_back_edge' <- (#peek struct IndexTable_, back_edge) ptr
+
+ -- return $ Just IndexTable {
+ -- it_cc = it_cc',
+ -- it_ccs = it_ccs',
+ -- it_next = it_next',
+ -- it_back_edge = it_back_edge'
+ -- }
-- | casts a @Ptr@ to an @Int@
ptrToInt :: Ptr a -> Int
=====================================
rts/Hash.c
=====================================
@@ -515,6 +515,52 @@ mapHashTableKeys(HashTable *table, void *data, MapHashFnKeys fn)
}
}
+void initHashIterator(HashTable *table, struct HashIterator_* iter) {
+ /* The last bucket with something in it is table->max + table->split - 1 */
+ long segment = (table->max + table->split - 1) / HSEGSIZE;
+ long index = (table->max + table->split - 1) % HSEGSIZE;
+ iter->table = table;
+ iter->segment = segment;
+ iter->index = index;
+ iter->data = NULL;
+}
+
+struct HashIterator_* hashTableIterator(HashTable *table) {
+ struct HashIterator_* iter;
+ iter = stgMallocBytes(sizeof(HashIterator),"hashTableIterator");
+ initHashIterator(table, iter);
+ return iter;
+}
+
+const void *hashIteratorItem(struct HashIterator_* iter) {
+ return iter->data;
+}
+
+int hashIteratorNext(struct HashIterator_* iter) {
+ long segment = iter->segment;
+ long index = iter->index;
+
+ while (segment >= 0) {
+ while (index >= 0) {
+ for (HashList *hl = iter->table->dir[segment][index]; hl != NULL; hl = hl->next) {
+ iter->segment = segment;
+ /* make sure we advance the index */
+ iter->index = index - 1;
+ iter->data = hl->data;
+ return 1;
+ }
+ index--;
+ }
+ segment--;
+ index = HSEGSIZE - 1;
+ }
+ return 0;
+}
+
+void freeHashIterator(struct HashIterator_* iter) {
+ stgFree(iter);
+}
+
void
iterHashTable(HashTable *table, void *data, IterHashFn fn)
{
@@ -536,6 +582,7 @@ iterHashTable(HashTable *table, void *data, IterHashFn fn)
}
}
+
/* -----------------------------------------------------------------------------
* When we initialize a hash table, we set up the first segment as well,
* initializing all of the first segment's hash buckets to NULL.
=====================================
rts/Hash.h
=====================================
@@ -42,6 +42,21 @@ void mapHashTable(HashTable *table, void *data, MapHashFn fn);
void mapHashTableKeys(HashTable *table, void *data, MapHashFnKeys fn);
void iterHashTable(HashTable *table, void *data, IterHashFn);
+struct HashIterator_ {
+ HashTable *table;
+ long segment;
+ long index;
+ const void* data;
+};
+typedef struct HashIterator_ HashIterator;
+
+void initHashIterator(HashTable *, struct HashIterator_*);
+struct HashIterator_* hashTableIterator(HashTable *table);
+const void *hashIteratorItem(struct HashIterator_* iter);
+int hashIteratorNext(struct HashIterator_* iter);
+void freeHashIterator(struct HashIterator_* iter);
+
+
/* Hash table access where the keys are C strings (the strings are
* assumed to be allocated by the caller, and mustn't be deallocated
* until the corresponding hash table entry has been removed).
=====================================
rts/IndexTable.c
=====================================
@@ -0,0 +1,116 @@
+#if defined(PROFILING)
+
+#include "Rts.h"
+#include "rts/prof/IndexTable.h"
+#include "RtsFlags.h"
+#include "RtsUtils.h"
+#include "rts/PosixSource.h"
+#include "rts/prof/CCS.h"
+#include "Hash.h"
+#include "assert.h"
+
+#include "Profiling.h"
+#include "Arena.h"
+
+#include <fs_rts.h>
+#include <string.h>
+
+#if defined(DEBUG) || defined(PROFILING)
+#include "Trace.h"
+#endif
+
+
+typedef struct IndexTable_ IndexTable;
+
+void
+freeIndexTable(IndexTable * it) {
+ assert(it != EMPTY_TABLE);
+ if (it != EMPTY_TABLE && it->children != NULL) {
+ freeHashTable(it->children, NULL);
+ it->children = NULL;
+ }
+}
+
+CostCentreStack *
+isInIndexTable(IndexTable *it, CostCentre *cc) {
+ if (EMPTY_TABLE == it) {
+ return EMPTY_TABLE;
+ }
+ if (NULL == it->children) {
+ return EMPTY_TABLE;
+ }
+
+ IndexTableNode * node;
+ node = (IndexTableNode *) lookupHashTable(it->children, (StgWord) cc->ccID);
+ if (node == NULL) {
+ /* Not found */
+ return EMPTY_TABLE;
+ }
+ return node->ccs;
+}
+
+
+IndexTable *
+addToIndexTable(IndexTable *it, CostCentreStack *new_ccs,
+ CostCentre *cc, bool back_edge) {
+ if (it == EMPTY_TABLE) {
+ it = arenaAlloc(prof_arena, sizeof(IndexTable));
+ it->children = NULL;
+ }
+ assert(it != EMPTY_TABLE);
+
+ IndexTableNode *node;
+ node = arenaAlloc(prof_arena, sizeof(IndexTableNode));
+
+ node->cc = cc;
+ node->ccs = new_ccs;
+ node->back_edge = back_edge;
+
+ if (it->children == NULL) {
+ it->children = allocHashTable();
+ }
+
+ insertHashTable(it->children, (StgWord) node->cc->ccID, (const void *) node);
+
+ return it;
+}
+
+struct IndexTableIter_ {
+ struct HashIterator_ *iterator;
+};
+
+IndexTableIter*
+indexTableIterator(IndexTable *it) {
+ IndexTableIter *iter;
+ HashIterator *hashIter = NULL;
+ iter = arenaAlloc(prof_arena, sizeof(IndexTableIter));
+
+ if (it != EMPTY_TABLE && it->children != NULL) {
+ hashIter = arenaAlloc(prof_arena, sizeof(struct HashIterator_));
+ initHashIterator(it->children, hashIter);
+ }
+
+ iter->iterator = hashIter;
+ return iter;
+}
+
+int
+indexTableIterNext (IndexTableIter *iter) {
+ assert(iter != NULL);
+ if (iter->iterator == NULL) {
+ return 0;
+ }
+ return hashIteratorNext(iter->iterator);
+};
+
+
+IndexTableNode*
+indexTableIterItem(IndexTableIter *it) {
+ assert(it != NULL);
+ if (it->iterator == NULL) {
+ return EMPTY_TABLE;
+ }
+ return (IndexTableNode *) hashIteratorItem(it->iterator);
+}
+
+#endif /* PROFILING */
=====================================
rts/ProfilerReport.c
=====================================
@@ -14,6 +14,7 @@
#include "RtsUtils.h"
#include "ProfilerReport.h"
#include "Profiling.h"
+#include "rts/prof/IndexTable.h"
static uint32_t numDigits ( StgInt i );
static void findCCSMaxLens ( CostCentreStack const *ccs,
@@ -189,7 +190,7 @@ static void
findCCSMaxLens(CostCentreStack const *ccs, uint32_t indent, uint32_t *max_label_len,
uint32_t *max_module_len, uint32_t *max_src_len, uint32_t *max_id_len) {
CostCentre *cc;
- IndexTable *i;
+ IndexTableIter *i;
cc = ccs->cc;
@@ -198,14 +199,17 @@ findCCSMaxLens(CostCentreStack const *ccs, uint32_t indent, uint32_t *max_label_
*max_src_len = stg_max(*max_src_len, strlen_utf8(cc->srcloc));
*max_id_len = stg_max(*max_id_len, numDigits(ccs->ccsID));
- for (i = ccs->indexTable; i != 0; i = i->next) {
- if (!i->back_edge) {
- findCCSMaxLens(i->ccs, indent+1,
+ for ( i = indexTableIterator(ccs->indexTable)
+ ; indexTableIterNext(i) != 0
+ ; ) {
+ if (!indexTableIterItem(i)->back_edge) {
+ findCCSMaxLens(indexTableIterItem(i)->ccs, indent+1,
max_label_len, max_module_len, max_src_len, max_id_len);
}
}
}
+
static void
logCCS(FILE *prof_file, CostCentreStack const *ccs, ProfilerTotals totals,
uint32_t indent,
@@ -213,7 +217,7 @@ logCCS(FILE *prof_file, CostCentreStack const *ccs, ProfilerTotals totals,
uint32_t max_src_len, uint32_t max_id_len)
{
CostCentre *cc;
- IndexTable *i;
+ IndexTableIter *i;
cc = ccs->cc;
@@ -248,9 +252,11 @@ logCCS(FILE *prof_file, CostCentreStack const *ccs, ProfilerTotals totals,
fprintf(prof_file, "\n");
}
- for (i = ccs->indexTable; i != 0; i = i->next) {
- if (!i->back_edge) {
- logCCS(prof_file, i->ccs, totals, indent+1,
+ for ( i = indexTableIterator(ccs->indexTable)
+ ; indexTableIterNext(i) != 0
+ ; ) {
+ if (!indexTableIterItem(i)->back_edge) {
+ logCCS(prof_file, indexTableIterItem(i)->ccs, totals, indent+1,
max_label_len, max_module_len, max_src_len, max_id_len);
}
}
=====================================
rts/ProfilerReportJson.c
=====================================
@@ -6,6 +6,7 @@
*
* ---------------------------------------------------------------------------*/
+#include <stdio.h>
#if defined(PROFILING)
#include "rts/PosixSource.h"
@@ -14,6 +15,7 @@
#include "RtsUtils.h"
#include "ProfilerReportJson.h"
#include "Profiling.h"
+#include "rts/prof/IndexTable.h"
#include <string.h>
@@ -232,12 +234,14 @@ logCostCentreStack(FILE *prof_file, CostCentreStack const *ccs)
bool need_comma = false;
fprintf(prof_file, "\"children\": [");
- for (IndexTable *i = ccs->indexTable; i != 0; i = i->next) {
- if (!i->back_edge) {
+ for ( IndexTableIter *i = indexTableIterator(ccs->indexTable)
+ ; indexTableIterNext(i) != 0
+ ; ) {
+ if (!indexTableIterItem(i)->back_edge) {
if (need_comma) {
fprintf(prof_file, ",");
}
- logCostCentreStack(prof_file, i->ccs);
+ logCostCentreStack(prof_file, indexTableIterItem(i)->ccs);
need_comma = true;
}
}
=====================================
rts/Profiling.c
=====================================
@@ -22,6 +22,7 @@
#include "ProfilerReportJson.h"
#include "Printer.h"
#include "Capability.h"
+#include "rts/prof/IndexTable.h"
#include <fs_rts.h>
#include <string.h>
@@ -33,11 +34,11 @@
/*
* Profiling allocation arena.
*/
-#if defined(DEBUG)
+// #if defined(DEBUG)
Arena *prof_arena;
-#else
-static Arena *prof_arena;
-#endif
+// #else
+// static Arena *prof_arena;
+// #endif
/*
* Global variables used to assign unique IDs to cc's, ccs's, and
@@ -119,9 +120,6 @@ static CostCentreStack * checkLoop ( CostCentreStack *ccs,
static void sortCCSTree ( CostCentreStack *ccs );
static CostCentreStack * pruneCCSTree ( CostCentreStack *ccs );
static CostCentreStack * actualPush ( CostCentreStack *, CostCentre * );
-static CostCentreStack * isInIndexTable ( IndexTable *, CostCentre * );
-static IndexTable * addToIndexTable ( IndexTable *, CostCentreStack *,
- CostCentre *, bool );
static void ccsSetSelected ( CostCentreStack *ccs );
static void aggregateCCCosts( CostCentreStack *ccs );
static void registerCC ( CostCentre *cc );
@@ -621,13 +619,13 @@ static CostCentreStack *
actualPush_ (CostCentreStack *ccs, CostCentre *cc, CostCentreStack *new_ccs)
{
/* assign values to each member of the structure */
+ new_ccs->indexTable = 0;
new_ccs->ccsID = CCS_ID++;
new_ccs->cc = cc;
new_ccs->prevStack = ccs;
new_ccs->root = ccs->root;
new_ccs->depth = ccs->depth + 1;
- new_ccs->indexTable = EMPTY_TABLE;
/* Initialise the various _scc_ counters to zero
*/
@@ -652,38 +650,6 @@ actualPush_ (CostCentreStack *ccs, CostCentre *cc, CostCentreStack *new_ccs)
return new_ccs;
}
-
-static CostCentreStack *
-isInIndexTable(IndexTable *it, CostCentre *cc)
-{
- while (it!=EMPTY_TABLE)
- {
- if (it->cc == cc)
- return it->ccs;
- else
- it = it->next;
- }
-
- /* otherwise we never found it so return EMPTY_TABLE */
- return EMPTY_TABLE;
-}
-
-
-static IndexTable *
-addToIndexTable (IndexTable *it, CostCentreStack *new_ccs,
- CostCentre *cc, bool back_edge)
-{
- IndexTable *new_it;
-
- new_it = arenaAlloc(prof_arena, sizeof(IndexTable));
-
- new_it->cc = cc;
- new_it->ccs = new_ccs;
- new_it->next = it;
- new_it->back_edge = back_edge;
- return new_it;
-}
-
/* -----------------------------------------------------------------------------
Generating a time & allocation profiling report.
-------------------------------------------------------------------------- */
@@ -744,9 +710,11 @@ countTickss_(CostCentreStack const *ccs, ProfilerTotals *totals)
totals->total_alloc += ccs->mem_alloc;
totals->total_prof_ticks += ccs->time_ticks;
}
- for (IndexTable *i = ccs->indexTable; i != NULL; i = i->next) {
- if (!i->back_edge) {
- countTickss_(i->ccs, totals);
+ for ( IndexTableIter *i = indexTableIterator(ccs->indexTable)
+ ; indexTableIterNext(i) != 0
+ ; ) {
+ if (!indexTableIterItem(i)->back_edge) {
+ countTickss_(indexTableIterItem(i)->ccs, totals);
}
}
}
@@ -767,18 +735,19 @@ countTickss(CostCentreStack const *ccs)
static void
inheritCosts(CostCentreStack *ccs)
{
- IndexTable *i;
if (ignoreCCS(ccs)) { return; }
ccs->inherited_ticks += ccs->time_ticks;
ccs->inherited_alloc += ccs->mem_alloc;
- for (i = ccs->indexTable; i != NULL; i = i->next)
- if (!i->back_edge) {
- inheritCosts(i->ccs);
- ccs->inherited_ticks += i->ccs->inherited_ticks;
- ccs->inherited_alloc += i->ccs->inherited_alloc;
+ for ( IndexTableIter *i = indexTableIterator(ccs->indexTable)
+ ; indexTableIterNext(i) != 0
+ ; )
+ if (!indexTableIterItem(i)->back_edge) {
+ inheritCosts(indexTableIterItem(i)->ccs);
+ ccs->inherited_ticks += indexTableIterItem(i)->ccs->inherited_ticks;
+ ccs->inherited_alloc += indexTableIterItem(i)->ccs->inherited_alloc;
}
return;
@@ -787,14 +756,14 @@ inheritCosts(CostCentreStack *ccs)
static void
aggregateCCCosts( CostCentreStack *ccs )
{
- IndexTable *i;
-
ccs->cc->mem_alloc += ccs->mem_alloc;
ccs->cc->time_ticks += ccs->time_ticks;
- for (i = ccs->indexTable; i != 0; i = i->next) {
- if (!i->back_edge) {
- aggregateCCCosts(i->ccs);
+ for ( IndexTableIter *i = indexTableIterator(ccs->indexTable)
+ ; indexTableIterNext(i) != 0
+ ; ) {
+ if (!indexTableIterItem(i)->back_edge) {
+ aggregateCCCosts(indexTableIterItem(i)->ccs);
}
}
}
@@ -806,19 +775,22 @@ aggregateCCCosts( CostCentreStack *ccs )
static CostCentreStack *
pruneCCSTree (CostCentreStack *ccs)
{
- CostCentreStack *ccs1;
- IndexTable *i, **prev;
+ // CostCentreStack *ccs1;
+ // IndexTable *i, **prev;
- prev = &ccs->indexTable;
- for (i = ccs->indexTable; i != 0; i = i->next) {
- if (i->back_edge) { continue; }
+ // prev = &ccs->indexTable;
+ for ( IndexTableIter *i = indexTableIterator(ccs->indexTable)
+ ; indexTableIterNext(i) != 0
+ ; ) {
+ if (indexTableIterItem(i)->back_edge) { continue; }
- ccs1 = pruneCCSTree(i->ccs);
- if (ccs1 == NULL) {
- *prev = i->next;
- } else {
- prev = &(i->next);
- }
+ // TODO: @fendor implement pruning
+ // ccs1 = pruneCCSTree(indexTableIterItem(i)->ccs);
+ // if (ccs1 == NULL) {
+ // *prev = i->next;
+ // } else {
+ // prev = &(i->next);
+ // }
}
if ( (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_ALL
@@ -833,59 +805,62 @@ pruneCCSTree (CostCentreStack *ccs)
}
}
-static IndexTable*
-insertIndexTableInSortedList(IndexTable* tbl, IndexTable* sortedList)
-{
- StgWord tbl_ticks = tbl->ccs->scc_count;
- char* tbl_label = tbl->ccs->cc->label;
-
- IndexTable *prev = NULL;
- IndexTable *cursor = sortedList;
-
- while (cursor != NULL) {
- StgWord cursor_ticks = cursor->ccs->scc_count;
- char* cursor_label = cursor->ccs->cc->label;
-
- if (tbl_ticks > cursor_ticks ||
- (tbl_ticks == cursor_ticks && strcmp(tbl_label, cursor_label) < 0)) {
- if (prev == NULL) {
- tbl->next = sortedList;
- return tbl;
- } else {
- prev->next = tbl;
- tbl->next = cursor;
- return sortedList;
- }
- } else {
- prev = cursor;
- cursor = cursor->next;
- }
- }
-
- prev->next = tbl;
- return sortedList;
-}
+// static IndexTable*
+// insertIndexTableInSortedList(IndexTable* tbl, IndexTable* sortedList)
+// {
+// StgWord tbl_ticks = tbl->ccs->scc_count;
+// char* tbl_label = tbl->ccs->cc->label;
+
+// IndexTable *prev = NULL;
+// IndexTable *cursor = sortedList;
+
+// while (cursor != NULL) {
+// StgWord cursor_ticks = cursor->ccs->scc_count;
+// char* cursor_label = cursor->ccs->cc->label;
+
+// if (tbl_ticks > cursor_ticks ||
+// (tbl_ticks == cursor_ticks && strcmp(tbl_label, cursor_label) < 0)) {
+// if (prev == NULL) {
+// tbl->next = sortedList;
+// return tbl;
+// } else {
+// prev->next = tbl;
+// tbl->next = cursor;
+// return sortedList;
+// }
+// } else {
+// prev = cursor;
+// cursor = cursor->next;
+// }
+// }
+
+// prev->next = tbl;
+// return sortedList;
+// }
static void
sortCCSTree(CostCentreStack *ccs)
{
if (ccs->indexTable == NULL) return;
- for (IndexTable *tbl = ccs->indexTable; tbl != NULL; tbl = tbl->next)
- if (!tbl->back_edge)
- sortCCSTree(tbl->ccs);
+ for ( IndexTableIter *iter = indexTableIterator(ccs->indexTable)
+ ; indexTableIterNext(iter) != 0
+ ; )
+ if (!indexTableIterItem(iter)->back_edge)
+ sortCCSTree(indexTableIterItem(iter)->ccs);
IndexTable *sortedList = ccs->indexTable;
- IndexTable *nonSortedList = sortedList->next;
- sortedList->next = NULL;
-
- while (nonSortedList != NULL)
- {
- IndexTable *nonSortedTail = nonSortedList->next;
- nonSortedList->next = NULL;
- sortedList = insertIndexTableInSortedList(nonSortedList, sortedList);
- nonSortedList = nonSortedTail;
- }
+ // TODO @fendor: reimplement sorting
+ // IndexTable *nonSortedList = sortedList->next;
+ // sortedList->next = NULL;
+
+ // while (nonSortedList != NULL)
+ // {
+ // IndexTable *nonSortedTail = nonSortedList->next;
+ // nonSortedList->next = NULL;
+ // sortedList = insertIndexTableInSortedList(nonSortedList, sortedList);
+ // nonSortedList = nonSortedTail;
+ // }
ccs->indexTable = sortedList;
}
=====================================
rts/Profiling.h
=====================================
@@ -11,9 +11,9 @@
#include <stdio.h>
#include "Rts.h"
-#if defined(DEBUG)
+// #if defined(DEBUG)
#include "Arena.h"
-#endif
+// #endif
#include "BeginPrivate.h"
@@ -49,9 +49,9 @@ void fprintCCS_stderr (CostCentreStack *ccs, StgClosure *exception, StgTSO *tso)
bool ignoreCCS (CostCentreStack const *ccs);
bool ignoreCC (CostCentre const *cc);
-#if defined(DEBUG)
extern Arena *prof_arena;
+#if defined(DEBUG)
void debugCCS( CostCentreStack *ccs );
#endif
=====================================
rts/include/Rts.h
=====================================
@@ -231,6 +231,7 @@ void _warnFail(const char *filename, unsigned int linenum);
/* Profiling information */
#include "rts/prof/CCS.h"
+#include "rts/prof/IndexTable.h"
#include "rts/prof/Heap.h"
#include "rts/prof/LDV.h"
=====================================
rts/include/rts/prof/CCS.h
=====================================
@@ -99,27 +99,6 @@ void startProfTimer ( void );
/* Constants used to set is_caf flag on CostCentres */
#define CC_IS_CAF true
#define CC_NOT_CAF false
-/* -----------------------------------------------------------------------------
- * Data Structures
- * ---------------------------------------------------------------------------*/
-
-// IndexTable is the list of children of a CCS. (Alternatively it is a
-// cache of the results of pushing onto a CCS, so that the second and
-// subsequent times we push a certain CC on a CCS we get the same
-// result).
-
-typedef struct IndexTable_ {
- // Just a linked list of (cc, ccs) pairs, where the `ccs` is the result of
- // pushing `cc` to the owner of the index table (another CostCentreStack).
- CostCentre *cc;
- CostCentreStack *ccs;
- struct IndexTable_ *next;
- // back_edge is true when `cc` is already in the stack, so pushing it
- // truncates or drops (see RECURSION_DROPS and RECURSION_TRUNCATES in
- // Profiling.c).
- bool back_edge;
-} IndexTable;
-
/* -----------------------------------------------------------------------------
Pre-defined cost centres and cost centre stacks
=====================================
rts/include/rts/prof/IndexTable.h
=====================================
@@ -0,0 +1,51 @@
+#pragma once
+
+/* -----------------------------------------------------------------------------
+ * Data Structures
+ * ---------------------------------------------------------------------------*/
+
+// IndexTable is the list of children of a CCS. (Alternatively it is a
+// cache of the results of pushing onto a CCS, so that the second and
+// subsequent times we push a certain CC on a CCS we get the same
+// result).
+
+typedef struct IndexTableNode_ {
+ // Just a linked list of (cc, ccs) pairs, where the `ccs` is the result of
+ // pushing `cc` to the owner of the index table (another CostCentreStack).
+ CostCentre *cc;
+ CostCentreStack *ccs;
+ // back_edge is true when `cc` is already in the stack, so pushing it
+ // truncates or drops (see RECURSION_DROPS and RECURSION_TRUNCATES in
+ // Profiling.c).
+ bool back_edge;
+} IndexTableNode;
+
+typedef struct IndexTableNode_ IndexTableNode;
+
+typedef struct IndexTable_ {
+ // IndexTableNode *node;
+ // // Just a linked list of (cc, ccs) pairs, where the `ccs` is the result of
+ // // pushing `cc` to the owner of the index table (another CostCentreStack).
+ // CostCentre *cc;
+ // CostCentreStack *ccs;
+ // // back_edge is true when `cc` is already in the stack, so pushing it
+ // // truncates or drops (see RECURSION_DROPS and RECURSION_TRUNCATES in
+ // // Profiling.c).
+ // bool back_edge;
+ struct hashtable *children;
+} IndexTable;
+
+typedef struct IndexTable_ IndexTable;
+
+IndexTable * allocateIndexTable( void );
+void freeIndexTable( IndexTable * );
+CostCentreStack * isInIndexTable ( IndexTable *, CostCentre * );
+IndexTable * addToIndexTable ( IndexTable *, CostCentreStack *,
+ CostCentre *, bool );
+
+typedef struct IndexTableIter_ IndexTableIter;
+
+
+IndexTableIter* indexTableIterator ( IndexTable * );
+int indexTableIterNext ( IndexTableIter * );
+IndexTableNode* indexTableIterItem ( IndexTableIter * );
=====================================
rts/rts.cabal
=====================================
@@ -322,6 +322,7 @@ library
rts/Utils.h
rts/prof/CCS.h
rts/prof/Heap.h
+ rts/prof/IndexTable.h
rts/prof/LDV.h
rts/storage/Block.h
rts/storage/ClosureMacros.h
@@ -436,6 +437,7 @@ library
ProfilerReport.c
ProfilerReportJson.c
Profiling.c
+ IndexTable.c
IPE.c
Proftimer.c
RaiseAsync.c
=====================================
testsuite/tests/perf/should_run/T26147.stdout
=====================================
@@ -1,1001 +1 @@
-Test value: 0
-Test value: 1
-Test value: 2
-Test value: 3
-Test value: 4
-Test value: 5
-Test value: 6
-Test value: 7
-Test value: 8
-Test value: 9
-Test value: 10
-Test value: 11
-Test value: 12
-Test value: 13
-Test value: 14
-Test value: 15
-Test value: 16
-Test value: 17
-Test value: 18
-Test value: 19
-Test value: 20
-Test value: 21
-Test value: 22
-Test value: 23
-Test value: 24
-Test value: 25
-Test value: 26
-Test value: 27
-Test value: 28
-Test value: 29
-Test value: 30
-Test value: 31
-Test value: 32
-Test value: 33
-Test value: 34
-Test value: 35
-Test value: 36
-Test value: 37
-Test value: 38
-Test value: 39
-Test value: 40
-Test value: 41
-Test value: 42
-Test value: 43
-Test value: 44
-Test value: 45
-Test value: 46
-Test value: 47
-Test value: 48
-Test value: 49
-Test value: 50
-Test value: 51
-Test value: 52
-Test value: 53
-Test value: 54
-Test value: 55
-Test value: 56
-Test value: 57
-Test value: 58
-Test value: 59
-Test value: 60
-Test value: 61
-Test value: 62
-Test value: 63
-Test value: 64
-Test value: 65
-Test value: 66
-Test value: 67
-Test value: 68
-Test value: 69
-Test value: 70
-Test value: 71
-Test value: 72
-Test value: 73
-Test value: 74
-Test value: 75
-Test value: 76
-Test value: 77
-Test value: 78
-Test value: 79
-Test value: 80
-Test value: 81
-Test value: 82
-Test value: 83
-Test value: 84
-Test value: 85
-Test value: 86
-Test value: 87
-Test value: 88
-Test value: 89
-Test value: 90
-Test value: 91
-Test value: 92
-Test value: 93
-Test value: 94
-Test value: 95
-Test value: 96
-Test value: 97
-Test value: 98
-Test value: 99
-Test value: 100
-Test value: 101
-Test value: 102
-Test value: 103
-Test value: 104
-Test value: 105
-Test value: 106
-Test value: 107
-Test value: 108
-Test value: 109
-Test value: 110
-Test value: 111
-Test value: 112
-Test value: 113
-Test value: 114
-Test value: 115
-Test value: 116
-Test value: 117
-Test value: 118
-Test value: 119
-Test value: 120
-Test value: 121
-Test value: 122
-Test value: 123
-Test value: 124
-Test value: 125
-Test value: 126
-Test value: 127
-Test value: 128
-Test value: 129
-Test value: 130
-Test value: 131
-Test value: 132
-Test value: 133
-Test value: 134
-Test value: 135
-Test value: 136
-Test value: 137
-Test value: 138
-Test value: 139
-Test value: 140
-Test value: 141
-Test value: 142
-Test value: 143
-Test value: 144
-Test value: 145
-Test value: 146
-Test value: 147
-Test value: 148
-Test value: 149
-Test value: 150
-Test value: 151
-Test value: 152
-Test value: 153
-Test value: 154
-Test value: 155
-Test value: 156
-Test value: 157
-Test value: 158
-Test value: 159
-Test value: 160
-Test value: 161
-Test value: 162
-Test value: 163
-Test value: 164
-Test value: 165
-Test value: 166
-Test value: 167
-Test value: 168
-Test value: 169
-Test value: 170
-Test value: 171
-Test value: 172
-Test value: 173
-Test value: 174
-Test value: 175
-Test value: 176
-Test value: 177
-Test value: 178
-Test value: 179
-Test value: 180
-Test value: 181
-Test value: 182
-Test value: 183
-Test value: 184
-Test value: 185
-Test value: 186
-Test value: 187
-Test value: 188
-Test value: 189
-Test value: 190
-Test value: 191
-Test value: 192
-Test value: 193
-Test value: 194
-Test value: 195
-Test value: 196
-Test value: 197
-Test value: 198
-Test value: 199
-Test value: 200
-Test value: 201
-Test value: 202
-Test value: 203
-Test value: 204
-Test value: 205
-Test value: 206
-Test value: 207
-Test value: 208
-Test value: 209
-Test value: 210
-Test value: 211
-Test value: 212
-Test value: 213
-Test value: 214
-Test value: 215
-Test value: 216
-Test value: 217
-Test value: 218
-Test value: 219
-Test value: 220
-Test value: 221
-Test value: 222
-Test value: 223
-Test value: 224
-Test value: 225
-Test value: 226
-Test value: 227
-Test value: 228
-Test value: 229
-Test value: 230
-Test value: 231
-Test value: 232
-Test value: 233
-Test value: 234
-Test value: 235
-Test value: 236
-Test value: 237
-Test value: 238
-Test value: 239
-Test value: 240
-Test value: 241
-Test value: 242
-Test value: 243
-Test value: 244
-Test value: 245
-Test value: 246
-Test value: 247
-Test value: 248
-Test value: 249
-Test value: 250
-Test value: 251
-Test value: 252
-Test value: 253
-Test value: 254
-Test value: 255
-Test value: 256
-Test value: 257
-Test value: 258
-Test value: 259
-Test value: 260
-Test value: 261
-Test value: 262
-Test value: 263
-Test value: 264
-Test value: 265
-Test value: 266
-Test value: 267
-Test value: 268
-Test value: 269
-Test value: 270
-Test value: 271
-Test value: 272
-Test value: 273
-Test value: 274
-Test value: 275
-Test value: 276
-Test value: 277
-Test value: 278
-Test value: 279
-Test value: 280
-Test value: 281
-Test value: 282
-Test value: 283
-Test value: 284
-Test value: 285
-Test value: 286
-Test value: 287
-Test value: 288
-Test value: 289
-Test value: 290
-Test value: 291
-Test value: 292
-Test value: 293
-Test value: 294
-Test value: 295
-Test value: 296
-Test value: 297
-Test value: 298
-Test value: 299
-Test value: 300
-Test value: 301
-Test value: 302
-Test value: 303
-Test value: 304
-Test value: 305
-Test value: 306
-Test value: 307
-Test value: 308
-Test value: 309
-Test value: 310
-Test value: 311
-Test value: 312
-Test value: 313
-Test value: 314
-Test value: 315
-Test value: 316
-Test value: 317
-Test value: 318
-Test value: 319
-Test value: 320
-Test value: 321
-Test value: 322
-Test value: 323
-Test value: 324
-Test value: 325
-Test value: 326
-Test value: 327
-Test value: 328
-Test value: 329
-Test value: 330
-Test value: 331
-Test value: 332
-Test value: 333
-Test value: 334
-Test value: 335
-Test value: 336
-Test value: 337
-Test value: 338
-Test value: 339
-Test value: 340
-Test value: 341
-Test value: 342
-Test value: 343
-Test value: 344
-Test value: 345
-Test value: 346
-Test value: 347
-Test value: 348
-Test value: 349
-Test value: 350
-Test value: 351
-Test value: 352
-Test value: 353
-Test value: 354
-Test value: 355
-Test value: 356
-Test value: 357
-Test value: 358
-Test value: 359
-Test value: 360
-Test value: 361
-Test value: 362
-Test value: 363
-Test value: 364
-Test value: 365
-Test value: 366
-Test value: 367
-Test value: 368
-Test value: 369
-Test value: 370
-Test value: 371
-Test value: 372
-Test value: 373
-Test value: 374
-Test value: 375
-Test value: 376
-Test value: 377
-Test value: 378
-Test value: 379
-Test value: 380
-Test value: 381
-Test value: 382
-Test value: 383
-Test value: 384
-Test value: 385
-Test value: 386
-Test value: 387
-Test value: 388
-Test value: 389
-Test value: 390
-Test value: 391
-Test value: 392
-Test value: 393
-Test value: 394
-Test value: 395
-Test value: 396
-Test value: 397
-Test value: 398
-Test value: 399
-Test value: 400
-Test value: 401
-Test value: 402
-Test value: 403
-Test value: 404
-Test value: 405
-Test value: 406
-Test value: 407
-Test value: 408
-Test value: 409
-Test value: 410
-Test value: 411
-Test value: 412
-Test value: 413
-Test value: 414
-Test value: 415
-Test value: 416
-Test value: 417
-Test value: 418
-Test value: 419
-Test value: 420
-Test value: 421
-Test value: 422
-Test value: 423
-Test value: 424
-Test value: 425
-Test value: 426
-Test value: 427
-Test value: 428
-Test value: 429
-Test value: 430
-Test value: 431
-Test value: 432
-Test value: 433
-Test value: 434
-Test value: 435
-Test value: 436
-Test value: 437
-Test value: 438
-Test value: 439
-Test value: 440
-Test value: 441
-Test value: 442
-Test value: 443
-Test value: 444
-Test value: 445
-Test value: 446
-Test value: 447
-Test value: 448
-Test value: 449
-Test value: 450
-Test value: 451
-Test value: 452
-Test value: 453
-Test value: 454
-Test value: 455
-Test value: 456
-Test value: 457
-Test value: 458
-Test value: 459
-Test value: 460
-Test value: 461
-Test value: 462
-Test value: 463
-Test value: 464
-Test value: 465
-Test value: 466
-Test value: 467
-Test value: 468
-Test value: 469
-Test value: 470
-Test value: 471
-Test value: 472
-Test value: 473
-Test value: 474
-Test value: 475
-Test value: 476
-Test value: 477
-Test value: 478
-Test value: 479
-Test value: 480
-Test value: 481
-Test value: 482
-Test value: 483
-Test value: 484
-Test value: 485
-Test value: 486
-Test value: 487
-Test value: 488
-Test value: 489
-Test value: 490
-Test value: 491
-Test value: 492
-Test value: 493
-Test value: 494
-Test value: 495
-Test value: 496
-Test value: 497
-Test value: 498
-Test value: 499
-Test value: 500
-Test value: 501
-Test value: 502
-Test value: 503
-Test value: 504
-Test value: 505
-Test value: 506
-Test value: 507
-Test value: 508
-Test value: 509
-Test value: 510
-Test value: 511
-Test value: 512
-Test value: 513
-Test value: 514
-Test value: 515
-Test value: 516
-Test value: 517
-Test value: 518
-Test value: 519
-Test value: 520
-Test value: 521
-Test value: 522
-Test value: 523
-Test value: 524
-Test value: 525
-Test value: 526
-Test value: 527
-Test value: 528
-Test value: 529
-Test value: 530
-Test value: 531
-Test value: 532
-Test value: 533
-Test value: 534
-Test value: 535
-Test value: 536
-Test value: 537
-Test value: 538
-Test value: 539
-Test value: 540
-Test value: 541
-Test value: 542
-Test value: 543
-Test value: 544
-Test value: 545
-Test value: 546
-Test value: 547
-Test value: 548
-Test value: 549
-Test value: 550
-Test value: 551
-Test value: 552
-Test value: 553
-Test value: 554
-Test value: 555
-Test value: 556
-Test value: 557
-Test value: 558
-Test value: 559
-Test value: 560
-Test value: 561
-Test value: 562
-Test value: 563
-Test value: 564
-Test value: 565
-Test value: 566
-Test value: 567
-Test value: 568
-Test value: 569
-Test value: 570
-Test value: 571
-Test value: 572
-Test value: 573
-Test value: 574
-Test value: 575
-Test value: 576
-Test value: 577
-Test value: 578
-Test value: 579
-Test value: 580
-Test value: 581
-Test value: 582
-Test value: 583
-Test value: 584
-Test value: 585
-Test value: 586
-Test value: 587
-Test value: 588
-Test value: 589
-Test value: 590
-Test value: 591
-Test value: 592
-Test value: 593
-Test value: 594
-Test value: 595
-Test value: 596
-Test value: 597
-Test value: 598
-Test value: 599
-Test value: 600
-Test value: 601
-Test value: 602
-Test value: 603
-Test value: 604
-Test value: 605
-Test value: 606
-Test value: 607
-Test value: 608
-Test value: 609
-Test value: 610
-Test value: 611
-Test value: 612
-Test value: 613
-Test value: 614
-Test value: 615
-Test value: 616
-Test value: 617
-Test value: 618
-Test value: 619
-Test value: 620
-Test value: 621
-Test value: 622
-Test value: 623
-Test value: 624
-Test value: 625
-Test value: 626
-Test value: 627
-Test value: 628
-Test value: 629
-Test value: 630
-Test value: 631
-Test value: 632
-Test value: 633
-Test value: 634
-Test value: 635
-Test value: 636
-Test value: 637
-Test value: 638
-Test value: 639
-Test value: 640
-Test value: 641
-Test value: 642
-Test value: 643
-Test value: 644
-Test value: 645
-Test value: 646
-Test value: 647
-Test value: 648
-Test value: 649
-Test value: 650
-Test value: 651
-Test value: 652
-Test value: 653
-Test value: 654
-Test value: 655
-Test value: 656
-Test value: 657
-Test value: 658
-Test value: 659
-Test value: 660
-Test value: 661
-Test value: 662
-Test value: 663
-Test value: 664
-Test value: 665
-Test value: 666
-Test value: 667
-Test value: 668
-Test value: 669
-Test value: 670
-Test value: 671
-Test value: 672
-Test value: 673
-Test value: 674
-Test value: 675
-Test value: 676
-Test value: 677
-Test value: 678
-Test value: 679
-Test value: 680
-Test value: 681
-Test value: 682
-Test value: 683
-Test value: 684
-Test value: 685
-Test value: 686
-Test value: 687
-Test value: 688
-Test value: 689
-Test value: 690
-Test value: 691
-Test value: 692
-Test value: 693
-Test value: 694
-Test value: 695
-Test value: 696
-Test value: 697
-Test value: 698
-Test value: 699
-Test value: 700
-Test value: 701
-Test value: 702
-Test value: 703
-Test value: 704
-Test value: 705
-Test value: 706
-Test value: 707
-Test value: 708
-Test value: 709
-Test value: 710
-Test value: 711
-Test value: 712
-Test value: 713
-Test value: 714
-Test value: 715
-Test value: 716
-Test value: 717
-Test value: 718
-Test value: 719
-Test value: 720
-Test value: 721
-Test value: 722
-Test value: 723
-Test value: 724
-Test value: 725
-Test value: 726
-Test value: 727
-Test value: 728
-Test value: 729
-Test value: 730
-Test value: 731
-Test value: 732
-Test value: 733
-Test value: 734
-Test value: 735
-Test value: 736
-Test value: 737
-Test value: 738
-Test value: 739
-Test value: 740
-Test value: 741
-Test value: 742
-Test value: 743
-Test value: 744
-Test value: 745
-Test value: 746
-Test value: 747
-Test value: 748
-Test value: 749
-Test value: 750
-Test value: 751
-Test value: 752
-Test value: 753
-Test value: 754
-Test value: 755
-Test value: 756
-Test value: 757
-Test value: 758
-Test value: 759
-Test value: 760
-Test value: 761
-Test value: 762
-Test value: 763
-Test value: 764
-Test value: 765
-Test value: 766
-Test value: 767
-Test value: 768
-Test value: 769
-Test value: 770
-Test value: 771
-Test value: 772
-Test value: 773
-Test value: 774
-Test value: 775
-Test value: 776
-Test value: 777
-Test value: 778
-Test value: 779
-Test value: 780
-Test value: 781
-Test value: 782
-Test value: 783
-Test value: 784
-Test value: 785
-Test value: 786
-Test value: 787
-Test value: 788
-Test value: 789
-Test value: 790
-Test value: 791
-Test value: 792
-Test value: 793
-Test value: 794
-Test value: 795
-Test value: 796
-Test value: 797
-Test value: 798
-Test value: 799
-Test value: 800
-Test value: 801
-Test value: 802
-Test value: 803
-Test value: 804
-Test value: 805
-Test value: 806
-Test value: 807
-Test value: 808
-Test value: 809
-Test value: 810
-Test value: 811
-Test value: 812
-Test value: 813
-Test value: 814
-Test value: 815
-Test value: 816
-Test value: 817
-Test value: 818
-Test value: 819
-Test value: 820
-Test value: 821
-Test value: 822
-Test value: 823
-Test value: 824
-Test value: 825
-Test value: 826
-Test value: 827
-Test value: 828
-Test value: 829
-Test value: 830
-Test value: 831
-Test value: 832
-Test value: 833
-Test value: 834
-Test value: 835
-Test value: 836
-Test value: 837
-Test value: 838
-Test value: 839
-Test value: 840
-Test value: 841
-Test value: 842
-Test value: 843
-Test value: 844
-Test value: 845
-Test value: 846
-Test value: 847
-Test value: 848
-Test value: 849
-Test value: 850
-Test value: 851
-Test value: 852
-Test value: 853
-Test value: 854
-Test value: 855
-Test value: 856
-Test value: 857
-Test value: 858
-Test value: 859
-Test value: 860
-Test value: 861
-Test value: 862
-Test value: 863
-Test value: 864
-Test value: 865
-Test value: 866
-Test value: 867
-Test value: 868
-Test value: 869
-Test value: 870
-Test value: 871
-Test value: 872
-Test value: 873
-Test value: 874
-Test value: 875
-Test value: 876
-Test value: 877
-Test value: 878
-Test value: 879
-Test value: 880
-Test value: 881
-Test value: 882
-Test value: 883
-Test value: 884
-Test value: 885
-Test value: 886
-Test value: 887
-Test value: 888
-Test value: 889
-Test value: 890
-Test value: 891
-Test value: 892
-Test value: 893
-Test value: 894
-Test value: 895
-Test value: 896
-Test value: 897
-Test value: 898
-Test value: 899
-Test value: 900
-Test value: 901
-Test value: 902
-Test value: 903
-Test value: 904
-Test value: 905
-Test value: 906
-Test value: 907
-Test value: 908
-Test value: 909
-Test value: 910
-Test value: 911
-Test value: 912
-Test value: 913
-Test value: 914
-Test value: 915
-Test value: 916
-Test value: 917
-Test value: 918
-Test value: 919
-Test value: 920
-Test value: 921
-Test value: 922
-Test value: 923
-Test value: 924
-Test value: 925
-Test value: 926
-Test value: 927
-Test value: 928
-Test value: 929
-Test value: 930
-Test value: 931
-Test value: 932
-Test value: 933
-Test value: 934
-Test value: 935
-Test value: 936
-Test value: 937
-Test value: 938
-Test value: 939
-Test value: 940
-Test value: 941
-Test value: 942
-Test value: 943
-Test value: 944
-Test value: 945
-Test value: 946
-Test value: 947
-Test value: 948
-Test value: 949
-Test value: 950
-Test value: 951
-Test value: 952
-Test value: 953
-Test value: 954
-Test value: 955
-Test value: 956
-Test value: 957
-Test value: 958
-Test value: 959
-Test value: 960
-Test value: 961
-Test value: 962
-Test value: 963
-Test value: 964
-Test value: 965
-Test value: 966
-Test value: 967
-Test value: 968
-Test value: 969
-Test value: 970
-Test value: 971
-Test value: 972
-Test value: 973
-Test value: 974
-Test value: 975
-Test value: 976
-Test value: 977
-Test value: 978
-Test value: 979
-Test value: 980
-Test value: 981
-Test value: 982
-Test value: 983
-Test value: 984
-Test value: 985
-Test value: 986
-Test value: 987
-Test value: 988
-Test value: 989
-Test value: 990
-Test value: 991
-Test value: 992
-Test value: 993
-Test value: 994
-Test value: 995
-Test value: 996
-Test value: 997
-Test value: 998
-Test value: 999
-Test value: 1000
+Test value: 30000
=====================================
testsuite/tests/perf/should_run/all.T
=====================================
@@ -446,7 +446,6 @@ test('T26147',
[ collect_stats('all', 5),
pre_cmd('./genT26147'),
extra_files(['genT26147']),
- extra_run_opts('+RTS -p'),
test_opts_dot_prof,
],
compile_and_run,
=====================================
testsuite/tests/perf/should_run/genT26147
=====================================
@@ -16,7 +16,6 @@ for i in $(seq $NUMFUN); do
costCenter${i} :: Int -> IO ()
costCenter${i} n = do
- putStrLn $ "Test value: " ++ show n
costCenter$((i + 1)) (n+1)
EOF
done
@@ -25,5 +24,7 @@ cat >> T26147.hs << EOF
costCenter$((i + 1)) :: Int -> IO ()
costCenter$((i + 1)) n = do
- putStrLn $ "Test value: " ++ show n
+ if n < $NUMFUN * 30
+ then costCenter1 n
+ else putStrLn $ "Test value: " ++ show n
EOF
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b328b3070cd700ff98957ade4b42bef…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b328b3070cd700ff98957ade4b42bef…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/fendor/bump-ci-to-9.10] Bump GHC on darwin CI to 9.10.1
by Hannes Siebenhandl (@fendor) 05 Aug '25
by Hannes Siebenhandl (@fendor) 05 Aug '25
05 Aug '25
Hannes Siebenhandl pushed to branch wip/fendor/bump-ci-to-9.10 at Glasgow Haskell Compiler / GHC
Commits:
7c378601 by fendor at 2025-08-05T16:29:18+02:00
Bump GHC on darwin CI to 9.10.1
- - - - -
1 changed file:
- .gitlab/darwin/toolchain.nix
Changes:
=====================================
.gitlab/darwin/toolchain.nix
=====================================
@@ -16,18 +16,17 @@ let
ghcBindists = let version = ghc.version; in {
aarch64-darwin = hostPkgs.fetchurl {
url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-aarch64-apple-d…";
- sha256 = "sha256-c1GTMJf3/yiW/t4QL532EswD5JVlgA4getkfsxj4TaA=";
+ sha256 = "sha256-/6+DtdeossBJIMbjkJwL4h3eJ7rzgNCV+ifoQKOi6AQ=";
};
x86_64-darwin = hostPkgs.fetchurl {
url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-x86_64-apple-da…";
- sha256 = "sha256-LrYniMG0phsvyW6dhQC+3ompvzcxnwAe6GezEqqzoTQ=";
+ sha256 = "sha256-jPIhiJMOENesUnDUJeIaPatgavc6ZVSTY5NFIAxlC+k=";
};
};
ghc = pkgs.stdenv.mkDerivation rec {
- # Using 9.6.2 because of #24050
- version = "9.6.2";
+ version = "9.10.1";
name = "ghc";
src = ghcBindists.${pkgs.stdenv.hostPlatform.system};
configureFlags = [
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c37860190cfffe719515be9bee7961…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c37860190cfffe719515be9bee7961…
You're receiving this email because of your account on gitlab.haskell.org.
1
0