summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor module dependencies codeSylvain Henry2021-09-1715-196/+216
| | | | | | * moved deps related code into GHC.Unit.Module.Deps * refactored Deps module to not export Dependencies constructor to help maintaining invariants
* Fix annoying warning about Data.List unqualified importSylvain Henry2021-09-171-1/+1
|
* Code Gen: Rewrite shortcutWeightMap more efficientlyMatthew Pickering2021-09-171-33/+53
| | | | | | | | | | | | This function was one of the main sources of allocation in a ticky profile due to how it repeatedly deleted nodes from a large map. Now firstly the cuts are normalised, so that chains of cuts are elimated before any rewrites are applied. Then the CFG is traversed and reconstructed once whilst applying the necessary rewrites to remove shortcutted edges (based on the normalised cuts). Ticket: #19471
* Code Gen: Use more efficient block merging algorithmMatthew Pickering2021-09-173-27/+109
| | | | | | | | | | | | | | | | | | The previous algorithm scaled poorly when there was a large number of blocks and edges. The algorithm links together block chains which have edges between them in the CFG. The new algorithm uses a union find data structure in order to efficiently merge together blocks and calculate which block chain each block id belonds to. I copied the UnionFind data structure which already existed in Cabal into the GHC library rathert than reimplement it myself. This change results in a very significant reduction in allocations when compiling the mmark package. Ticket: #19471
* Code Gen: Optimise successors calculation in loop calculationMatthew Pickering2021-09-171-5/+4
| | | | | | | | | | Before this change, the whole map would be traversed in order to delete a node from the graph before calculating successors. This is quite inefficient if the CFG is big, as was the case in the mmark package. A more efficient alternative is to leave the CFG untouched and then just delete the node once after the lookups have been performed. Ticket: #19471
* Code Gen: Replace another lazy fmap with strict mapMapMatthew Pickering2021-09-171-1/+1
|
* Code Gen: Use strict map rather than lazy map in loop analysisMatthew Pickering2021-09-171-1/+3
| | | | | | | | | | | We were ending up with a big 1GB thunk spike as the `fmap` operation did not force the key values promptly. This fixes the high maximum memory consumption when compiling the mmark package. Compilation is still slow and allocates a lot more than previous releases. Related to #19471
* Add doc for -dyno, -dynosuf, -dynhisufZiyang Liu2021-09-172-3/+26
|
* Add "ipe" flavour transformer to add support for building with IPE debug infoMatthew Pickering2021-09-172-0/+18
| | | | | | The "ipe" transformer compilers everything in stage2 with `-finfo-table-map` and `-fdistinct-constructor-tables` to produce a compiler which is usable with `-hi` profiling and ghc-debug.
* compiler: Ensure that all CoreTodos have SCCsBen Gamari2021-09-172-3/+5
| | | | | | In #20365 we noticed that a significant amount of time is spend in the Core2Core cost-center, suggesting that some passes are likely missing SCC pragmas. Try to fix this.
* ghc-boot: Fix metadata handling of writeFileAtomicBen Gamari2021-09-172-0/+28
| | | | | | | | Previously the implementation of writeFileAtomic (which was stolen from Cabal) failed to preserve file mode, user and group, resulting in #14017. Fixes #14017.
* testsuite: Add broken testcase for #19350Ben Gamari2021-09-178-0/+87
|
* Remove Cabal dependency from check-exact and check-ppr executablesMatthew Pickering2021-09-172-2/+0
| | | | Neither uses anything from Cabal, so the dependency can just be removed.
* driver: Clean up temporary files after a module has been compiledMatthew Pickering2021-09-171-2/+8
| | | | | | | | | The refactoring accidently removed these calls to eagerly remove temporary files after a module has been compiled. This caused some issues with tmpdirs getting filled up on my system when the project had a large number of modules (for example, Agda) Fixes #20293
* Stop leaking <defunct> llc processesMatthew Pickering2021-09-171-1/+2
| | | | | | | | | | We needed to wait for the process to exit in the clean-up script as otherwise the `llc` process will not be killed until compilation finishes. This leads to running out of process spaces on some OSs. Thanks to Edsko de Vries for suggesting this fix. Fixes #20305
* Update error message to suggest the user consider OOM over RTS bug.Thomas M. DuBuisson2021-09-171-1/+3
| | | | Fix #17039
* Add compile_flags.txt for clangd (C IDE) supportSven Tennie2021-09-171-0/+5
| | | | | | This file configures clangd (C Language Server for IDEs) for the GHC project. Please note that this only works together with Haskell Language Server, otherwise .hie-bios/stage0/lib does not exist.
* Ensure .dyn_hi doesn't overwrite .hiZiyang Liu2021-09-179-10/+67
| | | | | | | | This commit fixes the following bug: when `outputHi` is set, and both `.dyn_hi` and `.hi` are needed, both would be written to `outputHi`, causing `.dyn_hi` to overwrite `.hi`. This causes subsequent `readIface` to fail - "mismatched interface file profile tag (wanted "", got "dyn")" - triggering unnecessary rebuild.
* driver: -M allow omitting the -dep-suffix (means empty) (fix #15483)Artem Pelenitsyn2021-09-172-7/+8
|
* EPA: correctly capture comments between 'where' and bindsAlan Zimmerman2021-09-1718-41/+745
| | | | | | | | | | | | In the following foo = x where -- do stuff doStuff = do stuff The "-- do stuff" comment is captured in the HsValBinds. Closes #20297
* testsuite: Add test for #18382Ben Gamari2021-09-173-0/+16
|
* Emit warning if bang is applied to unlifted typesTito Sacchi2021-09-1712-3/+82
| | | | | | | | | | | | | | | | GHC will trigger a warning similar to the following when a strictness flag is applied to an unlifted type (primitive or defined with the Unlifted* extensions) in the definition of a data constructor. Test.hs:7:13: warning: [-Wredundant-strictness-flags] • Strictness flag has no effect on unlifted type ‘Int#’ • In the definition of data constructor ‘TestCon’ In the data type declaration for ‘Test’ | 7 | data Test = TestCon !Int# | ^^^^^^^^^^^^^ Fixes #20187
* Improve pretty-printer defaulting logic (#19361)Krzysztof Gogolewski2021-09-1710-50/+92
| | | | | | When determining whether to default a RuntimeRep or Multiplicity variable, use isMetaTyVar to distinguish between metavariables (which can be hidden) and skolems (which cannot).
* Improve error messages involving operators from Data.Type.OrdChristiaan Baaij2021-09-1711-77/+234
| | | | Fixes #20009
* Add test for #17865Joshua Price2021-09-133-0/+6
|
* hadrian: Recommend use of +werror over explicit flavour modificationBen Gamari2021-09-131-4/+4
| | | | As noted in #20327, the previous guidance was out-of-date.
* testsuite: Mark hDuplicateTo001 as fragile in concurrent waysBen Gamari2021-09-131-2/+1
| | | | As noted in #17568.
* Don't depend unconditionally on xattr in darwin_installBen Gamari2021-09-131-1/+3
| | | | | | Previously the Darwin installation logic would attempt to call xattr unconditionally. This would break on older Darwin releases where this utility did not exist.
* Fix #20203 improve constant fold for `and`/`or`CarrieMY2021-09-135-18/+476
| | | | | | | | | | | | | | | This patch follows the rules specified in note [Constant folding through nested expressions]. Modifications are summarized below. - Added andFoldingRules, orFoldingRules to primOpRules under those xxxxAndOp, xxxxOrOp - Refactored some helper functions - Modify data NumOps to include two fields: numAnd and numOr Resolves: #20203 See also: #19204
* Break recursion in GHC.Float.roundingMode# (#20352)Sebastian Graf2021-09-111-1/+1
| | | | | | | | | | | | | | | | Judging from the Assumption, we should never call `roundingMode#` on a negative number. Yet the strange "dummy" conversion from `IN` to `IP` and the following recursive call where making the function recursive. Replacing the call by a panic makes `roundingMode#` non-recursive, so that we may be able to inline it. Fixes #20352. It seems we trigger #19414 on some jobs, hence Metric Decrease: T12545
* ncg: Kill incorrect unreachable codeBen Gamari2021-09-111-3/+3
| | | | | | As noted in #18183, these cases were previously incorrect and unused. Closes #18183.
* Ensure that zapFragileUnfolding preseves evaluatednessBen Gamari2021-09-111-5/+5
| | | | | As noted in #20324, previously we would drop the fact that an unfolding was evaluated, despite what the documentation claims.
* Add performance test for #19695nineonine2021-09-112-0/+141
|
* Remove dubious Eq1 and Ord1 Fixed instances. Fixes #20309Oleg Grenrus2021-09-112-10/+0
|
* Add test for #18181nineonine2021-09-112-0/+14
|
* Canonicalize bignum literalsSylvain Henry2021-09-1124-248/+266
| | | | | | | | | | | | | | | | | | Before this patch Integer and Natural literals were desugared into "real" Core in Core prep. Now we desugar them directly into their final ConApp form in HsToCore. We only keep the double representation for BigNat# (literals larger than a machine Word/Int) which are still desugared in Core prep. Using the final form directly allows case-of-known-constructor to fire for bignum literals, fixing #20245. Slight increase (+2.3) in T4801 which is a pathological case with Integer literals. Metric Increase: T4801 T11545
* distrib: Drop FP_GMP from configure scriptBen Gamari2021-09-111-2/+0
| | | | | None of the configure options defined by `FP_GMP` are applicable to binary distributions.
* Only dump Core stats when requested to do so (#20342)Sylvain Henry2021-09-0825-190/+7
|
* EPA: Capture '+' location for NPlusKPatAlan Zimmerman2021-09-089-8/+74
| | | | | | | The location of the plus symbol was being discarded, we now capture it. Closes #20243
* rts: Factor out TRACE_ cache update logicBen Gamari2021-09-081-8/+18
| | | | Just a small refactoring to perhaps enable code reuse later.
* Documentation: use https linksKrzysztof Gogolewski2021-09-0836-85/+86
|
* Minor doc fixesKrzysztof Gogolewski2021-09-088-92/+58
| | | | | | | | | | | | | - Fix markup in 9.4 release notes - Document -ddump-cs-trace - Mention that ImpredicativeTypes is really supported only since 9.2 - Remove "There are some restrictions on the use of unboxed tuples". This used to be a list, but all those restrictions were removed. - Mark -fimplicit-import-qualified as documented - Remove "The :main and :run command" - duplicated verbatim in options - Avoid calling "main" a function (cf. #7816) - Update System.getArgs: the old location was before hierarchical modules - Note that multiplicity multiplication is not supported (#20319)
* ffi: Don't allow wrapper stub with CApi conventionMatthew Pickering2021-09-086-4/+28
| | | | Fixes #20272
* base: Numeric: remove 'Show' constraint on 'showIntAtBase'Guillaume Bouchard2021-09-082-7/+7
| | | | | | | | | | The constraint was there in order to show the 'Integral' value in case of error. Instead we can show the result of `toInteger`, which will be close (i.e. it will still show the same integer except if the 'Show' instance was funky). This changes a bit runtime semantic (i.e. exception string may be a bit different).
* Fix broken haddock @since fields in baseJoshua Price2021-09-085-3/+23
|
* base Data.Fixed: fix documentation typo: succ (0.000 :: Milli) /= 1.001 Jens Petersen2021-09-081-1/+1
| | | ie `succ (0000) == 0001` -- (not 1001)
* Let LLVM and C handle > native size arithmeticJohn Ericson2021-09-083-60/+67
| | | | | | NCG needs to call slow FFI functions where we "borrow" the C compiler's implementation, but there is no reason why we need to do that for LLVM, or the unregisterized backend where everything is via C anyways!
* Fix code example in the documentation of subsumptionARATA Mizuki2021-09-071-1/+1
|
* Add and use new constructors to TcRnMessageAlfredo Di Napoli2021-09-0715-130/+338
| | | | | | | | | | | | | This commit adds the following constructors to the TcRnMessage type and uses them to replace sdoc-based diagnostics in some parts of GHC (e.g. TcRnUnknownMessage). It includes: * Add TcRnMonomorphicBindings diagnostic * Convert TcRnUnknownMessage in Tc.Solver.Interact * Add and use the TcRnOrphanInstance constructor to TcRnMessage * Add TcRnFunDepConflict and TcRnDupInstanceDecls constructors to TcRnMessage * Add and use TcRnConflictingFamInstDecls constructor to TcRnMessage * Get rid of TcRnUnknownMessage from GHC.Tc.Instance.Family
* gitlab-ci: Fix bash version-dependence in ci.shBen Gamari2021-09-071-1/+3
| | | | | | As described in https://stackoverflow.com/questions/7577052, safely expanding bash arrays is very-nearly impossible. The previous incantation failed under the bash version shipped with Centos 7.