summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* gitlab-ci: Lint CI scripts with shellcheckwip/ci-shellcheckBen Gamari2021-02-212-1/+3
|
* gitlab-ci: Run ci.sh through shellcheckBen Gamari2021-02-212-14/+20
| | | | It is now shellcheck-clean.
* gitlab-ci: Respect TEST_TYPE variableBen Gamari2021-02-212-10/+31
| | | | Previously this was dropped in the CI refactoring of !2487.
* Test Driver: Tweak interval of test reportingMatthew Pickering2021-02-181-5/+12
| | | | | | | | | | | Rather than just display every 100 tests, work out how many to display based on the total number of tests. This improves the experience when running a small number of tests. For [0..100] - Report every test [100..1000] - Report every 10 tests [1000..10000] - Report every 100 tests and so on..
* users guide: Mention that -e can be given multiple timesBen Gamari2021-02-181-2/+3
| | | | Fixes #19122.
* base: Fix order of infix declarations in Data.FunctorBen Gamari2021-02-181-2/+2
| | | | | | | As pointed in #19284, previously the order was a bit confusing. This didn't affect the meaning but nevertheless it's much clearer now. Closes #19284.
* Rectify the haddock markup surrounding symbols for foldl' and foldMap'Hécate Moonlight2021-02-181-23/+23
| | | | closes #19365
* Remove leftover trace messages from the keepAlive# work.Andreas Klebinger2021-02-181-4/+2
|
* Use target Int/Word when detecting literal overflows (#17336)Sylvain Henry2021-02-181-54/+76
| | | | And also for empty enumeration detection.
* Improve specialisation for imported functionsSimon Peyton Jones2021-02-185-9/+52
| | | | | | | | | | | | | At a SPECIALSE pragma for an imported Id, we used to check that it was marked INLINABLE. But that turns out to interact badly with worker/wrapper: see Note [Worker-wrapper for INLINABLE functions] in GHC.Core.Opt.WorkWrap. So this small patch instead simply tests that we have an unfolding for the function; see Note [SPECIALISE pragmas for imported Ids] in GHC.Tc.Gen.Sig. Fixes #19246
* TypeMap: Use mkTyConTy instead of TyConApp constructorBen Gamari2021-02-181-1/+1
| | | | | | This allows TypeMap to benefit from the nullary TyConApp sharing optimisation described in Note [Sharing nullary TyConApps] in GHC.Core.TyCon.
* Extend nullary TyConApp optimisation to all TyConsBen Gamari2021-02-188-174/+218
| | | | | | | | | | | See Note [Sharing nullary TyConApps] in GHC.Core.TyCon. Closes #19367. Metric Decrease: T9872a T9872b T9872c
* rts: Add generic block traversal function, listAllBlocksMatthew Pickering2021-02-182-0/+39
| | | | | | | | | This function is exposed in the RtsAPI.h so that external users have a blessed way to traverse all the different `bdescr`s which are known by the RTS. The main motivation is to use this function in ghc-debug but avoid having to expose the internal structure of a Capability in the API.
* directory: ensure xdg compliance (Fix #6077)Gauvain 'GovanifY' Roussel-Tarbouriech2021-02-186-15/+33
|
* Document how bottom CPR and dead-ending Divergence are related [skip ci]Sebastian Graf2021-02-181-0/+24
| | | | | | In a new `Note [Bottom CPR iff Dead-Ending Divergence]`. Fixes #18086.
* Fix #19377 by using lookupLOcc when desugaring TH-quoted ANNsRyan Scott2021-02-173-4/+18
| | | | | | | | | | Previously, the desugarer was looking up names referenced in TH-quoted `ANN`s by using `globalVar`, which would allocate a fresh TH `Name`. In effect, this would prevent quoted `ANN`s from ever referencing the correct identifier `Name`, leading to #19377. The fix is simple: instead of `globalVar`, use `lookupLOcc`, which properly looks up the name of the in-scope identifier. Fixes #19377.
* UnVarGraph: Improve asymptoticsBen Gamari2021-02-171-30/+66
| | | | | | | | | | | | | | | | | | This is a redesign of the UnVarGraph data structure used by the call arity analysis to avoid the pathologically-poor performance observed in issue #18789. Specifically, deletions were previously O(n) in the case of graphs consisting of many complete (bipartite) sub-graphs. Together with the nature of call arity this would produce quadratic behavior. We now encode deletions specifically, taking care to do some light normalization of empty structures. In the case of the `Network.AWS.EC2.Types.Sum` module from #19203, this brings the runtime of the call-arity analysis from over 50 seconds down to less than 2 seconds. Metric Decrease: T15164 WWRec
* CallArity: Small optimisations and strictnessBen Gamari2021-02-171-2/+4
|
* PPC NCG: print procedure end label for debugPeter Trommler2021-02-171-5/+11
| | | | Fixes #19118
* rts: TraverseHeap: Update resetStaticObjectForProfiling docsDaniel Gröber2021-02-171-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | Simon's concern in the old comment, specifically: So all of the calls to traverseMaybeInitClosureData() here are initialising retainer sets with the wrong flip. Is actually exactly what the code was intended to do. It makes the closure data valid, then at the beginning of the traversal the flip bit is flipped resetting all closures across the heap to invalid. Now it used to be that the profiling code using the traversal has it's own sense of valid vs. invalid beyond what the traversal code does and indeed the retainer profiler still does this, there a getClosureData of NULL is considered an invalid retainer set. So in effect there wasn't any difference in invalidating closure data rather than just resetting it to a valid zero, which might be what confused Simon at the time. As the code is now it actually uses the value of the valid/invalid bit in the form of the 'first_visit' argument to the 'visit' callback so there is a difference.
* rts: TraverseHeap: Fix failed to inline warningsDaniel Gröber2021-02-171-1/+1
| | | | GCC warns that varadic functions simply cannot be inlined.
* rts: ProfHeap: Move definitions for Census to new headerDaniel Gröber2021-02-172-50/+77
|
* rts: ProfHeap: Merge some redundant ifdefsDaniel Gröber2021-02-171-10/+1
|
* rts: TraverseHeap: Allow visit_cb to be NULLDaniel Gröber2021-02-171-2/+4
|
* rts: TraverseHeap: Add a basic testDaniel Gröber2021-02-177-0/+307
| | | | | For now this just tests that the order of the callbacks is what we expect for a couple of synthetic heap graphs.
* rts: TraverseHeap: Move stackElement to headerDaniel Gröber2021-02-172-69/+64
| | | | | | | The point of this is to let user code call traversePushClosure directly instead of going through traversePushRoot. This in turn allows specifying a stackElement to be used when the traversal returns from a top-level (root) closure.
* rts: TraverseHeap: Make "flip" bit flip into it's own functionDaniel Gröber2021-02-173-11/+25
|
* rts: TraverseHeap: Move "flip" bit into traverseState structDaniel Gröber2021-02-176-57/+67
|
* rts: TraverseHeap: Make trav. data macros into functionsDaniel Gröber2021-02-174-22/+30
| | | | | This allows the global 'flip' variable not to be exported. This allows a future commit to also make it part of the traversalState struct.
* rts: TraverseHeap: Simplify profiling headerDaniel Gröber2021-02-175-27/+18
| | | | | Having a union in the closure profiling header really just complicates things so get back to basics, we just have a single StgWord there for now.
* rts: TraverseHeap: Update some commentsDaniel Gröber2021-02-171-4/+4
| | | | data_out was renamed to child_data at some point
* rts: TraverseHeap: Introduce callback for subtree completionDaniel Gröber2021-02-173-77/+185
| | | | | | | | | | | | | | | The callback 'return_cb' allows users to be perform additional accounting when the traversal of a subtree is completed. This is needed for example to determine the number or total size of closures reachable from a given closure. This commit also makes the lifetime increase of stackElements from commit "rts: TraverseHeap: Increase lifetime of stackElements" optional based on 'return_cb' being set enabled or not. Note that our definition of "subtree" here includes leaf nodes. So the invariant is that return_cb is called for all nodes in the traversal exactly once.
* rts: TraverseHeap: Link parent stackElements on the stackDaniel Gröber2021-02-171-44/+56
| | | | | | | | | The new 'sep' field links a stackElement to it's "parent". That is the stackElement containing it's parent closure. Currently not all closure types create long lived elements on the stack so this does not cover all parents along the path to the root but that is about to change in a future commit.
* rts: TraverseHeap: Increase lifetime of stackElementsDaniel Gröber2021-02-171-16/+26
| | | | | | | | | | | | | | | This modifies the lifetime of stackElements such that they stay on the stack until processing of all child closures is complete. Currently the stackElement representing a set of child closures will be removed as soon as processing of the last closure _starts_. We will use this in a future commit to allow storing information on the stack which should be accumulated in a bottom-up manner along the closure parent-child relationship. Note that the lifetime increase does not apply to 'type == posTypeFresh' stack elements. This is because they will always be pushed right back onto the stack as regular stack elements anyways.
* rts: TraverseHeap: Rename traversePushClosure to traversePushRootDaniel Gröber2021-02-173-4/+10
|
* Parse symbolic names in ANN type correctly with otyconRyan Scott2021-02-168-1/+33
| | | | | | | | | | | | | | | | | This adds a new `otycon` production to the parser that allows for type constructor names that are either alphanumeric (`tycon`) or symbolic (`tyconsym`), where the latter must be parenthesized appropriately. `otycon` is much like the existing `oqtycon` production, except that it does not permit qualified names. The parser now uses `otycon` to parse type constructor names in `ANN type` declarations, which fixes #19374. To make sure that all of this works, I added three test cases: * `should_compile/T19374a`: the original test case from #19374 * `should_fail/T19374b`: a test that makes sure that an `ANN` with a qualified name fails to parse * `should_fail/T19374c`: a test that makes sure that an `ANN type` with a qualified name fails to parse
* Avoid false redundant import warning with DisambiguateRecordFieldsAdam Gundry2021-02-164-6/+30
| | | | | Fixes #17853. We mustn't discard the result of pickGREs, because doing so might lead to incorrect redundant import warnings.
* Add Generic tuple instances up to 15Andrzej Rybczak2021-02-161-0/+48
|
* Avoid useless w/w splitSimon Peyton Jones2021-02-162-96/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is just a tidy-up for the post-strictness-analysis worker wrapper split. Consider f x = x Strictnesss analysis does not lead to a w/w split, so the obvious thing is to leave it 100% alone. But actually, because the RHS is small, we ended up adding a StableUnfolding for it. There is some reason to do this if we choose /not/ do to w/w on the grounds that the function is small. See Note [Don't w/w inline small non-loop-breaker things] But there is no reason if we would not have done w/w anyway. This patch just moves the conditional to later. Easy. This does move some -ddump-simpl printouts around a bit. I also discovered that the previous code was overwritten an InlineCompulsory with InlineStable, which is utterly wrong. That in turn meant that some default methods (marked InlineCompulsory) were getting their InlineCompulsory squashed. This patch fixes that bug --- but of course that does mean a bit more inlining! Metric Decrease: T9233 T9675 Metric Increase: T12707 T11374 T3064 T4029 T9872b T9872d haddock.Cabal
* Use explicit import list for Data.ListOleg Grenrus2021-02-161-1/+1
|
* Replace more autotools obsolete macros (#19189)Sylvain Henry2021-02-165-18/+12
|
* Don't build extra object with -no-hs-mainSylvain Henry2021-02-162-12/+25
| | | | | | | | We don't need to compile/link an additional empty C file when it is not needed. This patch may also fix #18938 by avoiding trying to lookup the RTS unit when there is none (yet) in the unit database.
* Make sure HasField use counts for -Wunused-top-bindsAdam Gundry2021-02-166-2/+45
| | | | | | This is a small fix that depends on the previous commit, because it corrected the rnExpr free variable calculation for HsVars which refer to ambiguous fields. Fixes #19213.
* Implement NoFieldSelectors extension (ghc-proposals 160)Adam Gundry2021-02-1664-265/+1236
| | | | | | | | | | | | | | | | | | | | | Fixes #5972. This adds an extension NoFieldSelectors to disable the generation of selector functions corresponding to record fields. When this extension is enabled, record field selectors are not accessible as functions, but users are still able to use them for record construction, pattern matching and updates. See Note [NoFieldSelectors] in GHC.Rename.Env for details. Defining the same field multiple times requires the DuplicateRecordFields extension to be enabled, even when NoFieldSelectors is in use. Along the way, this fixes the use of non-imported DuplicateRecordFields in GHCi with -fimplicit-import-qualified (fixes #18729). Moreover, it extends DisambiguateRecordFields to ignore non-fields when looking up fields in record updates (fixes #18999), as described by Note [DisambiguateRecordFields for updates]. Co-authored-by: Simon Hafner <hafnersimon@gmail.com> Co-authored-by: Fumiaki Kinoshita <fumiexcel@gmail.com>
* Throw IOError when allocaBytesAligned gets non-power-of-two alignDaniel Gröber2021-02-142-2/+25
|
* Document word-size rounding of ByteArray# memory (Fix #14731)Daniel Gröber2021-02-141-1/+2
|
* Improve ByteArray# documentation regarding alignmentDaniel Gröber2021-02-143-3/+14
|
* Fix non power-of-two Storable.alignment in Capi_Ctype testsDaniel Gröber2021-02-143-3/+3
| | | | | | | Alignments passed to alloca and friends must be a power of two for the code in allocatePinned to work properly. Commit 41230e2601 ("Zero out pinned block alignment slop when profiling") introduced an ASSERT for this but this test was still violating it.
* validate: Fix copy-pastaBen Gamari2021-02-141-2/+2
| | | | | | | Previously the Hadrian codepath of `validate` inverted the logic which decides whether the test build of `xhtml` should be built with `--enable-shared`. This resulted in validate failures on Windows, which does not support dynamic linkage of Haskell code.
* Fix over-eager inlining in SimpleOptSimon Peyton Jones2021-02-149-40/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In GHC.Core.SimpleOpt, I found that its inlining could duplicate an arbitary redex inside a lambda! Consider (\xyz. x+y). The occurrence-analysis treats the lamdda as a group, and says that both x and y occur once, even though the occur under the lambda-z. See Note [Occurrence analysis for lambda binders] in OccurAnal. When the lambda is under-applied in a call, the Simplifier is careful to zap the occ-info on x,y, because they appear under the \z. (See the call to zapLamBndrs in simplExprF1.) But SimpleOpt missed this test, resulting in #19347. So this patch * commons up the binder-zapping in GHC.Core.Utils.zapLamBndrs. * Calls this new function from GHC.Core.Opt.Simplify * Adds a call to zapLamBndrs to GHC.Core.SimpleOpt.simple_app This change makes test T12990 regress somewhat, but it was always very delicate, so I'm going to put up with that. In this voyage I also discovered a small, rather unrelated infelicity in the Simplifier: * In GHC.Core.Opt.Simplify.simplNonRecX we should apply isStrictId to the OutId not the InId. See Note [Dark corner with levity polymorphism] It may never "bite", because SimpleOpt should have inlined all the levity-polymorphic compulsory inlnings already, but somehow it bit me at one point and it's generally a more solid thing to do. Fixing the main bug increases runtime allocation in test perf/should_run/T12990, for (acceptable) reasons explained in a comement on Metric Increase: T12990