summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* rts/m32: Fix assertion failurewip/m32-fixesBen Gamari2022-04-281-0/+3
| | | | | | | | | | This fixes an assertion failure in the m32 allocator due to the imprecisely specified preconditions of `m32_allocator_push_filled_list`. Specifically, the caller must ensure that the page type is set to filled prior to calling `m32_allocator_push_filled_list`. While this issue did result in an assertion failure in the debug RTS, the issue is in fact benign.
* Revert "rts: Refactor handling of dead threads' stacks"Matthew Pickering2022-04-286-30/+9
| | | | This reverts commit e09afbf2a998beea7783e3de5dce5dd3c6ff23db.
* Remove unused lineTamar Christina2022-04-281-1/+0
|
* winio: add support to iserv.Tamar Christina2022-04-285-11/+84
|
* add since annotation for GHC.Stack.CCS.whereFromTeo Camarasu2022-04-281-0/+2
|
* configure: Bump GHC version to 9.5Ben Gamari2022-04-282-1/+1
| | | | Bumps haddock submodule.
* Add INLINE pragmas for Enum helper methodsSimon Peyton Jones2022-04-283-16/+122
| | | | | | | | | | | | | | | | | | | | | | | As #21343 showed, we need to be super-certain that the "helper methods" for Enum instances are actually inlined or specialised. I also tripped over this when I discovered that numericEnumFromTo and friends had no pragmas at all, so their performance was very fragile. If they weren't inlined, all bets were off. So I've added INLINE pragmas for them too. See new Note [Inline Enum method helpers] in GHC.Enum. I also expanded Note [Checking for INLINE loop breakers] in GHC.Core.Lint to explain why an INLINE function might temporarily be a loop breaker -- this was the initial bug report in #21343. Strangely we get a 16% runtime allocation decrease in perf/should_run/T15185, but only on i386. Since it moves in the right direction I'm disinclined to investigate, so I'll accept it. Metric Decrease: T15185
* Fix unification of ConcreteTvs, removing IsRefl#sheaf2022-04-2887-1206/+1847
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the unification of concrete type variables. The subtlety was that unifying concrete metavariables is more subtle than other metavariables, as decomposition is possible. See the Note [Unifying concrete metavariables], which explains how we unify a concrete type variable with a type 'ty' by concretising 'ty', using the function 'GHC.Tc.Utils.Concrete.concretise'. This can be used to perform an eager syntactic check for concreteness, allowing us to remove the IsRefl# special predicate. Instead of emitting two constraints `rr ~# concrete_tv` and `IsRefl# rr concrete_tv`, we instead concretise 'rr'. If this succeeds we can fill 'concrete_tv', and otherwise we directly emit an error message to the typechecker environment instead of deferring. We still need the error message to be passed on (instead of directly thrown), as we might benefit from further unification in which case we will need to zonk the stored types. To achieve this, we change the 'wc_holes' field of 'WantedConstraints' to 'wc_errors', which stores general delayed errors. For the moement, a delayed error is either a hole, or a syntactic equality error. hasFixedRuntimeRep_MustBeRefl is now hasFixedRuntimeRep_syntactic, and hasFixedRuntimeRep has been refactored to directly return the most useful coercion for PHASE 2 of FixedRuntimeRep. This patch also adds a field ir_frr to the InferResult datatype, holding a value of type Maybe FRROrigin. When this value is not Nothing, this means that we must fill the ir_ref field with a type which has a fixed RuntimeRep. When it comes time to fill such an ExpType, we ensure that the type has a fixed RuntimeRep by performing a representation-polymorphism check with the given FRROrigin This is similar to what we already do to ensure we fill an Infer ExpType with a type of the correct TcLevel. This allows us to properly perform representation-polymorphism checks on 'Infer' 'ExpTypes'. The fillInferResult function had to be moved to GHC.Tc.Utils.Unify to avoid a cyclic import now that it calls hasFixedRuntimeRep. This patch also changes the code in matchExpectedFunTys to make use of the coercions, which is now possible thanks to the previous change. This implements PHASE 2 of FixedRuntimeRep in some situations. For example, the test cases T13105 and T17536b are now both accepted. Fixes #21239 and #21325 ------------------------- Metric Decrease: T18223 T5631 -------------------------
* Bump process submoduleBen Gamari2022-04-282-1/+1
|
* hadrian: Clean up flavour transformer definitionsBen Gamari2022-04-281-4/+3
| | | | | Previously the `ipe` and `omit_pragmas` transformers were hackily defined using the textual key-value syntax. Fix this.
* testsuite: Fix calculation about whether to pass -dynamic to compilerMatthew Pickering2022-04-282-7/+7
|
* hadrian: Don't pass -rtsopts when building librariesDouglas Wilson2022-04-281-2/+2
|
* hadrian: add debug_ghc and debug_stage1_ghc flavour transformersDouglas Wilson2022-04-284-2/+20
|
* hadrian: Enrich flavours to build profiled/debugged/threaded ghcs per stageDouglas Wilson2022-04-2811-32/+30
|
* hadrian: Add Monoid instance to WayDouglas Wilson2022-04-281-1/+4
|
* testsuite: Add performance test for #14766wip/T14766-testBen Gamari2022-04-282-0/+31
| | | | This distills the essence of the Sigs.hs program found in the ticket.
* Mark GHC.Prim.PtrEq as Unsafesheaf2022-04-274-1/+14
| | | | | | | This module exports unsafe pointer equality operations, so we accordingly mark it as Unsafe. Fixes #21433
* Give Cmm files fake ModuleNames which include full filepathMatthew Pickering2022-04-278-4/+47
| | | | | | | This fixes the initialisation functions when using -prof or -finfo-table-map. Fixes #21370
* rts: add some more documentation to StgWeak closure typeAdam Sandberg Ericsson2022-04-271-2/+13
|
* Update docs for change to type-checking pluginssheaf2022-04-272-2/+13
| | | | | | There was no mention of the changes to type-checking plugins in the 9.4.1 notes, and the extending_ghc documentation contained a reference to an outdated type.
* Documentation for setLocaleEncodingBodigrim2022-04-271-2/+27
|
* Bump text submodule.Ben Gamari2022-04-271-0/+0
| | | | This should fix #21352
* Change `-dsuppress-ticks` to only suppress non-code ticks.Andreas Klebinger2022-04-271-2/+4
| | | | | | This means cost centres and coverage ticks will still be present in output. Makes using -dsuppress-all more convenient when looking at profiled builds.
* Enable eventlog support in all ways by defaultBen Gamari2022-04-2733-195/+92
| | | | | | | | | | | | | | | | | Here we deprecate the eventlogging RTS ways and instead enable eventlog support in the remaining ways. This simplifies packaging and reduces GHC compilation times (as we can eliminate two whole compilations of the RTS) while simplifying the end-user story. The trade-off is a small increase in binary sizes in the case that the user does not want eventlogging support, but we think that this is a fine trade-off. This also revealed a latent RTS bug: some files which included `Cmm.h` also assumed that it defined various macros which were in fact defined by `Config.h`, which `Cmm.h` did not include. Fixing this in turn revealed that `StgMiscClosures.cmm` failed to import various spinlock statistics counters, as evidenced by the failed unregisterised build. Closes #18948.
* rts/eventlog: Don't attempt to flush if there is no writerBen Gamari2022-04-271-0/+8
| | | | If the user has not configured a writer then there is nothing to flush.
* rts: state explicitly what evacuate and scavange mean in the copying gcAdam Sandberg Ericsson2022-04-272-1/+9
|
* ci: Add linting job which checks authors are not GHC CIMatthew Pickering2022-04-272-0/+31
|
* bootstrap: Add bootstrapping files for ghc-9_2_2Matthew Pickering2022-04-272-0/+2
| | | | Fixes #21373
* ci: Fix shell commandMatthew Pickering2022-04-271-2/+2
|
* ci: Explicitly handle failures in test_hadrianMatthew Pickering2022-04-271-11/+11
| | | | | | We also disable the stage1 testing which is broken. Related to #21072
* ci: Add test to check that release jobs have profiled libsMatthew Pickering2022-04-272-1/+14
|
* ci: Fix cabal-reinstall jobMatthew Pickering2022-04-272-7/+3
| | | | | | It's quite nice we can do this by mostly deleting code Fixes #21373
* testsuite: Add test for #16476Ben Gamari2022-04-276-0/+45
|
* Basic response file supportBen Gamari2022-04-276-45/+111
| | | | | | | | Here we introduce support into our command-line parsing infrastructure and driver for handling gnu-style response file arguments, typically used to work around platform command-line length limitations. Fixes #16476.
* Ensure that Any is Boxed in FFI imports/exportssheaf2022-04-2710-11/+120
| | | | | | | | | | We should only accept the type `Any` in foreign import/export declarations when it has type `Type` or `UnliftedType`. This patch adds a kind check, and a special error message triggered by occurrences of `Any` in foreign import/export declarations at other kinds. Fixes #21305
* Add note about inefficiency in returnMemoryToOSFabian Thorand2022-04-271-0/+8
|
* Defer freeing of mega block groupsFabian Thorand2022-04-273-35/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Solves the quadratic worst case performance of freeing megablocks that was described in issue #19897. During GC runs, we now keep a secondary free list for megablocks that is neither sorted, nor coalesced. That way, free becomes an O(1) operation at the expense of not being able to reuse memory for larger allocations. At the end of a GC run, the secondary free list is sorted and then merged into the actual free list in a single pass. That way, our worst case performance is O(n log(n)) rather than O(n^2). We postulate that temporarily losing coalescense during a single GC run won't have any adverse effects in practice because: - We would need to release enough memory during the GC, and then after that (but within the same GC run) allocate a megablock group of more than one megablock. This seems unlikely, as large objects are not copied during GC, and so we shouldn't need such large allocations during a GC run. - Allocations of megablock groups of more than one megablock are rare. They only happen when a single heap object is large enough to require that amount of space. Any allocation areas that are supposed to hold more than one heap object cannot use megablock groups, because only the first megablock of a megablock group has valid `bdescr`s. Thus, heap object can only start in the first megablock of a group, not in later ones.
* testsuite: Report minimum and maximum stat changesBen Gamari2022-04-271-3/+7
| | | | As suggested in #20733.
* Fix rendering of liftA haddockLi-yao Xia2022-04-251-2/+1
|
* Document behaviour of RULES with KnownNatBodigrim2022-04-251-0/+9
|
* rts: Improve documentation of closure typesBen Gamari2022-04-251-13/+35
| | | | Also drops the unused TREC_COMMITTED transaction state.
* rts: Refactor handling of dead threads' stacksBen Gamari2022-04-256-9/+30
| | | | | | | | | | | | | | | | This fixes a bug that @JunmingZhao42 and I noticed while working on her MMTK port. Specifically, in stg_stop_thread we used stg_enter_info as a sentinel at the tail of a stack after a thread has completed. However, stg_enter_info expects to have a two-field payload, which we do not push. Consequently, if the GC ends up somehow the stack it will attempt to interpret data past the end of the stack as the frame's fields, resulting in unsound behavior. To fix this I eliminate this hacky use of `stg_stop_thread` and instead introduce a new stack frame type, `stg_dead_thread_info`. Not only does this eliminate the potential for the previously mentioned memory unsoundness but it also more clearly captures the intended structure of the dead threads' stacks.
* Drop remaining vestiges of libtoolBen Gamari2022-04-255-37/+11
| | | | | | | | | | | | | Drop libtool logic from gen-dll, allowing us to drop the remaining logic from the `configure` script. Strangely, this appears to reliably reduce compiler allocations of T16875 on Windows. Closes #18826. Metric Decrease: T16875
* Drop libtool path from settings fileBen Gamari2022-04-2511-39/+7
| | | | | GHC no longers uses libtool for linking and therefore this is no longer necessary.
* Drop dead code in GHC.Linker.Static.linkBinary'Ben Gamari2022-04-251-18/+5
| | | | | | | | | Previously we supported building statically-linked executables using libtool. However, this was dropped in 91262e75dd1d80f8f28a3922934ec7e59290e28c in favor of using ar/ranlib directly. Consequently we can drop this logic. Fixes #18826.
* testsuite: Add testcase for #21141Ben Gamari2022-04-252-0/+27
|
* Ensure that wired-in exception closures aren't GC'dBen Gamari2022-04-254-40/+101
| | | | | | | | | | | | | | | As described in Note [Wired-in exceptions are not CAFfy], a small set of built-in exception closures get special treatment in the code generator, being declared as non-CAFfy despite potentially containing CAF references. The original intent of this treatment for the RTS to then add StablePtrs for each of the closures, ensuring that they are not GC'd. However, this logic was not applied consistently and eventually removed entirely in 951c1fb0. This lead to #21141. Here we fix this bug by reintroducing the StablePtrs and document the status quo. Closes #21141.
* rts: Factor out built-in GC rootsBen Gamari2022-04-251-35/+41
|
* testsuite: Cabalify ghc-configBen Gamari2022-04-256-24/+23
| | | | | | | To ensure that the build benefits from Hadrian's usual logic for building packages, avoiding #21409. Closes #21409.
* testsuite: More robust library way detectionBen Gamari2022-04-253-97/+38
| | | | | | | | | | | | | | | | | | Previously `test.mk` would try to determine whether the dynamic, profiling, and vanilla library ways are available by searching for `PrimOpWrappers.{,dyn_,p_}hi` in directory reported by `ghc-pkg field ghc-prim library-dirs`. However, this is extremely fragile as there is no guarantee that there is only one library directory. To handle the case of multiple `library-dirs` correct we would have to carry out the delicate task of tokenising the directory list (in shell, no less). Since this isn't a task that I am eager to solve, I have rather moved the detection logic into the testsuite driver and instead perform a test compilation in each of the ways. This should be more robust than the previous approach. I stumbled upon this while fixing #20579.