summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Updates language extension documentationwip/telser/docs-extension-statusTrevis Elser2022-08-0945-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
* 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.
* Add one more sanity check in stg_restore_cccsAndreas Klebinger2022-08-061-0/+4
|
* Make dropTail comment a haddock commentAndreas Klebinger2022-08-061-1/+1
|
* Improve BUILD_PAP commentsAndreas Klebinger2022-08-061-0/+3
|
* Fix equality operator in jspace testMatthew Pickering2022-08-051-2/+2
|
* codeGen/X86: Don't clobber switch variable in switch generationBen Gamari2022-08-051-2/+3
| | | | | | | | | Previously ce8745952f99174ad9d3bdc7697fd086b47cdfb5 assumed that it was safe to clobber the switch variable when generating code for a jump table since we were at the end of a block. However, this assumption is wrong; the register could be live in the jump target. Fixes #21968.
* ci: Fix pages jobMatthew Pickering2022-08-051-1/+4
| | | | | | | The job has been failing because we don't bundle haddock docs anymore in the docs dist created by hadrian. Fixes #21789
* Remove backported items from 9.6 release notesKrzysztof Gogolewski2022-08-051-10/+1
| | | | | They have been backported to 9.4 in commits 5423d84bd9a28f, 13c81cb6be95c5, 67ccbd6b2d4b9b.
* findExternalRules: Don't needlessly traverse the list of rules.Andreas Klebinger2022-08-041-4/+3
|
* cmm: Remove unused ReadOnlyData16Cheng Shao2022-08-045-16/+0
| | | | We don't actually emit rodata16 sections anywhere.
* Store interfaces in ModIfaceCache more directlyMatthew Pickering2022-08-044-80/+56
| | | | | | | | I realised hydration was completely irrelavant for this cache because the ModDetails are pruned from the result. So now it simplifies things a lot to just store the ModIface and Linkable, which we can put into the cache straight away rather than wait for the final version of a HomeModInfo to appear.
* Fix leaks in --make mode when there are module loopsMatthew Pickering2022-08-0410-96/+405
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes quite a tricky leak where we would end up retaining stale ModDetails due to rehydrating modules against non-finalised interfaces. == Loops with multiple boot files It is possible for a module graph to have a loop (SCC, when ignoring boot files) which requires multiple boot files to break. In this case we must perform the necessary hydration steps before and after compiling modules which have boot files which are described above for corectness but also perform an additional hydration step at the end of the SCC to remove space leaks. Consider the following example: ┌───────┐ ┌───────┐ │ │ │ │ │ A │ │ B │ │ │ │ │ └─────┬─┘ └───┬───┘ │ │ ┌────▼─────────▼──┐ │ │ │ C │ └────┬─────────┬──┘ │ │ ┌────▼──┐ ┌───▼───┐ │ │ │ │ │ A-boot│ │ B-boot│ │ │ │ │ └───────┘ └───────┘ A, B and C live together in a SCC. Say we compile the modules in order A-boot, B-boot, C, A, B then when we compile A we will perform the hydration steps (because A has a boot file). Therefore C will be hydrated relative to A, and the ModDetails for A will reference C/A. Then when B is compiled C will be rehydrated again, and so B will reference C/A,B, its interface will be hydrated relative to both A and B. Now there is a space leak because say C is a very big module, there are now two different copies of ModDetails kept alive by modules A and B. The way to avoid this space leak is to rehydrate an entire SCC together at the end of compilation so that all the ModDetails point to interfaces for .hs files. In this example, when we hydrate A, B and C together then both A and B will refer to C/A,B. See #21900 for some more discussion. ------------------------------------------------------- In addition to this simple case, there is also the potential for a leak during parallel upsweep which is also fixed by this patch. Transcibed is Note [ModuleNameSet, efficiency and space leaks] Note [ModuleNameSet, efficiency and space leaks] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ During unsweep the results of compiling modules are placed into a MVar, to find the environment the module needs to compile itself in the MVar is consulted and the HomeUnitGraph is set accordingly. The reason we do this is that precisely tracking module dependencies and recreating the HUG from scratch each time is very expensive. In serial mode (-j1), this all works out fine because a module can only be compiled after its dependencies have finished compiling and not interleaved with compiling module loops. Therefore when we create the finalised or no loop interfaces, the HUG only contains finalised interfaces. In parallel mode, we have to be more careful because the HUG variable can contain non-finalised interfaces which have been started by another thread. In order to avoid a space leak where a finalised interface is compiled against a HPT which contains a non-finalised interface we have to restrict the HUG to only the visible modules. The visible modules is recording in the ModuleNameSet, this is propagated upwards whilst compiling and explains which transitive modules are visible from a certain point. This set is then used to restrict the HUG before the module is compiled to only the visible modules and thus avoiding this tricky space leak. Efficiency of the ModuleNameSet is of utmost importance because a union occurs for each edge in the module graph. Therefore the set is represented directly as an IntSet which provides suitable performance, even using a UniqSet (which is backed by an IntMap) is too slow. The crucial test of performance here is the time taken to a do a no-op build in --make mode. See test "jspace" for an example which used to trigger this problem. Fixes #21900
* Force name selectors to ensure no reference to Ids enter the NameCacheMatthew Pickering2022-08-041-2/+2
| | | | | | I observed some unforced thunks in the NameCache which were retaining a whole Id, which ends up retaining a Type.. which ends up retaining old copies of HscEnv containing stale HomeModInfo.
* Force safeInferred to avoid retaining extra copy of DynFlagsMatthew Pickering2022-08-041-1/+2
| | | | | | This will only have a (very) modest impact on memory but we don't want to retain old copies of DynFlags hanging around so best to force this value.