[Git][ghc/ghc][wip/T18462] 34 commits: interpreter: Fix INTERP_STATS profiling code
Sjoerd Visscher (@trac-sjoerd_visscher)
gitlab at gitlab.haskell.org
Thu Feb 20 13:21:17 UTC 2025
Sjoerd Visscher pushed to branch wip/T18462 at Glasgow Haskell Compiler / GHC
Commits:
66c7f656 by Matthew Pickering at 2025-02-06T17:15:25-05:00
interpreter: Fix INTERP_STATS profiling code
The profiling code had slightly bitrotted since the last time it was
used. This just fixes things so that if you toggle the INTERP_STATS
macro then it just works and prints out the stats.
Fixes #25695
- - - - -
f71c2835 by Matthew Pickering at 2025-02-06T17:16:02-05:00
perf: Key the interpreter symbol cache by Name rather than FastString
Profiles showed that about 0.2s was being spend constructing the keys
before looking up values in the old symbol cache.
The performance of this codepath is critical as it translates directly
to a delay when a user evaluates a function like `main` in the
interpreter.
Therefore we implement a solution which keys the cache(s) by `Name`
rather than the symbol directly, so the cache can be consulted before
the symbol is constructed.
Fixes #25731
- - - - -
8f8d3a90 by Ben Gamari at 2025-02-08T01:17:28-05:00
base: Label threads forked by IO operations
Addresses part of #25452.
Addresses core-libraries-committee#305.
- - - - -
28600825 by Ben Gamari at 2025-02-08T01:17:28-05:00
base: Label threads forked by System.Timeout
Addresses part of #25452.
Addresses core-libraries-committee#305.
- - - - -
8a249827 by Ben Gamari at 2025-02-08T01:17:28-05:00
base: Label signal handling threads
Addresses part of #25452.
Addresses core-libraries-committee#305.
- - - - -
26af26f0 by Ben Gamari at 2025-02-08T01:17:28-05:00
base: Label Windows console event handling threads
Addresses part of #25452.
Addresses core-libraries-committee#305.
- - - - -
bf9c3d4f by Ben Gamari at 2025-02-08T01:17:28-05:00
ghci: Label evaluation sandbox thread
Addresses part of #25452.
Addresses core-libraries-committee#305.
- - - - -
38f78ce5 by Ben Gamari at 2025-02-08T01:17:28-05:00
base: Add changelog entry for addition of thread labels
Addresses #25452.
Addresses core-libraries-committee#305.
- - - - -
c100deb5 by Ben Gamari at 2025-02-08T01:18:05-05:00
gen-ci: Clean up style
This cleans up a number of stylistic inconsistencies although it's still
far from perfect.
- - - - -
c4a7680a by Ben Gamari at 2025-02-08T01:18:05-05:00
gen-ci: Properly encapsulate GitLab predicates
- - - - -
52b6539b by M Farkas-Dyck at 2025-02-08T11:34:51-08:00
Avoid partiality in `Language.Haskell.Syntax.Expr`, `GHC.Hs.Expr`, `GHC.Rename.Expr`, etc.
In particular, use `NonEmpty` where appropriate:
- the argument of `FieldLabelString`
- the argument of `HsMultiIf`
- `grhssGRHSs`
Decreases overall compile-time allocation by about 0.1% in the benchmark suite (min -0.8%, max +0.3%).
Metric Decrease:
T3294
- - - - -
a566da92 by Ben Gamari at 2025-02-10T03:21:49-05:00
gitlab-ci: Bump docker images
Closes #25693.
- - - - -
a7e23f01 by Ben Gamari at 2025-02-10T03:21:49-05:00
hadrian: Drop uses of head/tail
To silence warnings with GHC 9.10
- - - - -
12752f0c by Ben Gamari at 2025-02-10T03:21:49-05:00
hadrian: Disable x-data-list-nonempty-unzip warning
- - - - -
e22a14fc by Simon Peyton Jones at 2025-02-11T16:21:10+00:00
Deal correctly with Given CallStack constraints
As #25675 showed, the CallStack solving mechanism was failing
to account for Given CallStack constraints.
This small patch fixes it and improves the Notes.
Small improvement to GHCi debugger output in break011, break024,
which is discussed on the MR !13883
- - - - -
db3e810f by Simon Peyton Jones at 2025-02-12T09:12:30-05:00
Fix inlineBoringOk again
This MR fixes #25713, which turned out to be a consequence of not
completing #17182.
I think I have now gotten it right. See the new
Note [inlineBoringOk]
- - - - -
ef0e6cfc by Ben Gamari at 2025-02-17T19:20:09-05:00
testsuite: Mark T23071 and T2047 as fragile on FreeBSD
These inexplicably fail on FreeBSD on CI. Sadly I am unable to reproduce
this locally but regardless this is holding up Marge so I will mark them
as fragile for now.
Addresses #25751.
- - - - -
7596675e by Jens Petersen at 2025-02-18T08:53:08-05:00
hp2ps Utilities.c: include stdlib.h instead of extern malloc and realloc
- - - - -
975d932c by Rodrigo Mesquita at 2025-02-18T08:53:45-05:00
Inline join points for rhs without free vars
While investigating #25170, we ran into a program (T16473) that allocated 67%
more because of a join point that failed to inline.
Note [Duplicating join points] explains why we want to be conservative
when inlining join points, using as an example a join point that
captures a free variable `f` that becomes available in the continuation
`blah` for further optimisations, as opposed to being lambda-abstracted.
However, when the RHS of the join point has no free variables and is
trivial, the same argument does not apply, and there's nothing to gain
from preserving it.
On the contrary, not inlining these trivial join points such as
$j f x = K f x |> co
can be actively harmful as they prevent useful optimisations from firing
on the known constructor application. #25723 is such an example.
Therefore, we've extended `uncondInlineJoin` to allow duplicating such closed
trivial join points. See the updated Note [Duplicating join points] for
further details.
Additionally, merge the guards in uncondInlineJoin for point DJ3(b) anad DJ3(c) of
Note [Duplicating join points] to avoid an unnecessary traversal in the
call to `collectArgs`; it's also more uniform.
Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com>
Fixes #25723
- - - - -
78de1a55 by M Farkas-Dyck at 2025-02-18T08:54:31-05:00
Scrub some partiality in `GHC.Tc.Gen.Match`.
In particular, we construct a list of the same length as another list, then loop over both and panic if their lengths are unequal. We can avoid this.
- - - - -
1dfe9325 by M Farkas-Dyck at 2025-02-18T08:54:31-05:00
Make list of `ParStmtBlock` in `ParStmt` `NonEmpty`.
In the ParStmt constructor Language.Haskell.Syntax.Expr.StmtLR, the 2nd argument, the list of ParStmtBlocks, must be NonEmpty; make it so.
- - - - -
0e3575b5 by M Farkas-Dyck at 2025-02-18T08:54:31-05:00
GHC.Tc.Gen.Match: Added type signatures for `loop` functions.
- - - - -
c9ffcfee by sternenseemann at 2025-02-18T08:55:14-05:00
GHC: fix reference to function in Note [Target code interpreter]
As far as I could tell, setSessionDynFlags doesn't deal with hsc_interp.
Also added a backreference so this will be updated in the future.
- - - - -
ab77fc8c by sheaf at 2025-02-18T08:55:57-05:00
Account for skolem escape in mightEqualLater
This commit:
1. Refactors checkTyEqRhs to allow it be called in pure contexts,
which means it skips doing any on-the-fly promotion.
2. Calls checkTyEqRhs in mightEqualLater to check whether it a
MetaTv can unify with a RHS or whether that would cause e.g.
skolem escape errors or concreteness errors.
Fixes #25744
- - - - -
cb8a06a4 by Sylvain Henry at 2025-02-18T08:56:52-05:00
Remove a bunch of Makefiles from old build system
- - - - -
e12d6b39 by M Farkas-Dyck at 2025-02-18T08:57:37-05:00
Totalize `GHC.HsToCore.Match.matchWrappers.initNablasGRHSs`.
Converting from `NonEmpty` to `[]` and back is totally needless.
- - - - -
cd2be3be by Matthew Pickering at 2025-02-18T08:58:14-05:00
interpreter: Always print uniques for BCO_NAME labels
In the previous commit I omitted to include the unique, which still
makes it very difficult to trace back where the BCO came from.
- - - - -
c4e112fc by Matthew Pickering at 2025-02-18T08:58:51-05:00
interpreter: Fix overflows and reentrancy in statistics calculation
1. Use unsigned long for counter, as they can easily overflow if you are
running a long benchmark.
2. Make interp_shutdown reentrant by copying the command frequency table
into an array.
Fixes #25756
- - - - -
70ac6222 by M Farkas-Dyck at 2025-02-18T14:22:06-08:00
Use `Foldable1` where appropriate, avoiding much needless panicking.
In some cases, where not readily feasible to modify code to use `NonEmpty`, merely use `expectNonEmpty` to make explicit we are panicking if we have an empty list.
- - - - -
a3f0a506 by Sylvain Henry at 2025-02-19T05:27:30-05:00
Testsuite: fix deprecation warning
> DeprecationWarning: 'count' is passed as positional argument
- - - - -
ef5470a2 by Ben Gamari at 2025-02-19T16:30:53+00:00
Cmm/Parser: Add surface syntax for Mul2 MachOps
These are otherwise very hard to test in isolation.
- - - - -
59b9307b by Cheng Shao at 2025-02-19T20:24:40-05:00
testsuite: fix InternalCounters test with +debug_ghc
The `InternalCounters` test case fails when ghc is built with
`+debug_ghc`. This patch skips it in that case and allows the
testsuite to pass for the `+debug_ghc` flavour transformer.
- - - - -
aa69187d by M Farkas-Dyck at 2025-02-19T20:25:31-05:00
Scrub a use of `head` in `GHC.Driver.Make.downsweep_imports.checkDuplicates`.
- - - - -
49ce1666 by Sjoerd Visscher at 2025-02-20T14:21:03+01:00
Multiplicity annotation on records
Add HsConFieldSpec
- - - - -
216 changed files:
- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- compiler/GHC.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/DebugBlock.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm/Reg/Graph/Base.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CallArity.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/Unfold.hs
- compiler/GHC/Core/Unfold/Make.hs
- compiler/GHC/Core/UsageEnv.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Data/Graph/Inductive/Graph.hs
- + compiler/GHC/Data/List.hs
- + compiler/GHC/Data/List/NonEmpty.hs
- compiler/GHC/Data/Pair.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/GuardedRHSs.hs
- compiler/GHC/HsToCore/ListComp.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/HsToCore/Utils.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/JS/Ppr.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Prelude/Basic.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/Runtime/Interpreter/Types.hs
- + compiler/GHC/Runtime/Interpreter/Types/SymbolCache.hs
- compiler/GHC/Stg/Lift/Analysis.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm/Layout.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToJS/Expr.hs
- compiler/GHC/Tc/Deriv/Functor.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/Solver/Types.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Build.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Name.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Utils/Misc.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Type.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.14.1-notes.rst
- docs/users_guide/exts/linear_types.rst
- hadrian/src/Hadrian/Utilities.hs
- hadrian/src/Oracles/ModuleFiles.hs
- hadrian/src/Rules/Dependencies.hs
- hadrian/src/Settings/Parser.hs
- libraries/base/changelog.md
- libraries/base/src/Control/Concurrent.hs
- libraries/base/src/System/Timeout.hs
- libraries/ghc-internal/src/GHC/Internal/Conc/Signal.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows/ConsoleEvent.hsc
- libraries/ghc-internal/src/GHC/Internal/TypeError.hs
- libraries/ghci/GHCi/Run.hs
- rts/Interpreter.c
- rts/Interpreter.h
- rts/RtsMain.c
- testsuite/driver/testlib.py
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/ghci.debugger/scripts/break011.stdout
- testsuite/tests/ghci.debugger/scripts/break024.stdout
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- + testsuite/tests/linear/should_compile/NonLinearRecord.hs
- testsuite/tests/linear/should_compile/all.T
- + testsuite/tests/linear/should_fail/LinearRecFieldMany.hs
- + testsuite/tests/linear/should_fail/LinearRecFieldMany.stderr
- testsuite/tests/linear/should_fail/all.T
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_fail/T3811c.stderr
- testsuite/tests/parser/should_fail/unpack_inside_type.stderr
- + testsuite/tests/perf/compiler/T25723.hs
- + testsuite/tests/perf/compiler/T25723.stdout
- testsuite/tests/perf/compiler/all.T
- testsuite/tests/perf/compiler/hard_hole_fits.stderr
- testsuite/tests/primops/should_run/all.T
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- + testsuite/tests/profiling/should_run/T25675.hs
- + testsuite/tests/profiling/should_run/T25675.stdout
- testsuite/tests/profiling/should_run/all.T
- testsuite/tests/rename/should_fail/T22478b.stderr
- testsuite/tests/rts/all.T
- testsuite/tests/simplCore/should_compile/T22375DataFamily.stderr
- testsuite/tests/simplCore/should_compile/T24229a.stderr
- testsuite/tests/simplCore/should_compile/T24229b.stderr
- + testsuite/tests/simplCore/should_compile/T25713.hs
- + testsuite/tests/simplCore/should_compile/T25713.stderr
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/th/EmptyGuard.hs
- + testsuite/tests/th/EmptyGuard.stderr
- + testsuite/tests/th/EmptyParStmt.hs
- + testsuite/tests/th/EmptyParStmt.stderr
- testsuite/tests/th/all.T
- + testsuite/tests/typecheck/should_compile/T25744.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T7210.stderr
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Transform.hs
- − utils/deriveConstants/Makefile
- − utils/genprimopcode/Makefile
- − utils/ghc-pkg/Makefile
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Interface/RenameType.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- utils/haddock/html-test/ref/LinearTypes.html
- utils/haddock/html-test/src/LinearTypes.hs
- utils/haddock/latex-test/ref/LinearTypes/LinearTypes.tex
- utils/haddock/latex-test/src/LinearTypes/LinearTypes.hs
- − utils/hp2ps/Makefile
- utils/hp2ps/Utilities.c
- − utils/iserv/Makefile
- − utils/remote-iserv/Makefile
- − utils/runghc/Makefile
- − utils/unlit/Makefile
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c33024438e53913c858f05e6be931b8ce65a1b6b...49ce1666320e3f4759d1c17053c441f3e8f4d2d3
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c33024438e53913c858f05e6be931b8ce65a1b6b...49ce1666320e3f4759d1c17053c441f3e8f4d2d3
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/20250220/5e231594/attachment-0001.html>
More information about the ghc-commits
mailing list