[Git][ghc/ghc][wip/bytecode-serialize] 20 commits: testsuite: Mark T23071 and T2047 as fragile on FreeBSD

Cheng Shao (@TerrorJack) gitlab at gitlab.haskell.org
Tue Feb 18 16:42:24 UTC 2025



Cheng Shao pushed to branch wip/bytecode-serialize at Glasgow Haskell Compiler / GHC


Commits:
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

- - - - -
ec55ab03 by Cheng Shao at 2025-02-18T15:55:15+00:00
compiler: avoid overwriting existing writers in putWithTables

- - - - -
35908996 by Cheng Shao at 2025-02-18T15:55:15+00:00
compiler: do not allocate strings in bytecode assembler

- - - - -
e6d9204a by Cheng Shao at 2025-02-18T15:55:15+00:00
compiler: make bc_strs serializable

- - - - -
6f9051e1 by Cheng Shao at 2025-02-18T15:55:15+00:00
compiler: make bc_itbls serializable

- - - - -
cdcf43cf by Cheng Shao at 2025-02-18T15:55:15+00:00
compiler: remove FFIInfo bookkeeping in BCO

- - - - -
0793257e by Cheng Shao at 2025-02-18T15:55:15+00:00
compiler: make FFIInfo serializable in BCO

- - - - -
c184bc42 by Cheng Shao at 2025-02-18T15:55:15+00:00
compiler: make SptEntry serializable

- - - - -
1f5a546f by Cheng Shao at 2025-02-18T15:55:15+00:00
WIP: ghc bytecode serialization logic

- - - - -


63 changed files:

- compiler/GHC.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/InfoTable.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Linker.hs
- + compiler/GHC/ByteCode/Serialize.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Unfold.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/ListComp.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Binary.hs
- compiler/GHC/Iface/Tidy/StaticPtrTable.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser.y
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToJS/StaticPtr.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Match.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/Utils/Unify.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Name.hs
- compiler/GHC/Types/SptEntry.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.14.1-notes.rst
- rts/Interpreter.c
- testsuite/tests/bytecode/T22376/all.T
- + testsuite/tests/perf/compiler/T25723.hs
- + testsuite/tests/perf/compiler/T25723.stdout
- testsuite/tests/perf/compiler/all.T
- testsuite/tests/primops/should_run/all.T
- testsuite/tests/rts/all.T
- testsuite/tests/simplCore/should_compile/T24229a.stderr
- testsuite/tests/simplCore/should_compile/T24229b.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
- − utils/deriveConstants/Makefile
- − utils/genprimopcode/Makefile
- − utils/ghc-pkg/Makefile
- − 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/e29d68bac5fa98d94d425affee3ae00a05350fa2...1f5a546f4ebcfefb7b90e65b3d6aced0522fcb77

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e29d68bac5fa98d94d425affee3ae00a05350fa2...1f5a546f4ebcfefb7b90e65b3d6aced0522fcb77
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/20250218/0d8aa076/attachment-0001.html>


More information about the ghc-commits mailing list