[Git][ghc/ghc][wip/or-pats] 97 commits: CI: Don't run lint-submods on nightly

David (@knothed) gitlab at gitlab.haskell.org
Wed Nov 16 12:32:48 UTC 2022



David pushed to branch wip/or-pats at Glasgow Haskell Compiler / GHC


Commits:
c2872f3f by Bryan Richter at 2022-10-28T11:36:34+03:00
CI: Don't run lint-submods on nightly

Fixes #22325

- - - - -
270037fa by Hécate Moonlight at 2022-10-28T19:46:12-04:00
Start the deprecation process for GHC.Pack

- - - - -
d45d8cb3 by M Farkas-Dyck at 2022-11-01T12:47:21-04:00
Drop a kludge for binutils<2.17, which is now over 10 years old.

- - - - -
8ee8b418 by Nicolas Trangez at 2022-11-01T12:47:58-04:00
rts: `name` argument of `createOSThread` can be `const`

Since we don't intend to ever change the incoming string, declare this
to be true.

Also, in the POSIX implementation, the argument is no longer `STG_UNUSED`
(since ee0deb8054da2a597fc5624469b4c44fd769ada2) in any code path.

See: https://gitlab.haskell.org/ghc/ghc/-/commit/ee0deb8054da2a597fc5624469b4c44fd769ada2#note_460080

- - - - -
13b5f102 by Nicolas Trangez at 2022-11-01T12:47:58-04:00
rts: fix lifetime of `start_thread`s `name` value

Since, unlike the code in ee0deb8054da2^, usage of the `name` value
passed to `createOSThread` now outlives said function's lifetime, and
could hence be released by the caller by the time the new thread runs
`start_thread`, it needs to be copied.

See: https://gitlab.haskell.org/ghc/ghc/-/commit/ee0deb8054da2a597fc5624469b4c44fd769ada2#note_460080
See: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9066

- - - - -
edd175c9 by Nicolas Trangez at 2022-11-01T12:47:58-04:00
rts: fix OS thread naming in ticker

Since ee0deb805, the use of `pthread_setname_np` on Darwin was fixed
when invoking `createOSThread`. However, the 'ticker' has some
thread-creation code which doesn't rely on `createOSThread`, yet also
uses `pthread_setname_np`.

This patch enforces all thread creation to go through a single
function, which uses the (correct) thread-naming code introduced in
ee0deb805.

See: https://gitlab.haskell.org/ghc/ghc/-/commit/ee0deb8054da2a597fc5624469b4c44fd769ada2
See: https://gitlab.haskell.org/ghc/ghc/-/issues/22206
See: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9066

- - - - -
b7a00113 by Krzysztof Gogolewski at 2022-11-01T12:48:35-04:00
Typo: rename -fwrite-if-simplfied-core to -fwrite-if-simplified-core

- - - - -
30e625e6 by Vladislav Zavialov at 2022-11-01T12:49:10-04:00
ThToHs: fix overzealous parenthesization

Before this patch, when converting from TH.Exp to LHsExpr GhcPs,
the compiler inserted more parentheses than required:

	((f a) (b + c)) d

This was happening because the LHS of the function application was
parenthesized as if it was the RHS.

Now we use funPrec and appPrec appropriately and produce sensibly
parenthesized expressions:

	f a (b + c) d

I also took the opportunity to remove the special case for LamE,
which was not special at all and simply duplicated code.

- - - - -
0560821f by Simon Peyton Jones at 2022-11-01T12:49:47-04:00
Add accurate skolem info when quantifying

Ticket #22379 revealed that skolemiseQuantifiedTyVar was
dropping the passed-in skol_info on the floor when it encountered
a SkolemTv.  Bad!  Several TyCons thereby share a single SkolemInfo
on their binders, which lead to bogus error reports.

- - - - -
38d19668 by Fendor at 2022-11-01T12:50:25-04:00
Expose UnitEnvGraphKey for user-code

- - - - -
77e24902 by Simon Peyton Jones at 2022-11-01T12:51:00-04:00
Shrink test case for #22357

Ryan Scott offered a cut-down repro case
(60 lines instead of more than 700 lines)

- - - - -
4521f649 by Simon Peyton Jones at 2022-11-01T12:51:00-04:00
Add two tests for #17366

- - - - -
6b400d26 by Nicolas Trangez at 2022-11-02T12:06:48-04:00
rts: introduce (and use) `STG_NORETURN`

Instead of sprinkling the codebase with
`GNU(C3)_ATTRIBUTE(__noreturn__)`, add a `STG_NORETURN` macro (for,
basically, the same thing) similar to `STG_UNUSED` and others, and
update the code to use this macro where applicable.

- - - - -
f9638654 by Nicolas Trangez at 2022-11-02T12:06:48-04:00
rts: consistently use `STG_UNUSED`

- - - - -
81a58433 by Nicolas Trangez at 2022-11-02T12:06:48-04:00
rts: introduce (and use) `STG_USED`

Similar to `STG_UNUSED`, have a specific macro for
`__attribute__(used)`.

- - - - -
41e1f748 by Nicolas Trangez at 2022-11-02T12:06:48-04:00
rts: introduce (and use) `STG_MALLOC`

Instead of using `GNUC3_ATTRIBUTE(__malloc__)`, provide a `STG_MALLOC`
macro definition and use it instead.

- - - - -
3a9a8bde by Nicolas Trangez at 2022-11-02T12:06:48-04:00
rts: use `STG_UNUSED`

- - - - -
9ab999de by Nicolas Trangez at 2022-11-02T12:06:48-04:00
rts: specify deallocator of allocating functions

This patch adds a new `STG_MALLOC1` macro (and its counterpart
`STG_MALLOC2` for completeness) which allows to specify the deallocation
function to be used with allocations of allocating functions, and
applies it to `stg*allocBytes`.

It also fixes a case where `free` was used to free up an
`stgMallocBytes` allocation, found by the above change.

See: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-malloc-function-attribute
See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381

- - - - -
81c0c7c9 by Nicolas Trangez at 2022-11-02T12:06:48-04:00
rts: use `alloc_size` attribute

This patch adds the `STG_ALLOC_SIZE1` and `STG_ALLOC_SIZE2` macros which
allow to set the `alloc_size` attribute on functions, when available.

See: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alloc_005fsize-function-attribute
See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381

- - - - -
99a1d896 by Nicolas Trangez at 2022-11-02T12:06:48-04:00
rts: add and use `STG_RETURNS_NONNULL`

See: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-returns_005fnonnull-function-attribute
See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381

- - - - -
c235b399 by Nicolas Trangez at 2022-11-02T12:06:48-04:00
rts: tag `stgStrndup` as `STG_MALLOC`

See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381

- - - - -
ed81b448 by Oleg Grenrus at 2022-11-02T12:07:27-04:00
Move Symbol implementation note out of public haddock

- - - - -
284fd39c by Ben Gamari at 2022-11-03T01:58:54-04:00
gen-dll: Drop it

Currently it is only used by the make build system, which is soon to be
retired, and it has not built since 41cf758b. We may need to reintroduce
it when dynamic-linking support is introduced on Windows, but we will
cross that bridge once we get there.

Fixes #21753.

- - - - -
24f4f54f by Matthew Pickering at 2022-11-03T01:59:30-04:00
Port foundation numeric tests to GHC testsuite

This commit ports the numeric tests which found a regression in GHC-9.4.

https://github.com/haskell-foundation/foundation/issues/571

Included in the commit is a simple random number generator and
simplified QuickCheck implementation. In future these could be factored
out of this standalone file and reused as a general purpose library
which could be used for other QuickCheck style tests in the testsuite.

See #22282

- - - - -
d51bf7bd by M Farkas-Dyck at 2022-11-03T02:00:13-04:00
git: ignore HIE files.

Cleans up git status if one sets -fwrite-ide-info in hadrian/ghci.

- - - - -
a9fc15b1 by Matthew Pickering at 2022-11-03T02:00:49-04:00
Clarify status of bindings in WholeCoreBindings

Gergo points out that these bindings are tidied, rather than prepd as
the variable claims. Therefore we update the name of the variable to
reflect reality and add a comment to the data type to try to erase any
future confusion.

Fixes #22307

- - - - -
634da448 by Bodigrim at 2022-11-03T21:25:02+00:00
Fix haddocks for GHC.IORef

- - - - -
31125154 by Andreas Klebinger at 2022-11-03T23:08:09-04:00
Export pprTrace and friends from GHC.Prelude.

Introduces GHC.Prelude.Basic which can be used in modules which are a
dependency of the ppr code.

- - - - -
bdc8cbb3 by Bryan Richter at 2022-11-04T10:27:37+02:00
CI: Allow hadrian-ghc-in-ghci to run in nightlies

Since lint-submods doesn't run in nightlies, hadrian-ghc-in-ghci needs
to mark it as "optional" so it can run if the job doesn't exist.

Fixes #22396.

- - - - -
3c0e3793 by Krzysztof Gogolewski at 2022-11-05T00:29:57-04:00
Minor refactor around FastStrings

Pass FastStrings to functions directly, to make sure the rule
for fsLit "literal" fires.

Remove SDoc indirection in GHCi.UI.Tags and GHC.Unit.Module.Graph.

- - - - -
e41b2f55 by Matthew Pickering at 2022-11-05T14:18:10+00:00
Bump unix submodule to 2.8.0.0

Also bumps process and ghc-boot bounds on unix.

For hadrian, when cross-compiling, we add -Wwarn=unused-imports
-Wwarn=unused-top-binds to validation flavour. Further fixes in unix
and/or hsc2hs is needed to make it completely free of warnings; for
the time being, this change is needed to unblock other
cross-compilation related work.

- - - - -
42938a58 by Matthew Pickering at 2022-11-05T14:18:10+00:00
Bump Win32 submodule to 2.13.4.0

Fixes #22098

- - - - -
e7372bc5 by Cheng Shao at 2022-11-06T13:15:22+00:00
Bump ci-images revision

ci-images has recently been updated, including changes needed for wasm32-wasi CI.

- - - - -
88cb9492 by Cheng Shao at 2022-11-06T13:15:22+00:00
Bump gmp-tarballs submodule

Includes a fix for wasm support, doesn't impact other targets.

- - - - -
69427ce9 by Cheng Shao at 2022-11-06T13:15:22+00:00
Bump haskeline submodule

Includes a fix for wasm support, doesn't impact other targets.

- - - - -
5fe11fe6 by Carter Schonwald at 2022-11-07T13:22:14-05:00
bump llvm upper bound
- - - - -
68f49874 by M Farkas-Dyck at 2022-11-08T12:53:55-05:00
Define `Infinite` list and use where appropriate.

Also add perf test for infinite list fusion.

In particular, in `GHC.Core`, often we deal with infinite lists of roles. Also in a few locations we deal with infinite lists of names.

Thanks to simonpj for helping to write the Note [Fusion for `Infinite` lists].

- - - - -
ce726cd2 by Ross Paterson at 2022-11-08T12:54:34-05:00
Fix TypeData issues (fixes #22315 and #22332)

There were two bugs here:

1. Treating type-level constructors as PromotedDataCon doesn't always
   work, in particular because constructors promoted via DataKinds are
   called both T and 'T. (Tests T22332a, T22332b, T22315a, T22315b)
   Fix: guard these cases with isDataKindsPromotedDataCon.

2. Type-level constructors were sent to the code generator, producing
   things like constructor wrappers. (Tests T22332a, T22332b)
   Fix: test for them in isDataTyCon.

Other changes:

* changed the marking of "type data" DataCon's as suggested by SPJ.

* added a test TDGADT for a type-level GADT.

* comment tweaks

* change tcIfaceTyCon to ignore IfaceTyConInfo, so that IfaceTyConInfo
  is used only for pretty printing, not for typechecking. (SPJ)

- - - - -
132f8908 by Jade Lovelace at 2022-11-08T12:55:18-05:00
Clarify msum/asum documentation

- - - - -
bb5888c5 by Jade Lovelace at 2022-11-08T12:55:18-05:00
Add example for (<$)

- - - - -
080fffa1 by Jade Lovelace at 2022-11-08T12:55:18-05:00
Document what Alternative/MonadPlus instances actually do

- - - - -
92ccb8de by Giles Anderson at 2022-11-09T09:27:52-05:00
Use TcRnDiagnostic in GHC.Tc.TyCl.Instance (#20117)

The following `TcRnDiagnostic` messages have been introduced:

TcRnWarnUnsatisfiedMinimalDefinition
TcRnMisplacedInstSig
TcRnBadBootFamInstDeclErr
TcRnIllegalFamilyInstance
TcRnAssocInClassErr
TcRnBadFamInstDecl
TcRnNotOpenFamily

- - - - -
90c5abd4 by Hécate Moonlight at 2022-11-09T09:28:30-05:00
GHCi tags generation phase 2

see #19884

- - - - -
f9f17b68 by Simon Peyton Jones at 2022-11-10T12:20:03+00:00
Fire RULES in the Specialiser

The Specialiser has, for some time, fires class-op RULES in the
specialiser itself: see
   Note [Specialisation modulo dictionary selectors]

This MR beefs it up a bit, so that it fires /all/ RULES in the
specialiser, not just class-op rules.  See
   Note [Fire rules in the specialiser]
The result is a bit more specialisation; see test
   simplCore/should_compile/T21851_2

This pushed me into a bit of refactoring.  I made a new data types
GHC.Core.Rules.RuleEnv, which combines
  - the several source of rules (local, home-package, external)
  - the orphan-module dependencies

in a single record for `getRules` to consult.  That drove a bunch of
follow-on refactoring, including allowing me to remove
cr_visible_orphan_mods from the CoreReader data type.

I moved some of the RuleBase/RuleEnv stuff into GHC.Core.Rule.

The reorganisation in the Simplifier improve compile times a bit
(geom mean -0.1%), but T9961 is an outlier

Metric Decrease:
    T9961

- - - - -
2b3d0bee by Simon Peyton Jones at 2022-11-10T12:21:13+00:00
Make indexError work better

The problem here is described at some length in
Note [Boxity for bottoming functions] and
Note [Reboxed crud for bottoming calls] in GHC.Core.Opt.DmdAnal.

This patch adds a SPECIALISE pragma for indexError, which
makes it much less vulnerable to the problem described in
these Notes.

(This came up in another line of work, where a small change made
indexError do reboxing (in nofib/spectral/simple/table_sort)
that didn't happen before my change.  I've opened #22404
to document the fagility.

- - - - -
399e921b by Simon Peyton Jones at 2022-11-10T12:21:14+00:00
Fix DsUselessSpecialiseForClassMethodSelector msg

The error message for DsUselessSpecialiseForClassMethodSelector
was just wrong (a typo in some earlier work); trivial fix

- - - - -
dac0682a by Sebastian Graf at 2022-11-10T21:16:01-05:00
WorkWrap: Unboxing unboxed tuples is not always useful (#22388)

See Note [Unboxing through unboxed tuples].

Fixes #22388.

- - - - -
1230c268 by Sebastian Graf at 2022-11-10T21:16:01-05:00
Boxity: Handle argument budget of unboxed tuples correctly (#21737)

Now Budget roughly tracks the combined width of all arguments after unarisation.
See the changes to `Note [Worker argument budgets]`.

Fixes #21737.

- - - - -
2829fd92 by Cheng Shao at 2022-11-11T00:26:54-05:00
autoconf: check getpid getuid raise

This patch adds checks for getpid, getuid and raise in autoconf. These
functions are absent in wasm32-wasi and thus needs to be checked.

- - - - -
f5dfd1b4 by Cheng Shao at 2022-11-11T00:26:55-05:00
hadrian: add -Wwarn only for cross-compiling unix

- - - - -
2e6ab453 by Cheng Shao at 2022-11-11T00:26:55-05:00
hadrian: add targetSupportsThreadedRts flag

This patch adds a targetSupportsThreadedRts flag to indicate whether
the target supports the threaded rts at all, different from existing
targetSupportsSMP that checks whether -N is supported by the RTS. All
existing flavours have also been updated accordingly to respect this
flags.

Some targets (e.g. wasm32-wasi) does not support the threaded rts,
therefore this flag is needed for the default flavours to work. It
makes more sense to have proper autoconf logic to check for threading
support, but for the time being, we just set the flag to False iff the
target is wasm32.

- - - - -
8104f6f5 by Cheng Shao at 2022-11-11T00:26:55-05:00
Fix Cmm symbol kind

- - - - -
b2035823 by Norman Ramsey at 2022-11-11T00:26:55-05:00
add the two key graph modules from Martin Erwig's FGL

Martin Erwig's FGL (Functional Graph Library) provides an "inductive"
representation of graphs.  A general graph has labeled nodes and
labeled edges.  The key operation on a graph is to decompose it by
removing one node, together with the edges that connect the node to
the rest of the graph.  There is also an inverse composition
operation.

The decomposition and composition operations make this representation
of graphs exceptionally well suited to implement graph algorithms in
which the graph is continually changing, as alluded to in #21259.

This commit adds `GHC.Data.Graph.Inductive.Graph`, which defines the
interface, and `GHC.Data.Graph.Inductive.PatriciaTree`, which provides
an implementation.  Both modules are taken from `fgl-5.7.0.3` on
Hackage, with these changes:

  - Copyright and license text have been copied into the files
    themselves, not stored separately.

  - Some calls to `error` have been replaced with calls to `panic`.

  - Conditional-compilation support for older versions of GHC,
    `containers`, and `base` has been removed.

- - - - -
3633a5f5 by Norman Ramsey at 2022-11-11T00:26:55-05:00
add new modules for reducibility and WebAssembly translation

- - - - -
df7bfef8 by Cheng Shao at 2022-11-11T00:26:55-05:00
Add support for the wasm32-wasi target tuple

This patch adds the wasm32-wasi tuple support to various places in the
tree: autoconf, hadrian, ghc-boot and also the compiler. The codegen
logic will come in subsequent commits.

- - - - -
32ae62e6 by Cheng Shao at 2022-11-11T00:26:55-05:00
deriveConstants: parse .ll output for wasm32 due to broken nm

This patch makes deriveConstants emit and parse an .ll file when
targeting wasm. It's a necessary workaround for broken llvm-nm on
wasm, which isn't capable of reporting correct constant values when
parsing an object.

- - - - -
07e92c92 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: workaround cmm's improper variadic ccall breaking wasm32 typechecking

Unlike other targets, wasm requires the function signature of the call
site and callee to strictly match. So in Cmm, when we call a C
function that actually returns a value, we need to add an _unused
local variable to receive it, otherwise type error awaits.

An even bigger problem is calling variadic functions like barf() and
such. Cmm doesn't support CAPI calling convention yet, so calls to
variadic functions just happen to work in some cases with some
target's ABI. But again, it doesn't work with wasm. Fortunately, the
wasm C ABI lowers varargs to a stack pointer argument, and it can be
passed NULL when no other arguments are expected to be passed. So we
also add the additional unused NULL arguments to those functions, so
to fix wasm, while not affecting behavior on other targets.

- - - - -
00124d12 by Cheng Shao at 2022-11-11T00:26:55-05:00
testsuite: correct sleep() signature in T5611

In libc, sleep() returns an integer. The ccall type signature should
match the libc definition, otherwise it causes linker error on wasm.

- - - - -
d72466a9 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: prefer ffi_type_void over FFI_TYPE_VOID

This patch uses ffi_type_void instead of FFI_TYPE_VOID in the
interpreter code, since the FFI_TYPE_* macros are not available in
libffi-wasm32 yet. The libffi public documentation also only mentions
the lower-case ffi_type_* symbols, so we should prefer the lower-case
API here.

- - - - -
4d36a1d3 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: don't define RTS_USER_SIGNALS when signal.h is not present

In the rts, we have a RTS_USER_SIGNALS macro, and most signal-related
logic is guarded with RTS_USER_SIGNALS. This patch extends the range
of code guarded with RTS_USER_SIGNALS, and define RTS_USER_SIGNALS iff
signal.h is actually detected by autoconf. This is required for
wasm32-wasi to work, which lacks signals.

- - - - -
3f1e164f by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: use HAVE_GETPID to guard subprocess related logic

We've previously added detection of getpid() in autoconf. This patch
uses HAVE_GETPID to guard some subprocess related logic in the RTS.
This is required for certain targets like wasm32-wasi, where there
isn't a process model at all.

- - - - -
50bf5e77 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: IPE.c: don't do mutex stuff when THREADED_RTS is not defined

This patch adds the missing THREADED_RTS CPP guard to mutex logic in
IPE.c.

- - - - -
ed3b3da0 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: genericRaise: use exit() instead when not HAVE_RAISE

We check existence of raise() in autoconf, and here, if not
HAVE_RAISE, we should use exit() instead in genericRaise.

- - - - -
c0ba1547 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: checkSuid: don't do it when not HAVE_GETUID

When getuid() is not present, don't do checkSuid since it doesn't make
sense anyway on that target.

- - - - -
d2d6dfd2 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: wasm32 placeholder linker

This patch adds minimal placeholder linker logic for wasm32, just
enough to unblock compiling rts on wasm32. RTS linker functionality is
not properly implemented yet for wasm32.

- - - - -
65ba3285 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: RtsStartup: chdir to PWD on wasm32

This patch adds a wasm32-specific behavior to RtsStartup logic. When
the PWD environment variable is present, we chdir() to it first.

The point is to workaround an issue in wasi-libc: it's currently not
possible to specify the initial working directory, it always defaults
to / (in the virtual filesystem mapped from some host directory). For
some use cases this is sufficient, but there are some other cases
(e.g. in the testsuite) where the program needs to access files
outside.

- - - - -
65b82542 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: no timer for wasm32

Due to the lack of threads, on wasm32 there can't be a background
timer that periodically resets the context switch flag. This patch
disables timer for wasm32, and also makes the scheduler default to -C0
on wasm32 to avoid starving threads.

- - - - -
e007586f by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: RtsSymbols: empty RTS_POSIX_ONLY_SYMBOLS for wasm32

The default RTS_POSIX_ONLY_SYMBOLS doesn't make sense on wasm32.

- - - - -
0e33f667 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: Schedule: no FORKPROCESS_PRIMOP_SUPPORTED on wasm32

On wasm32 there isn't a process model at all, so no
FORKPROCESS_PRIMOP_SUPPORTED.

- - - - -
88bbdb31 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: LibffiAdjustor: adapt to ffi_alloc_prep_closure interface for wasm32

libffi-wasm32 only supports non-standard libffi closure api via
ffi_alloc_prep_closure(). This patch implements
ffi_alloc_prep_closure() via standard libffi closure api on other
targets, and uses it to implement adjustor functionality.

- - - - -
15138746 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: don't return memory to OS on wasm32

This patch makes the storage manager not return any memory on wasm32.
The detailed reason is described in Note [Megablock allocator on
wasm].

- - - - -
631af3cc by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: make flushExec a no-op on wasm32

This patch makes flushExec a no-op on wasm32, since there's no such
thing as executable memory on wasm32 in the first place.

- - - - -
654a3d46 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: RtsStartup: don't call resetTerminalSettings, freeThreadingResources on wasm32

This patch prevents resetTerminalSettings and freeThreadingResources
to be called on wasm32, since there is no TTY or threading on wasm32
at all.

- - - - -
f271e7ca by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: OSThreads.h: stub types for wasm32

This patch defines stub Condition/Mutex/OSThreadId/ThreadLocalKey
types for wasm32, just enough to unblock compiling RTS. Any
threading-related functionality has been patched to be disabled on
wasm32.

- - - - -
a6ac67b0 by Cheng Shao at 2022-11-11T00:26:55-05:00
Add register mapping for wasm32

This patch adds register mapping logic for wasm32. See Note [Register
mapping on WebAssembly] in wasm32 NCG for more description.

- - - - -
d7b33982 by Cheng Shao at 2022-11-11T00:26:55-05:00
rts: wasm32 specific logic

This patch adds the rest of wasm32 specific logic in rts.

- - - - -
7f59b0f3 by Cheng Shao at 2022-11-11T00:26:55-05:00
base: fall back to using monotonic clock to emulate cputime on wasm32

On wasm32, we have to fall back to using monotonic clock to emulate
cputime, since there's no native support for cputime as a clock id.

- - - - -
5fcbae0b by Cheng Shao at 2022-11-11T00:26:55-05:00
base: more autoconf checks for wasm32

This patch adds more autoconf checks to base, since those functions
and headers may exist on other POSIX systems but don't exist on
wasm32.

- - - - -
00a9359f by Cheng Shao at 2022-11-11T00:26:55-05:00
base: avoid using unsupported posix functionality on wasm32

This base patch avoids using unsupported posix functionality on
wasm32.

- - - - -
34b8f611 by Cheng Shao at 2022-11-11T00:26:55-05:00
autoconf: set CrossCompiling=YES in cross bindist configure

This patch fixes the bindist autoconf logic to properly set
CrossCompiling=YES when it's a cross GHC bindist.

- - - - -
5ebeaa45 by Cheng Shao at 2022-11-11T00:26:55-05:00
compiler: add util functions for UniqFM and UniqMap

This patch adds addToUFM_L (backed by insertLookupWithKey),
addToUniqMap_L and intersectUniqMap_C. These UniqFM/UniqMap util
functions are used by the wasm32 NCG.

- - - - -
177c56c1 by Cheng Shao at 2022-11-11T00:26:55-05:00
driver: avoid -Wl,--no-as-needed for wasm32

The driver used to pass -Wl,--no-as-needed for LLD linking. This is
actually only supported for ELF targets, and must be avoided when
linking for wasm32.

- - - - -
06f01c74 by Cheng Shao at 2022-11-11T00:26:55-05:00
compiler: allow big arith for wasm32

This patch enables Cmm big arithmetic on wasm32, since 64-bit
arithmetic can be efficiently lowered to wasm32 opcodes.

- - - - -
df6bb112 by Cheng Shao at 2022-11-11T00:26:55-05:00
driver: pass -Wa,--no-type-check for wasm32 when runAsPhase

This patch passes -Wa,--no-type-check for wasm32 when compiling
assembly. See the added note for more detailed explanation.

- - - - -
c1fe4ab6 by Cheng Shao at 2022-11-11T00:26:55-05:00
compiler: enforce cmm switch planning for wasm32

This patch forcibly enable Cmm switch planning for wasm32, since
otherwise the switch tables we generate may exceed the br_table
maximum allowed size.

- - - - -
a8adc71e by Cheng Shao at 2022-11-11T00:26:55-05:00
compiler: annotate CmmFileEmbed with blob length

This patch adds the blob length field to CmmFileEmbed. The wasm32 NCG
needs to know the precise size of each data segment.

- - - - -
36340328 by Cheng Shao at 2022-11-11T00:26:55-05:00
compiler: wasm32 NCG

This patch adds the wasm32 NCG.

- - - - -
435f42ea by Cheng Shao at 2022-11-11T00:26:55-05:00
ci: add wasm32-wasi release bindist job

- - - - -
d8262fdc by Cheng Shao at 2022-11-11T00:26:55-05:00
ci: add a stronger test for cross bindists

This commit adds a simple GHC API program that parses and reprints the
original hello world program used for basic testing of cross bindists.
Before there's full cross-compilation support in the test suite
driver, this provides better coverage than the original test.

- - - - -
8e6ae882 by Cheng Shao at 2022-11-11T00:26:55-05:00
CODEOWNERS: add wasm-specific maintainers

- - - - -
707d5651 by Zubin Duggal at 2022-11-11T00:27:31-05:00
Clarify that LLVM upper bound is non-inclusive during configure (#22411)

- - - - -
7eafd80f by David Knothe at 2022-11-11T10:34:32+01:00
Preliminary Or-Pattern impl

- - - - -
b4a8586b by David Knothe at 2022-11-11T10:34:33+01:00
Use ';;' for or patterns

- - - - -
75d39daa by David Knothe at 2022-11-11T10:34:33+01:00
Remove old parsing of '||'

- - - - -
c36350a7 by David Knothe at 2022-11-11T10:34:33+01:00
Use ;; for ppr

- - - - -
c9cc6b54 by David Knothe at 2022-11-11T10:34:33+01:00
add one

- - - - -
cf70d97c by David Knothe at 2022-11-16T13:32:35+01:00
Fix one of

- - - - -


30 changed files:

- .gitignore
- .gitlab-ci.yml
- .gitlab/ci.sh
- + .gitlab/hello.hs
- CODEOWNERS
- compiler/CodeGen.Platform.h
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/BlockId.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Expr.hs
- + compiler/GHC/Cmm/Reducibility.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/AArch64/Regs.hs
- compiler/GHC/CmmToAsm/BlockLayout.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/PPC/Regs.hs
- compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs
- compiler/GHC/CmmToAsm/Reg/Target.hs
- + compiler/GHC/CmmToAsm/Wasm.hs
- + compiler/GHC/CmmToAsm/Wasm/Asm.hs
- + compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- + compiler/GHC/CmmToAsm/Wasm/Types.hs
- + compiler/GHC/CmmToAsm/Wasm/Utils.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/69d746805fa00eff89e2b9feda5a30737d465aef...cf70d97c456903f88e5016028ace544a615ba84e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/69d746805fa00eff89e2b9feda5a30737d465aef...cf70d97c456903f88e5016028ace544a615ba84e
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/20221116/c7051887/attachment-0001.html>


More information about the ghc-commits mailing list