summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* users-guide: Rephrase the rewrite rule documentationwip/T21114Ben Gamari2022-08-151-2/+2
| | | | | | Previously the wording was a tad unclear. Fix this. Closes #21114.
* Revert "gitlab-ci: Add release job for aarch64/debian 11"Matthew Pickering2022-08-112-178/+0
| | | | | | | | | This reverts commit 5765e13370634979eb6a0d9f67aa9afa797bee46. The job was not tested before being merged and fails CI (https://gitlab.haskell.org/ghc/ghc/-/jobs/1139392) Ticket #22005
* EPA: DotFieldOcc does not have exact print annotationsAlan Zimmerman2022-08-1136-77/+160
| | | | | | | | | | | | | | | | | For the code {-# LANGUAGE OverloadedRecordUpdate #-} operatorUpdate f = f{(+) = 1} There are no exact print annotations for the parens around the + symbol, nor does normal ppr print them. This MR fixes that. Closes #21805 Updates haddock submodule
* Document that threadDelay / timeout are susceptible to overflows on 32-bit ↵Bodigrim2022-08-108-1/+48
| | | | machines
* Note [Trimming auto-rules]: State that this improves compiler perf.Andreas Klebinger2022-08-101-0/+7
|
* ncg/aarch64: Don't use x18 register on AArch64/Darwinnormalcoder2022-08-101-0/+8
| | | | | | | | | Apple's ABI documentation [1] says: "The platforms reserve register x18. Don’t use this register." While this wasn't problematic in previous Darwin releases, macOS 13 appears to start zeroing this register periodically. See #21964. [1] https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
* hadrian: Don't attempt to install documentation if doc/ doesn't existBen Gamari2022-08-101-4/+6
| | | | | | | | | Previously we would attempt to install documentation even if the `doc` directory doesn't exist (e.g. due to `--docs=none`). This would result in the surprising side-effect of the entire contents of the bindist being installed in the destination documentation directory. Fix this. Fixes #21976.
* gitlab-ci: Run ARMv7 jobs when ~ARM label is usedBen Gamari2022-08-102-75/+78
|
* gitlab-ci: Fix ARMv7 buildBen Gamari2022-08-102-5/+21
| | | | | | | It appears that the CI refactoring carried out in 5ff690b8474c74e9c968ef31e568c1ad0fe719a1 failed to carry over some critical configuration: setting the build/host/target platforms and forcing use of a non-broken linker.
* Add support for external static plugins (#20964)Sylvain Henry2022-08-1018-11/+341
| | | | | | | | | | | | | | | | | | | | This patch adds a new command-line flag: -fplugin-library=<file-path>;<unit-id>;<module>;<args> used like this: -fplugin-library=path/to/plugin.so;package-123;Plugin.Module;["Argument","List"] It allows a plugin to be loaded directly from a shared library. With this approach, GHC doesn't compile anything for the plugin and doesn't load any .hi file for the plugin and its dependencies. As such GHC doesn't need to support two environments (one for plugins, one for target code), which was the more ambitious approach tracked in #14335. Fix #20964 Co-authored-by: Josh Meredith <joshmeredith2008@gmail.com>
* hadrian RunRest: add type signature for stageNumberJens Petersen2022-08-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | avoids warning seen on 9.4.1: src/Settings/Builders/RunTest.hs:264:53: warning: [-Wtype-defaults] • Defaulting the following constraints to type ‘Integer’ (Show a0) arising from a use of ‘show’ at src/Settings/Builders/RunTest.hs:264:53-84 (Num a0) arising from a use of ‘stageNumber’ at src/Settings/Builders/RunTest.hs:264:59-83 • In the second argument of ‘(++)’, namely ‘show (stageNumber (C.stage ctx))’ In the second argument of ‘($)’, namely ‘"config.stage=" ++ show (stageNumber (C.stage ctx))’ In the expression: arg $ "config.stage=" ++ show (stageNumber (C.stage ctx)) | 264 | , arg "-e", arg $ "config.stage=" ++ show (stageNumber (C.stage ctx)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ compilation tested locally
* Updates language extension documentationTrevis Elser2022-08-1045-59/+107
| | | | | | | | | | | | | | | | Adding a 'Status' field with a few values: - Deprecated - Experimental - InternalUseOnly - Noting if included in 'GHC2021', 'Haskell2010' or 'Haskell98' Those values are pulled from the existing descriptions or elsewhere in the documentation. While at it, include the :implied by: where appropriate, to provide more detail. Fixes #21475
* base: Fix races in IOManager (setNumCapabilities,closeFdWith)Douglas Wilson2022-08-102-20/+75
| | | | | | | | | | | | | Fix for #21651 Fixes three bugs: - writes to eventManager should be atomic. It is accessed concurrently by ioManagerCapabilitiesChanged and closeFdWith. - The race in closeFdWith described in the ticket. - A race in getSystemEventManager where it accesses the 'IOArray' in 'eventManager' before 'ioManagerCapabilitiesChanged' has written to 'eventManager', causing an Array Index exception. The fix here is to 'yield' and retry.
* testsuite: 21651 add test for closeFdWith + setNumCapabilitiesDouglas Wilson2022-08-103-1/+135
| | | | | This bug does not affect windows, which does not use the base module GHC.Event.Thread.
* Fix size_up_alloc to account for UnliftedDatatypessheaf2022-08-091-4/+3
| | | | | | | | The size_up_alloc function mistakenly considered any type that isn't lifted to not allocate anything, which is wrong. What we want instead is to check the type isn't boxed. This accounts for (BoxedRep Unlifted). Fixes #21939
* gitlab-ci: Bump to use freebsd13 runnersBen Gamari2022-08-093-39/+40
|
* system-cxx-std-lib: Add support for FreeBSD libcxxrtBen Gamari2022-08-091-20/+55
|
* rts/linker: Resolve iconv_* on FreeBSDBen Gamari2022-08-091-9/+50
| | | | | | | | | | FreeBSD's libiconv includes an implementation of the iconv_* functions in libc. Unfortunately these can only be resolved using dlvsym, which is how the RTS linker usually resolves such functions. To fix this we include an ad-hoc special case for iconv_*. Fixes #20354.
* Cleanups around pretty-printingKrzysztof Gogolewski2022-08-0913-63/+27
| | | | | | | | | | * Remove hack when printing OccNames. No longer needed since e3dcc0d5 * Remove unused `pprCmms` and `instance Outputable Instr` * Simplify `pprCLabel` (no need to pass platform) * Remove evil `Show`/`Eq` instances for `SDoc`. They were needed by ImmLit, but that can take just a String instead. * Remove instance `Outputable CLabel` - proper output of labels needs a platform, and is done by the `OutputableP` instance
* hadrian: Fix access mode of installed package registration filesBen Gamari2022-08-091-0/+2
| | | | | | | | Previously hadrian's bindist Makefile would modify package registrations placed by `install` via a shell pipeline and `mv`. However, the use of `mv` means that if umask is set then the user may otherwise end up with package registrations which are inaccessible. Fix this by ensuring that the mode is 0644.
* hadrian: Fix bindist installation on DarwinBen Gamari2022-08-094-46/+41
| | | | | | | It turns out that `cp -P` on Darwin does not always copy a symlink as a symlink. In order to get these semantics one must pass `-RP`. It's not entirely clear whether this is valid under POSIX, but it is nevertheless what Apple does.
* gitlab-ci: Don't use coreutils on DarwinBen Gamari2022-08-091-1/+0
| | | | | | | | | In general we want to ensure that the tested environment is as similar as possible to the environment the user will use. In the case of Darwin, this means we want to use the system's BSD command-line utilities, not coreutils. This would have caught #21974.
* testsuite: Add test for #21962Ben Gamari2022-08-082-0/+12
|
* rts: Ensure that Array# card arrays are initializedBen Gamari2022-08-082-1/+7
| | | | | | | | | | | | In #19143 I noticed that newArray# failed to initialize the card table of newly-allocated arrays. However, embarrassingly, I then only fixed the issue in newArrayArray# and, in so doing, introduced the potential for an integer underflow on zero-length arrays (#21962). Here I fix the issue in newArray#, this time ensuring that we do not underflow in pathological cases. Fixes #19143.
* gitlab-ci: Add basic support for cross-compiler testiingBen Gamari2022-08-084-25/+65
| | | | Here we add a simple qemu-based test for cross-compilers.
* Bump process submoduleBen Gamari2022-08-081-0/+0
|
* gitlab-ci: Introduce validation job for aarch64 cross-compilationBen Gamari2022-08-082-1/+128
| | | | Begins to address #11958.
* gitlab-ci: Add release job for aarch64/debian 11Ben Gamari2022-08-082-0/+178
|
* Document a divergence from the report in parsing function lhss.Andreas Klebinger2022-08-081-0/+4
| | | | | | | | GHC is happy to parse `(f) x y = x + y` when it should be a parse error based on the Haskell report. Seems harmless enough so we won't fix it but it's documented now. Fixes #19788
* rts: remove redundant stg_traceCcszhCheng Shao2022-08-083-17/+0
| | | | | | This out-of-line primop has no Haskell wrapper and hasn't been used anywhere in the tree. Furthermore, the code gets in the way of !7632, so it should be garbage collected.
* dataToTag#: Skip runtime tag check if argument is infered taggedAndreas Klebinger2022-08-085-11/+499
| | | | This addresses one part of #21710.
* NCG(x86): Compile add+shift as lea if possible.wip/andreask/add_mul_leaAndreas Klebinger2022-08-084-0/+95
|
* hadrian: Extend xattr Darwin hack to cover /libBen Gamari2022-08-071-1/+7
| | | | | | | As noted in #21506, it is now necessary to remove extended attributes from `/lib` as well as `/bin` to avoid SIP issues on Darwin. Fixes #21506.
* hadrian: Fix naming of cross-compiler wrapperswip/cross-bindistBen Gamari2022-08-072-16/+22
|
* hadrian: Don't use mk/config.mk.inBen Gamari2022-08-074-3/+292
| | | | | | Ultimately we want to drop mk/config.mk so here I extract the bits needed by the Hadrian bindist installation logic into a Hadrian-specific file. While doing this I fixed binary distribution installation, #21901.
* gitlab-ci: Bump Docker imagesBen Gamari2022-08-071-1/+1
| | | | To give the ARMv7 job access to lld, fixing #21875.
* hadrian: Fix installation of system-cxx-std-lib package confBen Gamari2022-08-071-1/+1
|
* hadrian: Fix binary distribution install attributesBen Gamari2022-08-072-36/+61
| | | | | | | | | Previously we would use plain `cp` to install various parts of the binary distribution. However, `cp`'s behavior w.r.t. file attributes is quite unclear; for this reason it is much better to rather use `install`. Fixes #21965.
* users-guide: Add release notes entry for thread introspection supportwip/thread-statusBen Gamari2022-08-061-0/+5
|
* base: Share finalization thread labelBen Gamari2022-08-062-4/+12
| | | | | | For efficiency's sake we float the thread label assigned to the finalization thread to the top-level, ensuring that we only need to encode the label once.
* Add a primop to query the label of a threadBen Gamari2022-08-0610-1/+47
|
* rts: Move thread labels into TSOBen Gamari2022-08-0627-155/+154
| | | | | | | This eliminates the thread label HashTable and instead tracks this information in the TSO, allowing us to use proper StgArrBytes arrays for backing the label and greatly simplifying management of object lifetimes when we expose them to the user with the coming `threadLabel#` primop.
* Add primop to list threadsBen Gamari2022-08-0616-4/+135
| | | | | | | A user came to #ghc yesterday wondering how best to check whether they were leaking threads. We ended up using the eventlog but it seems to me like it would be generally useful if Haskell programs could query their own threads.
* base: Organize Haddocks in GHC.Conc.SyncBen Gamari2022-08-061-15/+22
|
* genprimopcode: Drop ArrayArray# referencesBen Gamari2022-08-061-2/+0
| | | | As ArrayArray# no longer exists
* rts: Fix code styleBen Gamari2022-08-061-14/+14
|
* compiler: Eliminate two uses of foldr in favor of foldl'Ben Gamari2022-08-062-2/+2
| | | | | | These two uses constructed maps, which is a case where foldl' is generally more efficient since we avoid constructing an intermediate O(n)-depth stack.
* gitlab-ci: Fix hadrian bootstrapping of release pipelinesBen Gamari2022-08-062-3/+11
| | | | | | | | | | | Previously we would attempt to test hadrian bootstrapping in the `validate` build flavour. However, `ci.sh` refuses to run validation builds during release pipelines, resulting in job failures. Fix this by testing bootstrapping in the `release` flavour during release pipelines. We also attempted to record perf notes for these builds, which is redundant work and undesirable now since we no longer build in a consistent flavour.
* Change `-fprof-late` to insert cost centres after unfolding creation.Andreas Klebinger2022-08-0617-43/+286
| | | | | | | | | | | | | | | | | | | | | | | | | | The former behaviour of adding cost centres after optimization but before unfoldings are created is not available via the flag `prof-late-inline` instead. I also reduced the overhead of -fprof-late* by pushing the cost centres into lambdas. This means the cost centres will only account for execution of functions and not their partial application. Further I made LATE_CC cost centres it's own CC flavour so they now won't clash with user defined ones if a user uses the same string for a custom scc. LateCC: Don't put cost centres inside constructor workers. With -fprof-late they are rarely useful as the worker is usually inlined. Even if the worker is not inlined or we use -fprof-late-linline they are generally not helpful but bloat compile and run time significantly. So we just don't add sccs inside constructor workers. ------------------------- Metric Decrease: T13701 -------------------------
* StgToCmm: Fix isSimpleScrut when profiling is enabled.Andreas Klebinger2022-08-063-27/+32
| | | | | | | | | | | When profiling is enabled we must enter functions that might represent thunks in order for their sccs to show up in the profile. We might allocate even if the function is already evaluated in this case. So we can't consider any potential function thunk to be a simple scrut when profiling. Not doing so caused profiled binaries to segfault.