[Git][ghc/ghc][wip/sand-witch/infix-type-data] 22 commits: base: export System.Mem.performBlockingMajorGC
Andrei Borzenkov (@sand-witch)
gitlab at gitlab.haskell.org
Mon Feb 19 12:20:06 UTC 2024
Andrei Borzenkov pushed to branch wip/sand-witch/infix-type-data at Glasgow Haskell Compiler / GHC
Commits:
08031ada by Teo Camarasu at 2024-02-16T13:37:00-05:00
base: export System.Mem.performBlockingMajorGC
The corresponding C function was introduced in
ba73a807edbb444c49e0cf21ab2ce89226a77f2e. As part of #22264.
Resolves #24228
The CLC proposal was disccused at: https://github.com/haskell/core-libraries-committee/issues/230
Co-authored-by: Ben Gamari <bgamari.foss at gmail.com>
- - - - -
1f534c2e by Florian Weimer at 2024-02-16T13:37:42-05:00
Fix C output for modern C initiative
GCC 14 on aarch64 rejects the C code written by GHC with this kind of
error:
error: assignment to ‘ffi_arg’ {aka ‘long unsigned int’} from ‘HsPtr’ {aka ‘void *’} makes integer from pointer without a cast [-Wint-conversion]
68 | *(ffi_arg*)resp = cret;
| ^
Add the correct cast.
For more information on this see:
https://fedoraproject.org/wiki/Changes/PortingToModernC
Tested-by: Richard W.M. Jones <rjones at redhat.com>
- - - - -
5d3f7862 by Matthew Craven at 2024-02-16T13:38:18-05:00
Bump bytestring submodule to 0.12.1.0
- - - - -
902ebcc2 by Ian-Woo Kim at 2024-02-17T06:01:01-05:00
Add missing BCO handling in scavenge_one.
- - - - -
97d26206 by Sylvain Henry at 2024-02-17T06:01:44-05:00
Make cast between words and floats real primops (#24331)
First step towards fixing #24331. Replace foreign prim imports with real
primops.
- - - - -
a40e4781 by Sylvain Henry at 2024-02-17T06:01:44-05:00
Perf: add constant folding for bitcast between float and word (#24331)
- - - - -
5fd2c00f by Sylvain Henry at 2024-02-17T06:01:44-05:00
Perf: replace stack checks with assertions in casting primops
There are RESERVED_STACK_WORDS free words (currently 21) on the stack,
so omit the checks.
Suggested by Cheng Shao.
- - - - -
401dfe7b by Sylvain Henry at 2024-02-17T06:01:44-05:00
Reexport primops from GHC.Float + add deprecation
- - - - -
4ab48edb by Ben Gamari at 2024-02-17T06:02:21-05:00
rts/Hash: Don't iterate over chunks if we don't need to free data
When freeing a `HashTable` there is no reason to walk over the hash list
before freeing it if the user has not given us a `dataFreeFun`.
Noticed while looking at #24410.
- - - - -
bd5a1f91 by Cheng Shao at 2024-02-17T06:03:00-05:00
compiler: add SEQ_CST fence support
In addition to existing Acquire/Release fences, this commit adds
SEQ_CST fence support to GHC, allowing Cmm code to explicitly emit a
fence that enforces total memory ordering. The following logic is
added:
- The MO_SeqCstFence callish MachOp
- The %prim fence_seq_cst() Cmm syntax and the SEQ_CST_FENCE macro in Cmm.h
- MO_SeqCstFence lowering logic in every single GHC codegen backend
- - - - -
2ce2a493 by Cheng Shao at 2024-02-17T06:03:38-05:00
testsuite: fix hs_try_putmvar002 for targets without pthread.h
hs_try_putmvar002 includes pthread.h and doesn't work on targets
without this header (e.g. wasm32). It doesn't need to include this
header at all. This was previously unnoticed by wasm CI, though recent
toolchain upgrade brought in upstream changes that completely removes
pthread.h in the single-threaded wasm32-wasi sysroot, therefore we
need to handle that change.
- - - - -
1fb3974e by Cheng Shao at 2024-02-17T06:03:38-05:00
ci: bump ci-images to use updated wasm image
This commit bumps our ci-images revision to use updated wasm image.
- - - - -
56e3f097 by Andrew Lelechenko at 2024-02-17T06:04:13-05:00
Bump submodule text to 2.1.1
T17123 allocates less because of improvements to Data.Text.concat in 1a6a06a.
Metric Decrease:
T17123
- - - - -
a7569495 by Cheng Shao at 2024-02-17T06:04:51-05:00
rts: remove redundant rCCCS initialization
This commit removes the redundant logic of initializing each
Capability's rCCCS to CCS_SYSTEM in initProfiling(). Before
initProfiling() is called during RTS startup, each Capability's rCCCS
has already been assigned CCS_SYSTEM when they're first initialized.
- - - - -
7a0293cc by Ben Gamari at 2024-02-19T07:11:00-05:00
Drop dependence on `touch`
This drops GHC's dependence on the `touch` program, instead implementing
it within GHC. This eliminates an external dependency and means that we
have one fewer program to keep track of in the `configure` script
- - - - -
0dbd729e by Andrei Borzenkov at 2024-02-19T07:11:37-05:00
Parser, renamer, type checker for @a-binders (#17594)
GHC Proposal 448 introduces binders for invisible type arguments
(@a-binders) in various contexts. This patch implements @-binders
in lambda patterns and function equations:
{-# LANGUAGE TypeAbstractions #-}
id1 :: a -> a
id1 @t x = x :: t -- @t-binder on the LHS of a function equation
higherRank :: (forall a. (Num a, Bounded a) => a -> a) -> (Int8, Int16)
higherRank f = (f 42, f 42)
ex :: (Int8, Int16)
ex = higherRank (\ @a x -> maxBound @a - x )
-- @a-binder in a lambda pattern in an argument
-- to a higher-order function
Syntax
------
To represent those @-binders in the AST, the list of patterns in Match
now uses ArgPat instead of Pat:
data Match p body
= Match {
...
- m_pats :: [LPat p],
+ m_pats :: [LArgPat p],
...
}
+ data ArgPat pass
+ = VisPat (XVisPat pass) (LPat pass)
+ | InvisPat (XInvisPat pass) (HsTyPat (NoGhcTc pass))
+ | XArgPat !(XXArgPat pass)
The VisPat constructor represents patterns for visible arguments,
which include ordinary value-level arguments and required type arguments
(neither is prefixed with a @), while InvisPat represents invisible type
arguments (prefixed with a @).
Parser
------
In the grammar (Parser.y), the lambda and lambda-cases productions of
aexp non-terminal were updated to accept argpats instead of apats:
aexp : ...
- | '\\' apats '->' exp
+ | '\\' argpats '->' exp
...
- | '\\' 'lcases' altslist(apats)
+ | '\\' 'lcases' altslist(argpats)
...
+ argpat : apat
+ | PREFIX_AT atype
Function left-hand sides did not require any changes to the grammar, as
they were already parsed with productions capable of parsing @-binders.
Those binders were being rejected in post-processing (isFunLhs), and now
we accept them.
In Parser.PostProcess, patterns are constructed with the help of
PatBuilder, which is used as an intermediate data structure when
disambiguating between FunBind and PatBind. In this patch we define
ArgPatBuilder to accompany PatBuilder. ArgPatBuilder is a short-lived
data structure produced in isFunLhs and consumed in checkFunBind.
Renamer
-------
Renaming of @-binders builds upon prior work on type patterns,
implemented in 2afbddb0f24, which guarantees proper scoping and
shadowing behavior of bound type variables.
This patch merely defines rnLArgPatsAndThen to process a mix of visible
and invisible patterns:
+ rnLArgPatsAndThen :: NameMaker -> [LArgPat GhcPs] -> CpsRn [LArgPat GhcRn]
+ rnLArgPatsAndThen mk = mapM (wrapSrcSpanCps rnArgPatAndThen) where
+ rnArgPatAndThen (VisPat x p) = ... rnLPatAndThen ...
+ rnArgPatAndThen (InvisPat _ tp) = ... rnHsTyPat ...
Common logic between rnArgPats and rnPats is factored out into the
rn_pats_general helper.
Type checker
------------
Type-checking of @-binders builds upon prior work on lazy skolemisation,
implemented in f5d3e03c56f.
This patch extends tcMatchPats to handle @-binders. Now it takes and
returns a list of LArgPat rather than LPat:
tcMatchPats ::
...
- -> [LPat GhcRn]
+ -> [LArgPat GhcRn]
...
- -> TcM ([LPat GhcTc], a)
+ -> TcM ([LArgPat GhcTc], a)
Invisible binders in the Match are matched up with invisible (Specified)
foralls in the type. This is done with a new clause in the `loop` worker
of tcMatchPats:
loop :: [LArgPat GhcRn] -> [ExpPatType] -> TcM ([LArgPat GhcTc], a)
loop (L l apat : pats) (ExpForAllPatTy (Bndr tv vis) : pat_tys)
...
-- NEW CLAUSE:
| InvisPat _ tp <- apat, isSpecifiedForAllTyFlag vis
= ...
In addition to that, tcMatchPats no longer discards type patterns. This
is done by filterOutErasedPats in the desugarer instead.
x86_64-linux-deb10-validate+debug_info
Metric Increase:
MultiLayerModulesTH_OneShot
- - - - -
486979b0 by Jade at 2024-02-19T07:12:13-05:00
Add specialized sconcat implementation for Data.Monoid.First and Data.Semigroup.First
Approved CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/246
Fixes: #24346
- - - - -
17e309d2 by John Ericson at 2024-02-19T07:12:49-05:00
Fix reST in users guide
It appears that aef587f65de642142c1dcba0335a301711aab951 wasn't valid syntax.
- - - - -
35b0ad90 by Brandon Chinn at 2024-02-19T07:13:25-05:00
Fix searching for errors in sphinx build
- - - - -
4696b966 by Cheng Shao at 2024-02-19T07:14:02-05:00
hadrian: fix wasm backend post linker script permissions
The post-link.mjs script was incorrectly copied and installed as a
regular data file without executable permission, this commit fixes it.
- - - - -
a6142e0c by Cheng Shao at 2024-02-19T07:14:40-05:00
testsuite: mark T23540 as fragile on i386
See #24449 for details.
- - - - -
b7172d5e by Andrei Borzenkov at 2024-02-19T16:19:44+04:00
Namespacing for fixity signatures (#14032)
Namespace specifiers were added to syntax of fixity signatures:
- sigdecl ::= infix prec ops | ...
+ sigdecl ::= infix prec namespace_spec ops | ...
To preserve namespace during renaming MiniFixityEnv type
now has separate FastStringEnv fields for names that should be
on the term level and for name that should be on the type level.
makeMiniFixityEnv function was changed to fill MiniFixityEnv in the right way:
- signatures without namespace specifiers fill both fields
- signatures with 'data' specifier fill data field only
- signatures with 'type' specifier fill type field only
Was added helper function lookupMiniFixityEnv that takes care about
looking for a name in an appropriate namespace.
Updates haddock submodule.
- - - - -
30 changed files:
- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/faf63a5a4ed2984e5c574f6d0ca8d03a5b0eb872...b7172d5e97e353df1dcf22e96732934982012f13
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/faf63a5a4ed2984e5c574f6d0ca8d03a5b0eb872...b7172d5e97e353df1dcf22e96732934982012f13
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/20240219/dd25e990/attachment-0001.html>
More information about the ghc-commits
mailing list