[Git][ghc/ghc][wip/romes/12935] 41 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Tue Jul 9 08:06:21 UTC 2024
Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC
Commits:
0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00
compiler: Turn `FinderCache` into a record of operations so that GHC API clients can
have full control over how its state is managed by overriding `hsc_FC`.
Also removes the `uncacheModule` function as this wasn't being used by anything
since 1893ba12fe1fa2ade35a62c336594afcd569736e
Fixes #23604
- - - - -
4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00
Add HasCallStack to T23221
This makes the test a bit easier to debug
- - - - -
66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00
rts: use live words to estimate heap size
We use live words rather than live blocks to determine the size of the
heap for determining memory retention.
Most of the time these two metrics align, but they can come apart in
normal usage when using the nonmoving collector.
The nonmoving collector leads to a lot of partially occupied blocks. So,
using live words is more accurate.
They can also come apart when the heap is suffering from high levels
fragmentation caused by small pinned objects, but in this case, the
block size is the more accurate metric. Since this case is best avoided
anyway. It is ok to accept the trade-off that we might try (and
probably) fail to return more memory in this case.
See also the Note [Statistics for retaining memory]
Resolves #23397
- - - - -
8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00
Add reflections of GHC.TypeLits/Nats type families
-------------------------
Metric Increase:
ghc_experimental_dir
ghc_experimental_so
-------------------------
- - - - -
6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00
Correct -Wpartial-fields warning to say "Definition" rather than "Use"
Fixes #24710. The message and documentation for `-Wpartial-fields` were
misleading as (a) the warning occurs at definition sites rather than use
sites, and (b) the warning relates to the definition of a field independently
of the selector function (e.g. because record updates are also partial).
- - - - -
977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00
GHCi: Support local Prelude
Fixes #10920, an issue where GHCi bails out when started alongside a
file named Prelude.hs or Prelude.lhs (even empty file suffices).
The in-source Note [GHCi and local Preludes] documents core reasoning.
Supplementary changes:
* add debug traces for module lookups under -ddump-if-trace;
* drop stale comment in GHC.Iface.Load;
* reduce noise in -v3 traces from GHC.Utils.TmpFs;
* new test, which also exercizes HomeModError.
- - - - -
87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00
Add missing gParPat in cvtp's ViewP case
When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern
is parenthesized so that the resulting code will parse correctly when
roundtripped back through GHC's parser.
Fixes #24894.
- - - - -
b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00
Use structured error representation for module cycle errors (see #18516)
This removes the re-export of cyclicModuleErr from the top-level GHC module.
- - - - -
70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00
Use structured error representation when reloading a nonexistent module
- - - - -
680ade3d by sheaf at 2024-07-04T11:12:23-04:00
Use structured errors for a Backpack instantiation error
- - - - -
97c6d6de by sheaf at 2024-07-04T11:12:23-04:00
Move mkFileSrcSpan to GHC.Unit.Module.Location
- - - - -
f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00
ttg: Remove SourceText from OverloadedLabel
Progress towards #21592
- - - - -
00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00
AST: GHC.Prelude -> Prelude
Refactor occurrences to GHC.Prelude with Prelude within
Language/Haskell.
Progress towards #21592
- - - - -
cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00
AST: remove occurrences of GHC.Unit.Module.ModuleName
`GHC.Unit.Module` re-exports `ModuleName` from
`Language.Haskell.Syntax.Module.Name`.
Progress towards #21592
- - - - -
24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00
AST: move Data instance definition for ModuleName to GHC.Unit.Types
To remove the dependency on GHC.Utils.Misc inside
Language.Haskell.Syntax.Module.Name, the instance definition is moved
from there into GHC.Unit.Types.
Progress towards #21592
- - - - -
6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00
AST: move negateOverLitVal into GHC.Hs.Lit
The function negateOverLitVal is not used within Language.Haskell and
therefore can be moved to the respective module inside GHC.Hs.
Progress towards #21592
- - - - -
611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00
AST: move conDetailsArity into GHC.Rename.Module
The function conDetailsArity is only used inside GHC.Rename.Module. We
therefore move it there from Language.Haskell.Syntax.Lit.
Progress towards #21592
- - - - -
1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00
AST: Remove GHC.Utils.Assert from GHC
Simple cleanup.
Progress towards #21592
- - - - -
3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00
ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var
Progress towards #21592
Specificity, ForAllTyFlag and its' helper functions are extracted from
GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity.
Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on
GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls.
At this point, this would cause cyclic dependencies.
- - - - -
257d1adc by Adowrath at 2024-07-04T11:12:59-04:00
ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type
Progress towards #21592
This splits HsSrcBang up, creating the new HsBang within
`Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness
and strictness information, while `HsSrcBang` only adds the SourceText
for usage within the compiler directly.
Inside the AST, to preserve the SourceText, it is hidden behind the
pre-existing extension point `XBindTy`. All other occurrences of
`HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when
interacting with the `BindTy` constructor, the hidden `SourceText` is
extracted/inserted into the `XBindTy` extension point.
`GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for
convenience. A constructor function `mkHsSrcBang` that takes all
individual components has been added.
Two exceptions has been made though:
- The `Outputable HsSrcBang` instance is replaced by
`Outputable HsBang`. While being only GHC-internal, the only place
it's used is in outputting `HsBangTy` constructors -- which already
have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just
to ignore the `SourceText` anyway.
- The error `TcRnUnexpectedAnnotation` did not use the `SourceText`,
so it too now only holds a `HsBang`.
- - - - -
24757fec by Mauricio at 2024-07-04T11:12:59-04:00
AST: Moved definitions that use GHC.Utils.Panic to GHC namespace
Progress towards #21592
- - - - -
9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00
Fix #25032 Refer to Cabal's `includes` field, not `include-files`
- - - - -
9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00
base: fix more missing changelog entries
- - - - -
a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00
X86 NCG: Fix argument promotion in foreign C calls
Promote 8 bit and 16 bit signed arguments by sign extension.
Fixes #25018
- - - - -
fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00
Add .gitlab/README.md with creds instructions
- - - - -
564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00
configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler
In 9.10.1 the "ld command" has been removed, so we fall back to using
the more precise "merge objects command" when it's available as
LD_STAGE0 is only used to set the object merging command in hadrian.
Fixes #24949
- - - - -
a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00
hadrian: Don't build ghci object files for ./hadrian/ghci target
There is some convoluted logic which determines whether we build ghci
object files are not. In any case, if you set `ghcDynPrograms = pure
False` then it forces them to be built.
Given we aren't ever building executables with this flavour it's fine
to leave `ghcDynPrograms` as the default and it should be a bit faster
to build less.
Also fixes #24949
- - - - -
48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00
hadrian: Remove STG dump from ticky_ghc flavour transformer
This adds 10-15 minutes to build time, it is a better strategy to
precisely enable dumps for the modules which show up prominently in a
ticky profile.
Given I am one of the only people regularly building ticky compilers I
think it's worthwhile to remove these.
Fixes #23635
- - - - -
5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00
hadrian: Add dump_stg flavour transformer
This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you
really want STG for all modules.
- - - - -
c5ca422b by Matthew Pickering at 2024-07-08T18:07:57+01:00
Run on test-abi label
- - - - -
a4c1d155 by Rodrigo Mesquita at 2024-07-08T18:07:57+01:00
Write a test for object determinism
Extend abi_test with object determinism check
Standalone run abi test
Disable local test on CI
- - - - -
8b3a2e02 by Rodrigo Mesquita at 2024-07-08T18:07:57+01:00
Remame uniques straight off stgtocmm, before cmm pipeline
WIP
Progress
Work around LLVM assembler bug!
In a really stupid way)
Fix ordering of CLabels for IdLabels
Local test script tweaks
Do uniq renaming before SRTs
Revert "Do uniq renaming before SRTs"
This reverts commit db38b635d626106e40b3ab18091e0a24046c30c5.
Do on CmmGroup
Do uniq-renaming pass right at `codeGen`
not better
Revert "Do uniq-renaming pass right at `codeGen`"
This reverts commit 74e9068aaaf736bf815a36bf74a0dde19a074a7a.
Reapply "Do uniq renaming before SRTs"
This reverts commit 682f89732fc2a95fa011f530c0c6922bf576d229.
Try ALSO after SRT
Revert "Try ALSO after SRT"
This reverts commit c5dd7b426cde768126402aac3f39617ccb99f5c5.
Renaming before and after SRTs bc of procs and srts and ...
Wait no that was way too slow...
cleaner approach, same idea
Revert "Reapply "Do uniq renaming before SRTs""
This reverts commit 70ff49b7efc8c1fca46cba6eff630c5d39a99213.
Finfixes
Add traces
Fix bug triggered by static data generated during SRT
Wait, that was still there?!
StableNmCmp is invalid for internal names... also, rename all Id uniques
This fixes a really awful bug.
Tweaks
- - - - -
07ed3049 by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00
cmm: Back LabelMap with UDFM
Use a deterministic unique map to back the implementation of `LabelMap`.
This is necessary towards the goal of object code determinism in #12935.
Our intended solution requires renaming uniques in a deterministic
order (which will be the order in which they were created), but storing
them label map makes us lose this order. Backing it with a UDFM fixes
this issue.
- - - - -
b0cdbd1f by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00
Deriving-via one-shot strict state Monad instances
A small refactor to use deriving via GHC.Utils.Monad.State.Strict
Monad instances for state Monads with unboxed/strict results which all
re-implemented the one-shot trick in the instance and used unboxed
tuples:
* CmmOptM in GHC.Cmm.GenericOpt
* RegM in GHC.CmmToAsm.Reg.Linear.State
* UniqSM in GHC.Types.Unique.Supply
- - - - -
1aba6fe5 by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00
UniqDSM det uniques + use in Cmm.Info
Now for SRTs
SRT generation using deterministic uniq supply
Back LabelMap with deterministic UDFM
TSAN uniq rename hard
Revert "TSAN uniq rename hard"
This reverts commit 7ca5ab3036c15f38c6d4cbcb616d415958c6bcda.
improvements to uniqdsm
UniqDSM ProcPoint
CmmLayoutStack UniqDet
90% of cpsTop UniqDSM
Major progress in using UniqDSM in CmmToAsm and Ncg backends
Fix imports
Un-back label map with udfm
Revert "Un-back label map with udfm"
This reverts commit f5d2e4257214a3f7b7d845651e6662c5babfd6a3.
- - - - -
66c3ed80 by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00
Tweaks
- - - - -
142be466 by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00
Make UDSM oneshot deriving via state
- - - - -
b4f2203b by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00
Put deterministic renaming behind a flag
- - - - -
d734bd30 by Rodrigo Mesquita at 2024-07-08T18:07:59+01:00
Introduce back LabelMap non deterministic
- - - - -
54981338 by Rodrigo Mesquita at 2024-07-08T18:07:59+01:00
Use NonDeterministic Label map in multiple passes
(TODO: More could be available. Look through Det LabelMap uses again)
- - - - -
4ee04e81 by Rodrigo Mesquita at 2024-07-09T09:04:37+01:00
Drop dumps
- - - - -
30 changed files:
- .gitlab-ci.yml
- + .gitlab/README.md
- .gitlab/ci.sh
- compiler/GHC.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Cmm/BlockId.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Dataflow.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- + compiler/GHC/Cmm/Dataflow/Label/NonDet.hs
- compiler/GHC/Cmm/GenericOpt.hs
- compiler/GHC/Cmm/Graph.hs
- compiler/GHC/Cmm/Info.hs
- compiler/GHC/Cmm/Info/Build.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/Liveness.hs
- compiler/GHC/Cmm/Opt.hs
- compiler/GHC/Cmm/Pipeline.hs
- compiler/GHC/Cmm/ProcPoint.hs
- compiler/GHC/Cmm/Reducibility.hs
- compiler/GHC/Cmm/Sink.hs
- compiler/GHC/Cmm/Switch.hs
- compiler/GHC/Cmm/Switch/Implement.hs
- + compiler/GHC/Cmm/UniqueRenamer.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/BlockLayout.hs
- compiler/GHC/CmmToAsm/Dwarf.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8a2a3d808d66c8b57af35edd07886bfab9b0827e...4ee04e81629ef950d7b9a315fa68119f7ce89024
--
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8a2a3d808d66c8b57af35edd07886bfab9b0827e...4ee04e81629ef950d7b9a315fa68119f7ce89024
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240709/9a08efd1/attachment-0001.html>
More information about the ghc-commits
mailing list