[Git][ghc/ghc][wip/supersven/ghc-master-riscv-ncg] 38 commits: JS: add basic support for POSIX *at functions (#25190)
Sven Tennie (@supersven)
gitlab at gitlab.haskell.org
Thu Sep 5 07:42:54 UTC 2024
Sven Tennie pushed to branch wip/supersven/ghc-master-riscv-ncg at Glasgow Haskell Compiler / GHC
Commits:
27dceb42 by Sylvain Henry at 2024-08-26T11:05:11-04:00
JS: add basic support for POSIX *at functions (#25190)
openat/fstatat/unlinkat/dup are now used in the recent release of the
`directory` and `file-io` packages.
As such, these functions are (indirectly) used in the following tests
one we'll bump the `directory` submodule (see !13122):
- openFile008
- jsOptimizer
- T20509
- bkpcabal02
- bkpcabal03
- bkpcabal04
- - - - -
c68be356 by Matthew Pickering at 2024-08-26T11:05:11-04:00
Update directory submodule to latest master
The primary reason for this bump is to fix the warning from `ghc-pkg
check`:
```
Warning: include-dirs: /data/home/ubuntu/.ghcup/ghc/9.6.2/lib/ghc-9.6.2/lib/../lib/aarch64-linux-ghc-9.6.2/directory-1.3.8.1/include doesn't exist or isn't a directory
```
This also requires adding the `file-io` package as a boot library (which
is discussed in #25145)
Fixes #23594 #25145
- - - - -
4ee094d4 by Matthew Pickering at 2024-08-26T11:05:47-04:00
Fix aarch64-alpine target platform description
We are producing bindists where the target triple is
aarch64-alpine-linux
when it should be
aarch64-unknown-linux
This is because the bootstrapped compiler originally set the target
triple to `aarch64-alpine-linux` which is when propagated forwards by
setting `bootstrap_target` from the bootstrap compiler target.
In order to break this chain we explicitly specify build/host/target for
aarch64-alpine.
This requires a new configure flag `--enable-ignore-` which just
switches off a validation check that the target platform of the
bootstrap compiler is the same as the build platform. It is the same,
but the name is just wrong.
These commits can be removed when the bootstrap compiler has the correct
target triple (I looked into patching this on ci-images, but it looked
hard to do correctly as the build/host platform is not in the settings
file).
Fixes #25200
- - - - -
e0e0f2b2 by Matthew Pickering at 2024-08-26T11:05:47-04:00
Bump nixpkgs commit for gen_ci script
- - - - -
63a27091 by doyougnu at 2024-08-26T20:39:30-04:00
rts: win32: emit additional debugging information
-- migration from haskell.nix
- - - - -
aaab3d10 by Vladislav Zavialov at 2024-08-26T20:40:06-04:00
Only export defaults when NamedDefaults are enabled (#25206)
This is a reinterpretation of GHC Proposal #409 that avoids a breaking
change introduced in fa0dbaca6c "Implements the Exportable Named Default proposal"
Consider a module M that has no explicit export list:
module M where
default (Rational)
Should it export the default (Rational)?
The proposal says "yes", and there's a test case for that:
default/DefaultImport04.hs
However, as it turns out, this change in behavior breaks existing
programs, e.g. the colour-2.3.6 package can no longer be compiled,
as reported in #25206.
In this patch, we make implicit exports of defaults conditional on
the NamedDefaults extension. This fix is unintrusive and compliant
with the existing proposal text (i.e. it does not require a proposal
amendment). Should the proposal be amended, we can go for a simpler
solution, such as requiring all defaults to be exported explicitly.
Test case: testsuite/tests/default/T25206.hs
- - - - -
3a5bebf8 by Matthew Pickering at 2024-08-28T14:16:42-04:00
simplifier: Fix space leak during demand analysis
The lazy structure (a list) in a strict field in `DmdType` is not fully
forced which leads to a very large thunk build-up.
It seems there is likely still more work to be done here as it seems we
may be trading space usage for work done. For now, this is the right
choice as rather than using all the memory on my computer, compilation
just takes a little bit longer.
See #25196
- - - - -
c2525e9e by Ryan Scott at 2024-08-28T14:17:17-04:00
Add missing parenthesizeHsType in cvtp's InvisP case
We need to ensure that when we convert an `InvisP` (invisible type pattern) to
a `Pat`, we parenthesize it (at precedence `appPrec`) so that patterns such as
`@(a :: k)` will parse correctly when roundtripped back through the parser.
Fixes #25209.
- - - - -
1499764f by Sjoerd Visscher at 2024-08-29T16:52:56+02:00
Haddock: Add no-compilation flag
This flag makes sure to avoid recompilation of the code when generating documentation by only reading the .hi and .hie files, and throw an error if it can't find them.
- - - - -
768fe644 by Andreas Klebinger at 2024-09-03T13:15:20-04:00
Add functions to check for weakly pinned arrays.
This commit adds `isByteArrayWeaklyPinned#` and `isMutableByteArrayWeaklyPinned#` primops.
These check if a bytearray is *weakly* pinned. Which means it can still be explicitly moved
by the user via compaction but won't be moved by the RTS.
This moves us one more stop closer to nailing down #22255.
- - - - -
b16605e7 by Arsen Arsenović at 2024-09-03T13:16:05-04:00
ghc-toolchain: Don't leave stranded a.outs when testing for -g0
This happened because, when ghc-toolchain tests for -g0, it does so by
compiling an empty program. This compilation creates an a.out.
Since we create a temporary directory, lets place the test program
compilation in it also, so that it gets cleaned up.
Fixes: 25b0b40467d0a12601497117c0ad14e1fcab0b74
Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/25203
- - - - -
83e70b14 by Torsten Schmits at 2024-09-03T13:16:41-04:00
Build foreign objects for TH with interpreter's way when loading from iface
Fixes #25211
When linking bytecode for TH from interface core bindings with
`-fprefer-byte-code`, foreign sources are loaded from the interface as
well and compiled to object code in an ad-hoc manner.
The results are then loaded by the interpreter, whose way may differ
from the current build's target way.
This patch ensures that foreign objects are compiled with the
interpreter's way.
- - - - -
0d3bc2fa by Cheng Shao at 2024-09-04T07:20:06-04:00
rts: fix checkClosure error message
This patch fixes an error message in checkClosure() when the closure
has already been evacuated. The previous logic was meant to print the
evacuated closure's type in the error message, but it was completely
wrong, given info was not really an info table, but a tagged pointer
that points to the closure's new address.
- - - - -
fb0a4e5c by Sven Tennie at 2024-09-04T07:20:43-04:00
MO_AcquireFence: Less restrictive barrier
GCC and CLang translate the built-in `atomic_thread_fence(memory_order_acquire)`
to `dmb ishld`, which is a bit less restrictive than `dmb ish` (which
also implies stores.)
- - - - -
a45f1488 by Fendor at 2024-09-04T20:22:00-04:00
testsuite: Add support to capture performance metrics via 'perf'
Performance metrics collected via 'perf' can be more accurate for
run-time performance than GHC's rts, due to the usage of hardware
counters.
We allow performance tests to also record PMU events according to 'perf
list'.
- - - - -
ce61fca5 by Fendor at 2024-09-04T20:22:00-04:00
gitlab-ci: Add nightly job for running the testsuite with perf profiling support
- - - - -
6dfb9471 by Fendor at 2024-09-04T20:22:00-04:00
Enable perf profiling for compiler performance tests
- - - - -
da306610 by sheaf at 2024-09-04T20:22:41-04:00
RecordCon lookup: don't allow a TyCon
This commit adds extra logic when looking up a record constructor.
If GHC.Rename.Env.lookupOccRnConstr returns a TyCon (as it may, due to
the logic explained in Note [Pattern to type (P2T) conversion]),
we emit an error saying that the data constructor is not in scope.
This avoids the compiler falling over shortly thereafter, in the call to
'lookupConstructorInfo' inside 'GHC.Rename.Env.lookupRecFieldOcc',
because the record constructor would not have been a ConLike.
Fixes #25056
- - - - -
9c354beb by Matthew Pickering at 2024-09-04T20:23:16-04:00
Use deterministic names for temporary files
When there are multiple threads they can race to create a temporary
file, in some situations the thread will create ghc_1.c and in some it
will create ghc_2.c. This filename ends up in the debug info for object
files after compiling a C file, therefore contributes to object
nondeterminism.
In order to fix this we store a prefix in `TmpFs` which serves to
namespace temporary files. The prefix is populated from the counter in
TmpFs when the TmpFs is forked. Therefore the TmpFs must be forked
outside the thread which consumes it, in a deterministic order, so each
thread always receives a TmpFs with the same prefix.
This assumes that after the initial TmpFs is created, all other TmpFs
are created from forking the original TmpFs. Which should have been try
anyway as otherwise there would be file collisions and non-determinism.
Fixes #25224
- - - - -
3a767377 by Sven Tennie at 2024-09-05T09:41:21+02:00
Add RISCV64 Native Code Generator (NCG)
This architecture wasn't supported before.
Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com>
- - - - -
0371de6d by Sven Tennie at 2024-09-05T09:41:21+02:00
async001: Adjust for slower computers
Increase the delay a bit to be able to run this test on slower
computers (e.g. RISCV64 LicheePi 4a.)
- - - - -
8d7f8882 by Sven Tennie at 2024-09-05T09:41:21+02:00
Add RTS linker for RISCV64
This architecture wasn't supported before.
Co-authored-by: Moritz Angermann <moritz.angermann at gmail.com>
- - - - -
c82ab120 by Sven Tennie at 2024-09-05T09:41:21+02:00
Ignore divbyzero test for RISCV64
The architecture's behaviour differs from the test's expectations. See
comment in code why this is okay.
- - - - -
1d6e0f7c by Sven Tennie at 2024-09-05T09:41:21+02:00
Enable MulMayOflo_full test for RISCV64
It works and thus can be tested.
- - - - -
0b2ba0da by Sven Tennie at 2024-09-05T09:41:21+02:00
LibffiAdjustor: Ensure code caches are flushed (RISCV64)
RISCV64 needs a specific code flushing sequence (involving fence.i) when
new code is created/loaded.
- - - - -
c7c15820 by Sven Tennie at 2024-09-05T09:41:21+02:00
Add additional linker symbols for builtins (RISCV64)
We're relying on some GCC/Clang builtins. These need to be visible to
the linker (and not be stripped away.)
- - - - -
41237342 by Sven Tennie at 2024-09-05T09:41:21+02:00
Add GHCi support for RISCV64
As we got a RTS linker for this architecture now, we can enable GHCi for
it.
- - - - -
c9f6a91a by Sven Tennie at 2024-09-05T09:41:21+02:00
Set codeowners of the RISCV64 NCG
- - - - -
1769afef by Sven Tennie at 2024-09-05T09:41:21+02:00
Add test for C calling convention
Ensure that parameters and return values are correctly processed. A
dedicated test (like this) helps to get the subtleties of calling
conventions easily right.
- - - - -
fa0313d7 by Sven Tennie at 2024-09-05T09:41:21+02:00
WIP: FIXUP for master
Will be squashed later. For now it's convenient to have a separate commit.
- - - - -
6a790662 by Sven Tennie at 2024-09-05T09:41:21+02:00
RISCV64 has rtsLinker
Likely a mistake during merge.
- - - - -
6fdedddc by Sven Tennie at 2024-09-05T09:41:21+02:00
Make switch/jump tables PIC compatible
- - - - -
0680e603 by Sven Tennie at 2024-09-05T09:41:21+02:00
Improve documentation for stack spills
- - - - -
f0c7c300 by Sven Tennie at 2024-09-05T09:41:22+02:00
Reformat stack spill code
- - - - -
ac90700a by Sven Tennie at 2024-09-05T09:41:22+02:00
Make instruction types strict in their fields
This should prevent memory leaks.
- - - - -
c3beff6c by Sven Tennie at 2024-09-05T09:41:22+02:00
Use FCVT constructor for all float-related conversions
This is closer to the assembly instruction and should reduce confusion.
- - - - -
230bb190 by Sven Tennie at 2024-09-05T09:41:22+02:00
Fix regression in RISCV64 RTS linker
The check was non-sense.
- - - - -
98685673 by Sven Tennie at 2024-09-05T09:41:22+02:00
Adjust test timings for small machines
The reference was a Lichee Pi 4a RISCV64 machine.
- - - - -
18 changed files:
- .gitlab/generate-ci/flake.lock
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitmodules
- CODEOWNERS
- compiler/CodeGen.Platform.h
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/Dwarf/Constants.hs
- compiler/GHC/CmmToAsm/PIC.hs
- + compiler/GHC/CmmToAsm/RV64.hs
- + compiler/GHC/CmmToAsm/RV64/CodeGen.hs
- + compiler/GHC/CmmToAsm/RV64/Cond.hs
- + compiler/GHC/CmmToAsm/RV64/Instr.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/22fc1a09dda3e9373f83c16a05d4a72636ae65e4...98685673cd9cd4a8bc438187f05cd64429f23ab3
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/22fc1a09dda3e9373f83c16a05d4a72636ae65e4...98685673cd9cd4a8bc438187f05cd64429f23ab3
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/20240905/d06d7bc6/attachment-0001.html>
More information about the ghc-commits
mailing list