summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* rts/stm: Strengthen orderings to SEQ_CST instead of volatilewip/tsan/stmBen Gamari2020-10-242-23/+23
| | | | | | | | | | Previously the `current_value`, `first_watch_queue_entry`, and `num_updates` fields of `StgTVar` were marked as `volatile` in an attempt to provide strong ordering. Of course, this isn't sufficient. We now use proper atomic operations. In most of these cases I strengthen the ordering all the way to SEQ_CST although it's possible that some could be weakened with some thought.
* rts/STM: Use atomicsBen Gamari2020-10-241-27/+45
| | | | | | | | This fixes a potentially harmful race where we failed to synchronize before looking at a TVar's current_value. Also did a bit of refactoring to avoid abstract over management of max_commits.
* rts: Introduce SET_HDR_RELEASEwip/tsan/prepBen Gamari2020-10-241-2/+8
| | | | | Also ensure that we also store the info table pointer last to ensure that the synchronization covers all stores.
* testsuite: Fix thread leak in hs_try_putmvar00[13]Ben Gamari2020-10-242-2/+4
|
* configure: Bump minimum-supported gcc version to 4.7Ben Gamari2020-10-241-1/+1
| | | | | Since the __atomic_* builtins are not supported until gcc 4.7. Given that this version was released in 2012 I think this is acceptable.
* rts/ClosureMaros: Use relaxed atomicsBen Gamari2020-10-241-10/+13
|
* rts/OSThreads: Fix data raceBen Gamari2020-10-241-2/+4
| | | | | Previously we would race on the cached processor count. Avoiding this is straightforward; just use relaxed operations.
* rts/SpinLock: Move to proper atomicsBen Gamari2020-10-241-6/+4
| | | | | | This is fairly straightforward; we just needed to use relaxed operations for the PROF_SPIN counters and a release store instead of a write barrier.
* rts/Task: Make comments proper NotesBen Gamari2020-10-241-4/+4
|
* rts/Capability: Intialize interrupt fieldBen Gamari2020-10-242-0/+5
| | | | | | Previously this was left uninitialized. Also clarify some comments.
* rts/CNF: Initialize all bdescrs in groupBen Gamari2020-10-241-0/+1
| | | | | | It seems wise and cheap to ensure that the whole bdescr of all blocks of a compact group is valid, even if most cases only look at the flags field.
* rts: Infrastructure for testing with ThreadSanitizerBen Gamari2020-10-248-3/+110
|
* SMP.h: Add C11-style atomic operationsBen Gamari2020-10-241-1/+60
|
* testsuite: Mark T12971 as fragile on WindowsBen Gamari2020-10-201-1/+1
| | | | Due to #17945.
* API Annotations: Keep track of unicode for linear arrow notationwip/az/unicode-hsscaledAlan Zimmerman2020-10-2020-76/+107
| | | | | | | | | | | The linear arrow can be parsed as `%1 ->` or a direct single token unicode equivalent. Make sure that this distinction is captured in the parsed AST by using IsUnicodeSyntax where it appears, and introduce a new API Annotation, AnnMult to represent its location when unicode is not used. Updated haddock submodule
* gitlab-ci: Rename FLAVOUR -> BUILD_FLAVOURBen Gamari2020-10-202-8/+7
| | | | | | | Previously the Hadrian jobs used the `FLAVOUR` environment variable to communicate which flavour `ci.sh` should build whereas `make` used `BUILD_FLAVOUR`. This caused unnecessary confusion. Consolidate these two.
* Compile modules with `-fobject-code` enabled to byte-code when loaded with ↵nineonine2020-10-205-6/+49
| | | | | | | | | | | | | | | `*` prefix in ghci (#8042) The documentation states that when using :add and :load, the `*` prefix forces a module to be loaded as byte-code. However, this seems to be ignored when -fobject-code has been enabled. In that case, the compiled code is always used, regardless of whether the *-form is used. The idea is to consult the Targets in HscEnv and check the 'targetAllowObjCode' flag. If the flag for given module is set, then patch up DynFlags and select compilation backend accordingly. This would require a linear scan of course, but that shouldn't be too costly.
* Minor comments, update linear types docsKrzysztof Gogolewski2020-10-205-12/+22
| | | | | | | - Update comments: placeHolderTypeTc no longer exists "another level check problem" was a temporary comment from linear types - Use Mult type synonym (reported in #18676) - Mention multiplicity-polymorphic fields in linear types docs
* testsuite: Add test for #18346Ben Gamari2020-10-203-0/+43
| | | | This was fixed by 4291bddaea3148908c55f235ee8978e1d9aa6f20.
* Remove pdocPrecSylvain Henry2020-10-192-18/+17
| | | | | | pdocPrec was only used in GHC.Cmm.DebugBlock.pprUnwindExpr, so remove it. OutputableP becomes a one-function class which might be better for performance.
* Implement -Woperator-whitespace (#18834)Vladislav Zavialov2020-10-1918-41/+213
| | | | | | | | | | | | | | This patch implements two related warnings: -Woperator-whitespace-ext-conflict warns on uses of infix operators that would be parsed differently were a particular GHC extension enabled -Woperator-whitespace warns on prefix, suffix, and tight infix uses of infix operators Updates submodules: haddock, containers.
* Linting correctionsHécate2020-10-171-1/+1
| | | | | * Bring back LANGUAGE pragmas in GHC.IO.Handle.Lock.Windows * Exclude some modules that are wrongfully reported
* Don't get host RTS ways via settings (#18651)Sylvain Henry2020-10-177-32/+5
| | | | | | | | | | | | To correctly perform a linking hack for Windows we need to link with the RTS GHC is currently using. We used to query the RTS ways via the "settings" file but it is fragile (#18651). The hack hasn't been fixed to take into account all the ways (Tracing) and it makes linking of GHC with another RTS more difficult (we need to link with another RTS and to regenerate the settings file). So this patch uses the ways reported by the RTS itself (GHC.Platform.Ways.hostWays) instead of the "settings" file.
* Apply suggestion to testsuite/tests/ffi/should_run/all.TDylanZA2020-10-171-1/+6
|
* When using rts_setInCallCapability, lock incall threadsDylan Yudaken2020-10-177-8/+145
| | | | | | | | This diff makes sure that incall threads, when using `rts_setInCallCapability`, will be created as locked. If the thread is not locked, the thread might end up being scheduled to a different capability. While this is mentioned in the docs for `rts_setInCallCapability,`, it makes the method significantly less useful as there is no guarantees on the capability being used. This commit also adds a test to make sure things stay on the correct capability.
* Testsuite: Add dead arity analysis testsSebastian Graf2020-10-1755-2537/+809
| | | | | We didn't seem to test these old tests at all, judging from their expected output.
* Arity: Record arity types for non-recursive letsSebastian Graf2020-10-175-63/+214
| | | | | | | | | | | | | | | | | | | | | | | In #18793, we saw a compelling example which requires us to look at non-recursive let-bindings during arity analysis and unleash their arity types at use sites. After the refactoring in the previous patch, the needed change is quite simple and very local to `arityType`'s defn for non-recurisve `Let`. Apart from that, we had to get rid of the second item of `Note [Dealing with bottoms]`, which was entirely a safety measure and hindered optimistic fixed-point iteration. Fixes #18793. The following metric increases are all caused by this commit and a result of the fact that we just do more work now: Metric Increase: T3294 T12545 T12707
* Arity: Refactor fixed-point iteration in GHC.Core.Opt.AritySebastian Graf2020-10-172-70/+99
| | | | | | | | | | | | | | | Arity analysis used to propagate optimistic arity types during fixed-point interation through the `ArityEnv`'s `ae_cheap_fun` field, which is like `GHC.Core.Utils.exprIsCheap`, but also considers the current iteration's optimistic arity, for the binder in question only. In #18793, we have seen that this is a problematic design, because it doesn't allow us to look through PAP bindings of that binder. Hence this patch refactors to a more traditional form with an explicit signature environment, in which we record the optimistic `ArityType` of the binder in question (and at the moment is the *only* binder that is recorded in the arity environment).
* Skip type family defaults with hs-boot and hsig filesJohn Ericson2020-10-1717-5/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Works around #17190, possible resolution for #17224. New design is is according to accepted [GHC Propoal 320]. Instances in signatures currently unconditionally opt into associated family defaults if no explicit instance is given. This is bad for two reasons: 1. It constrains possible instantiations to use the default, rather than possibly define the associated family differently. 2. It breaks compilation as type families are unsupported in signatures. This PR simply turns off the filling in of defaults in those cases. Additionally, it squelches a missing definition warning for hs-boot too that was only squelched for hsig before. The downsides are: 1. There is no way to opt into the default, other than copying its definition. 2. If we fixed type classes in signatures, and wanted instances to have to explicitly *out of* rather than into the default, that would now be a breaking change. The change that is most unambiguously goood is harmonizing the warning squelching between hs-boot or hsig. Maybe they should have the warning (opt out of default) maybe they shouldn't (opt in to default), but surely it should be the same for both. Add hs-boot version of a backpack test regarding class-specified defaults in instances that appear in an hs-boot file. The metrics increase is very slight and makes no sense --- at least no one has figured anything out after this languishing for a while, so I'm just going to accept it. Metric Increase: T10421a [GHC proposal 320]: https://github.com/ghc-proposals/ghc-proposals/pull/320
* gitlab-ci: s/allow_newer/allow_failureBen Gamari2020-10-171-1/+1
| | | Silly mistake on my part.
* gitlab-ci: Allow doc-tarball job to failBen Gamari2020-10-171-0/+2
| | | | Currently the Hadrian build appears not to package documentation correctly, causing doc-tarball to fail due to the Windows build.
* Clarify Eq documentation #18713f-a2020-10-161-9/+4
|
* gitlab-ci: Fix Hadrian bindist namesBen Gamari2020-10-162-7/+14
|
* gitlab-ci: Remove allow_failure from Windows jobsBen Gamari2020-10-161-6/+0
|
* rts: Add __mingw_vfprintf to RtsSymbols.cBen Gamari2020-10-161-1/+3
| | | | | Following the model of the other printf symbols. See Note [Symbols for MinGW's printf].
* testsuite: Account for -Wnoncanonical-monoid-instances changes on WindowsBen Gamari2020-10-163-9/+0
|
* testsuite: Sort metrics by metric typeBen Gamari2020-10-161-1/+15
| | | | Closes #18838.
* base: Reintroduce necessary LANGUAGE pragmasBen Gamari2020-10-161-0/+2
| | | | These were incorrectly removed in a recent cleanup commit.
* mingw: Extract zst toolchain archivesBen Gamari2020-10-162-3/+4
| | | | This should have been done when the toolchain was bumped.
* compiler/ByteCode: Allow 2^32 local labelsBen Gamari2020-10-153-4/+7
| | | | | | This widens LocalLabel to 2^16, avoiding the crash observed in #14334. Closes #14334.
* compiler/ByteCode: Make LocalLabel a newtypeBen Gamari2020-10-153-12/+17
|
* compiler/ByteCode: Use strict Maps in bytecode assemblerBen Gamari2020-10-151-2/+2
|
* rts: Clean-up whitespace in InterpreterBen Gamari2020-10-151-10/+10
|
* Extend mAX_TUPLE_SIZE to 64GHC GitLab CI2020-10-1510-107/+58
| | | | As well a ctuples and sums.
* Add flags for annotating Generic{,1} methods INLINE[1] (#11068)Andrzej Rybczak2020-10-1515-21/+1114
| | | | | | | | Makes it possible for GHC to optimize away intermediate Generic representation for more types. Metric Increase: T12227
* testsuite: Add missing #include on <stdlib.h>Ben Gamari2020-10-151-0/+1
| | | | This otherwise fails on newer Clangs, which warn more aggressively on undeclared symbols.
* Fix parsing of PIE flagsSylvain Henry2020-10-151-2/+2
| | | | | | -fPIE and -fno-PIE flags were (un)setting Opt_PIC instead of Opt_PIE. Original commit: 3625728a0e3a9b56c2b85ae7ea8bcabdd83ece6a
* Remove Proxy# argument in Data.Typeable.InternalKrzysztof Gogolewski2020-10-155-13/+11
| | | | | | No longer neccessary - TypeRep is now indexed, there is no ambiguity. Also fix a comment in Evidence.hs, IsLabel no longer takes a Proxy#.
* users-guide: Add missing :ghc-flag: directiveBen Gamari2020-10-141-2/+2
|
* Fix some missed opportunities for preInlineUnconditionallySimon Peyton Jones2020-10-1433-443/+436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two signficant changes here: * Ticket #18815 showed that we were missing some opportunities for preInlineUnconditionally. The one-line fix is in the code for GHC.Core.Opt.Simplify.Utils.preInlineUnconditionally, which now switches off only for INLINE pragmas. I expanded Note [Stable unfoldings and preInlineUnconditionally] to explain. * When doing this I discovered a way in which preInlineUnconditionally was occasionally /too/ eager. It's all explained in Note [Occurrences in stable unfoldings] in GHC.Core.Opt.OccurAnal, and the one-line change adding markAllMany to occAnalUnfolding. I also got confused about what NoUserInline meant, so I've renamed it to NoUserInlinePrag, and changed its pretty-printing slightly. That led to soem error messate wibbling, and touches quite a few files, but there is no change in functionality. I did a nofib run. As expected, no significant changes. Program Size Allocs ---------------------------------------- sphere -0.0% -0.4% ---------------------------------------- Min -0.0% -0.4% Max -0.0% +0.0% Geometric Mean -0.0% -0.0% I'm allowing a max-residency increase for T10370, which seems very irreproducible. (See comments on !4241.) There is always sampling error for max-residency measurements; and in any case the change shows up on some platforms but not others. Metric Increase: T10370