summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* testsuite: Fix Note stylewip/T17917aBen Gamari2021-06-041-0/+1
|
* testsuite: Eliminate fragility of ioprofBen Gamari2021-06-042-14/+2
| | | | | | | As noted in #10037, the `ioprof` test would change its stderr output (specifically the stacktrace produced by `error`) depending upon optimisation level. As the `error` backtrace is not the point of this test, we now ignore the `stderr` output.
* Drop absent bindings in worker/wrapperSimon Peyton Jones2021-06-046-75/+138
| | | | | | | | | | | | | | | | | | | | | | | Consider this (from #19824) let t = ...big... in ...(f t x)... were `f` ignores its first argument. With luck f's wrapper will inline thereby dropping `t`, but maybe not: the arguments to f all look boring. So we pre-empt the problem by replacing t's RHS with an absent filler during w/w. Simple and effective. The main payload is the new `isAbsDmd` case in `tryWw`, but there are some other minor refactorings: * To implment this I had to refactor `mk_absent_let` to `mkAbsentFiller`, which can be called from `tryWW`. * wwExpr took both WwOpts and DynFlags which seems silly. I combined them into one. * I renamed the historical mkInineRule to mkWrapperUnfolding
* Re-do rubbish literalsSimon Peyton Jones2021-06-0418-128/+271
| | | | | | | | | | As #19882 pointed out, we were simply doing rubbish literals wrong. (I'll refrain from explaining the wrong-ness here -- see the ticket.) This patch fixes it by adding a Type (of kind RuntimeRep) as field of LitRubbish, rather than [PrimRep]. The Note [Rubbish literals] in GHC.Types.Literal explains the details.
* Avoid useless w/w split, take 2Simon Peyton Jones2021-06-0421-186/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit: commit c6faa42bfb954445c09c5680afd4fb875ef03758 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Mon Mar 9 10:20:42 2020 +0000 Avoid useless w/w split 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. turns out to have a bug in it. Instead of /moving/ the conditional, I /duplicated/ it. Then in a subsequent unrelated tidy-up (087ac4eb) I removed the second (redundant) test! This patch does what I originally intended. There is also a small refactoring in GHC.Core.Unfold, to make the code clearer, but with no change in behaviour. It does, however, have a generally good effect on compile times, because we aren't dealing with so many silly stable unfoldings. Here are the non-zero changes: Metrics: compile_time/bytes allocated ------------------------------------- Baseline Test Metric value New value Change --------------------------------------------------------------------------- ManyAlternatives(normal) ghc/alloc 791969344.0 792665048.0 +0.1% ManyConstructors(normal) ghc/alloc 4351126824.0 4358303528.0 +0.2% PmSeriesG(normal) ghc/alloc 50362552.0 50482208.0 +0.2% PmSeriesS(normal) ghc/alloc 63733024.0 63619912.0 -0.2% T10421(normal) ghc/alloc 121224624.0 119695448.0 -1.3% GOOD T10421a(normal) ghc/alloc 85256392.0 83714224.0 -1.8% T10547(normal) ghc/alloc 29253072.0 29258256.0 +0.0% T10858(normal) ghc/alloc 189343152.0 187972328.0 -0.7% T11195(normal) ghc/alloc 281208248.0 279727584.0 -0.5% T11276(normal) ghc/alloc 141966952.0 142046224.0 +0.1% T11303b(normal) ghc/alloc 46228360.0 46259024.0 +0.1% T11545(normal) ghc/alloc 2663128768.0 2667412656.0 +0.2% T11822(normal) ghc/alloc 138686944.0 138760176.0 +0.1% T12227(normal) ghc/alloc 482836000.0 475421056.0 -1.5% GOOD T12234(optasm) ghc/alloc 60710520.0 60781808.0 +0.1% T12425(optasm) ghc/alloc 104089000.0 104022424.0 -0.1% T12545(normal) ghc/alloc 1711759416.0 1705711528.0 -0.4% T12707(normal) ghc/alloc 991541120.0 991921776.0 +0.0% T13035(normal) ghc/alloc 108199872.0 108370704.0 +0.2% T13056(optasm) ghc/alloc 414642544.0 412580384.0 -0.5% T13253(normal) ghc/alloc 361701272.0 355838624.0 -1.6% T13253-spj(normal) ghc/alloc 157710168.0 157397768.0 -0.2% T13379(normal) ghc/alloc 370984400.0 371345888.0 +0.1% T13701(normal) ghc/alloc 2439764144.0 2441351984.0 +0.1% T14052(ghci) ghc/alloc 2154090896.0 2156671400.0 +0.1% T15164(normal) ghc/alloc 1478517688.0 1440317696.0 -2.6% GOOD T15630(normal) ghc/alloc 178053912.0 172489808.0 -3.1% T16577(normal) ghc/alloc 7859948896.0 7854524080.0 -0.1% T17516(normal) ghc/alloc 1271520128.0 1202096488.0 -5.5% GOOD T17836(normal) ghc/alloc 1123320632.0 1123922480.0 +0.1% T17836b(normal) ghc/alloc 54526280.0 54576776.0 +0.1% T17977b(normal) ghc/alloc 42706752.0 42730544.0 +0.1% T18140(normal) ghc/alloc 108834568.0 108693816.0 -0.1% T18223(normal) ghc/alloc 5539629264.0 5579500872.0 +0.7% T18304(normal) ghc/alloc 97589720.0 97196944.0 -0.4% T18478(normal) ghc/alloc 770755472.0 771232888.0 +0.1% T18698a(normal) ghc/alloc 408691160.0 374364992.0 -8.4% GOOD T18698b(normal) ghc/alloc 492419768.0 458809408.0 -6.8% GOOD T18923(normal) ghc/alloc 72177032.0 71368824.0 -1.1% T1969(normal) ghc/alloc 803523496.0 804655112.0 +0.1% T3064(normal) ghc/alloc 198411784.0 198608512.0 +0.1% T4801(normal) ghc/alloc 312416688.0 312874976.0 +0.1% T5321Fun(normal) ghc/alloc 325230680.0 325474448.0 +0.1% T5631(normal) ghc/alloc 592064448.0 593518968.0 +0.2% T5837(normal) ghc/alloc 37691496.0 37710904.0 +0.1% T783(normal) ghc/alloc 404629536.0 405064432.0 +0.1% T9020(optasm) ghc/alloc 266004608.0 266375592.0 +0.1% T9198(normal) ghc/alloc 49221336.0 49268648.0 +0.1% T9233(normal) ghc/alloc 913464984.0 742680256.0 -18.7% GOOD T9675(optasm) ghc/alloc 552296608.0 466322000.0 -15.6% GOOD T9872a(normal) ghc/alloc 1789910616.0 1793924472.0 +0.2% T9872b(normal) ghc/alloc 2315141376.0 2310338056.0 -0.2% T9872c(normal) ghc/alloc 1840422424.0 1841567224.0 +0.1% T9872d(normal) ghc/alloc 556713248.0 556838432.0 +0.0% T9961(normal) ghc/alloc 383809160.0 384601600.0 +0.2% WWRec(normal) ghc/alloc 773751272.0 753949608.0 -2.6% GOOD Residency goes down too: Metrics: compile_time/max_bytes_used ------------------------------------ Baseline Test Metric value New value Change ----------------------------------------------------------- T10370(optasm) ghc/max 42058448.0 39481672.0 -6.1% T11545(normal) ghc/max 43641392.0 43634752.0 -0.0% T15304(normal) ghc/max 29895824.0 29439032.0 -1.5% T15630(normal) ghc/max 8822568.0 8772328.0 -0.6% T18698a(normal) ghc/max 13882536.0 13787112.0 -0.7% T18698b(normal) ghc/max 14714112.0 13836408.0 -6.0% T1969(normal) ghc/max 24724128.0 24733496.0 +0.0% T3064(normal) ghc/max 14041152.0 14034768.0 -0.0% T3294(normal) ghc/max 32769248.0 32760312.0 -0.0% T9630(normal) ghc/max 41605120.0 41572184.0 -0.1% T9675(optasm) ghc/max 18652296.0 17253480.0 -7.5% Metric Decrease: T10421 T12227 T15164 T17516 T18698a T18698b T9233 T9675 WWRec Metric Increase: T12545
* Fix Integral instances for WordsSylvain Henry2021-06-042-110/+120
| | | | | | | | | | | | * ensure that division wrappers are INLINE * make div/mod/divMod call quot/rem/quotRem (same code) * this ensures that the quotRemWordN# primitive is used to implement divMod (it wasn't the case for sized Words) * make first argument strict for Natural and Integer (similarly to other numeric types)
* Make some simple primops levity-polymorphicsheaf2021-06-0420-63/+191
| | | | Fixes #17817
* Add PsHeaderMessage diagnostic (fixes #19923)Alfredo Di Napoli2021-06-0414-26/+99
| | | | | | | | | | | This commit replaces the PsUnknownMessage diagnostics over at `GHC.Parser.Header` with a new `PsHeaderMessage` type (part of the more general `PsMessage`), so that we can throw parser header's errors which can be correctly caught by `GHC.Driver.Pipeline.preprocess` and rewrapped (correctly) as Driver messages (using the `DriverPsHeaderMessage`). This gets rid of the nasty compiler crash as part of #19923.
* users-guide: Add OverloadedRecordDot and OverloadedRecordUpdate for ghc-9.2Takenobu Tani2021-06-041-0/+9
| | | | | This patch adds OverloadedRecordDot and OverloadedRecordUpdate in 9.2.1's release note.
* Fix incorrect mention of -Wprepositive-qualified-syntax in docsThomas Winant2021-06-041-3/+1
| | | | | | | | The flag is called `-Wprepositive-qualified-module`, not `-Wprepositive-qualified-syntax`. Use the `:ghc-flag:` syntax, which would have caught the mistake in the first place.
* Follow up #12449: Improve function `Inspect.hs:check2`Roland Senn2021-06-031-20/+64
| | | | | | | | | * Add a Note to clarify RttiTypes. * Don't call `quantifyType` at all the call sites of `check2`. * Simplyfy arguments of functions `Inspect.hs:check1` and `Inspect.hs:check2`. - `check1` only uses the two lists of type variables, but not the types. - `check2` only uses the two types, but not the lists of type variables. * In `Inspect.hs:check2` send only the tau part of the type to `tcSplitTyConApp_maybe`.
* Port HsToCore messages to new infrastructureAlfredo Di Napoli2021-06-0340-469/+1016
| | | | | | | | | | | This commit converts a bunch of HsToCore (Ds) messages to use the new GHC's diagnostic message infrastructure. In particular the DsMessage type has been expanded with a lot of type constructors, each encapsulating a particular error and warning emitted during desugaring. Due to the fact that levity polymorphism checking can happen both at the Ds and at the TcRn level, a new `TcLevityCheckDsMessage` constructor has been added to the `TcRnMessage` type.
* Driver Rework PatchMatthew Pickering2021-06-03180-1061/+1830
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch comprises of four different but closely related ideas. The net result is fixing a large number of open issues with the driver whilst making it simpler to understand. 1. Use the hash of the source file to determine whether the source file has changed or not. This makes the recompilation checking more robust to modern build systems which are liable to copy files around changing their modification times. 2. Remove the concept of a "stable module", a stable module was one where the object file was older than the source file, and all transitive dependencies were also stable. Now we don't rely on the modification time of the source file, the notion of stability is moot. 3. Fix TH/plugin recompilation after the removal of stable modules. The TH recompilation check used to rely on stable modules. Now there is a uniform and simple way, we directly track the linkables which were loaded into the interpreter whilst compiling a module. This is an over-approximation but more robust wrt package dependencies changing. 4. Fix recompilation checking for dynamic object files. Now we actually check if the dynamic object file exists when compiling with -dynamic-too Fixes #19774 #19771 #19758 #17434 #11556 #9121 #8211 #16495 #7277 #16093
* CountDeps: print graph of module dependencies in dot formatShayne Fletcher2021-06-021-10/+28
| | | | | | | | The tests `CountParserDeps.hs` and `CountAstDeps.hs` are implemented by calling `CountDeps`. In this MR, `CountDeps.printDeps` is updated such tat by uncommenting a line, you can print a module's dependency graph showing what includes what. The output is in a format suitable for use with graphviz.
* WW: Mark absent errors as diverging againSebastian Graf2021-06-024-56/+57
| | | | | | | | | | | | | | | As the now historic part of `NOTE [aBSENT_ERROR_ID]` explains, we used to have `exprIsHNF` respond True to `absentError` and give it a non-bottoming demand signature, in order to perform case-to-let on certain `case`s we used to emit that scrutinised `absentError` (Urgh). What changed, why don't we emit these questionable absent errors anymore? The absent errors in question filled in for binders that would end up in strict fields after being seq'd. Apparently, the old strictness analyser would give these binders an absent demand, but today we give them head-strict demand `1A` and thus don't replace with absent errors at all. This fixes items (1) and (2) of #19853.
* Fix infinite looping in hptSomeModulesBelowMatthew Pickering2021-06-021-6/+14
| | | | | | | | | | | | | | | | When compiling Agda we entered into an infinite loop as the stopping condition was a bit wrong in hptSomeModulesBelow. The bad situation was something like * We would see module A (NotBoot) and follow it dependencies * Later on we would encounter A (Boot) and follow it's dependencies, because the lookup would not match A (NotBoot) and A (IsBoot) * Somewhere in A (Boot)s dependencies, A (Boot) would appear again and lead us into an infinite loop. Now the state marks whether we have been both variants (IsBoot and NotBoot) so we don't follow dependencies for A (Boot) many times.
* CI: Don't explicitly build hadrian before using run_hadrianMatthew Pickering2021-06-021-2/+0
| | | | | This causes hadrian to be built twice because the second time uses a different index state.
* Run both lint jobs togetherMatthew Pickering2021-06-021-9/+1
|
* hadrian: Speed up lint:base ruleMatthew Pickering2021-06-022-3/+8
| | | | | | | | | The rule before decided to build the whole stage1 compiler, but this was unecessary as we were just missing one header file which can be generated directly by calling configure. Before: 18 minutes After: 54s
* Disallow linear arrows in GADT records (#19928)Vladislav Zavialov2021-06-026-11/+48
| | | | | | | | | | | | | Before this patch, GHC used to silently accept programs such as the following: data R where D1 :: { d1 :: Int } %1 -> R The %1 annotation was completely ignored. Now it is a proper error. One remaining issue is that in the error message (⊸) turns into (%1 ->). This is to be corrected with upcoming exactprint updates.
* Specify the reason for import for the backpack's extra importsDivam2021-06-022-9/+13
|
* Fail before checking instances in checkHsigIface if exports don't match (#19244)Zubin Duggal2021-06-027-2/+103
|
* Allow primops in a :print (and friends) command. Fix #19394Roland Senn2021-06-025-11/+54
| | | | | | | * For primops from `GHC.Prim` lookup the HValues in `GHC.PrimopWrappers`. * Add short error messages if a user tries to use a *Non-Id* value or a `pseudoop` in a `:print`, `:sprint` or `force`command. * Add additional test cases for `Magic Ids`.
* Improve wording of fold[lr]M documentation.Viktor Dukhovni2021-06-021-53/+77
| | | | | | | | | | | | | | | The sequencing of monadic effects in foldlM and foldrM was described as respectively right-associative and left-associative, but this could be confusing, as in essence we're just composing Kleisli arrows, whose composition is simply associative. What matters therefore is the order of sequencing of effects, which can be described more clearly without dragging in associativity as such. This avoids describing these folds as being both left-to-right and right-to-left depending on whether we're tracking effects or operator application. The new text should be easier to understand.
* StgM: Use ReaderT rather than StateTBen Gamari2021-05-291-5/+5
|
* Use GHC's State monad consistentlyBen Gamari2021-05-2912-12/+24
| | | | | | | | | | | | | GHC's internal State monad benefits from oneShot annotations on its state, allowing for more aggressive eta expansion. We currently don't have monad transformers with the same optimisation, so we only change uses of the pure State monad here. See #19657 and 19380. Metric Decrease: hie002
* Split GHC.Utils.Monad.State into .Strict and .LazyBen Gamari2021-05-2913-12/+99
|
* Rip GHC.Tc.Solver.Monad asunder (only)Richard Eisenberg2021-05-2914-1926/+2031
| | | | | | | | | | | This creates new modules GHC.Tc.Solver.InertSet and GHC.Tc.Solver.Types. The Monad module is still pretty big, but this is an improvement. Moreover, it means that GHC.HsToCore.Pmc.Solver.Types no longer depends on the constraint solver (it now depends on GHC.Tc.Solver.InertSet), making the error-messages work easier. This patch thus contributes to #18516.
* Fix and slight improvement to datacon worker/wrapper notesSylvain Henry2021-05-292-2/+5
|
* Bignum: match on DataCon workers in rules (#19892)Sylvain Henry2021-05-296-12/+59
| | | | | | | | | We need to match on DataCon workers for the rules to be triggered. T13701 ghc/alloc decreases by ~2.5% on some archs Metric Decrease: T13701
* Fix Note [Positioning of forkM]Zubin Duggal2021-05-291-5/+4
|
* ghci: Enable -fkeep-going by defaultMatthew Pickering2021-05-299-5/+19
| | | | | | | | | | | This also demotes the error message about -fkeep-going to a trace message which matches the behaviour of other build systems (such as cabal-install and nix) which don't print any message like this on a failure. We want to remove the stable module check in a future patch, which is an approximation of `-fkeep-going`. At the moment this change shouldn't do very much.
* sighparsonsmatt2021-05-291-1/+1
|
* Apply 2 suggestion(s) to 1 file(s)parsonsmatt2021-05-291-2/+2
|
* Address review comments, export from THparsonsmatt2021-05-293-1/+8
|
* Add `newDeclarationGroup` and provide documentation in reifyInstances and ↵parsonsmatt2021-05-291-0/+62
| | | | isInstance
* Work around LLVM backend overlapping register limitationsLuite Stegeman2021-05-299-165/+136
| | | | | | | | The stg_ctoi_t and stg_ret_t procedures which convert unboxed tuples between the bytecode an native calling convention were causing a panic when using the LLVM backend. Fixes #19591
* Add -Wmissing-exported-pattern-synonym-signaturesThomas Winant2021-05-2919-352/+255
| | | | | | | | | | | | | After !4741, it was no longer possible to silence a warning about a missing pattern synonym signature if the `-Wmissing-signatures` flag was on. Restore the previous semantics while still adhering to the principle "enabling an additional warning flag should never make prior warnings disappear". For more symmetry and granularity, introduce `-Wmissing-exported-pattern-synonym-signatures`. See Note [Missing signatures] for an overview of all flags involved.
* Use quotRemWord in showWordSylvain Henry2021-05-281-3/+5
| | | | | | | | | | | | | | | | | | Using the following high-quality benchmark (with -O2): main :: IO () main = do let go 0 = "" go n@(W# n#) = showWord n# (go (n -1)) print $ length (go 10000000) I get the following performance results: - remWord+quotRem: 0,76s user 0,00s system 99% cpu 0,762 total - quotRemWord: 0,45s user 0,01s system 99% cpu 0,456 total Note that showSignedInt already uses quotRemInt.
* Document release when TypeApplications allowed declaring variables as inferredBoris Lykah2021-05-281-2/+3
|
* [EPA] exact print linear arrows.Alan Zimmerman2021-05-276-13/+91
| | | | | | | | Closes #19903 Note: the normal ppr does not reproduce unicode linear arrows, so that part of the normal printing test is ommented out in the Makefile for this test. See #18846
* Improve deriveConstants error message.Andreas Klebinger2021-05-271-1/+2
| | | | This fixes #19823
* Change representation of HsGetField and HsProjectionShayne Fletcher2021-05-279-68/+74
| | | | | Another change in a series improving record syntax in the AST. The key change in this commit is the renaming of `HsFieldLabel` to `DotFieldOcc`.
* Enable strict dicts by default at -O2.Andreas Klebinger2021-05-277-39/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the common case this is a straight performance win at a compile time cost so we enable it at -O2. In rare cases it can lead to compile time regressions because of changed inlining behaviour. Which can very rarely also affect runtime performance. Increasing the inlining threshold can help to avoid this which is documented in the user guide. In terms of measured results this reduced instructions executed for nofib by 1%. However for some cases (e.g. Cabal) enabling this by default increases compile time by 2-3% so we enable it only at -O2 where it's clear that a user is willing to trade compile time for runtime. Most of the testsuite runs without -O2 so there are few perf changes. Increases: T12545/T18698: We perform more WW work because dicts are now treated strict. T9198: Also some more work because functions are now subject to W/W Decreases: T14697: Compiling empty modules. Probably because of changes inside ghc. T9203: I can't reproduce this improvement locally. Might be spurious. ------------------------- Metric Decrease: T12227 T14697 T9203 Metric Increase: T9198 T12545 T18698a T18698b -------------------------
* Avoid fingerprinting the absolute path to the source filePepe Iborra2021-05-2611-8/+96
| | | | | | | | | | | | | | | | | | | | | | | This change aims to make source files relocatable w.r.t. to the interface files produced by the compiler. This is so that we can download interface files produced by a cloud build system and then reuse them in a local ghcide session catch another case of implicit includes actually use the implicit quote includes add another missing case recomp020 test that .hi files are reused even if .hs files are moved to a new location Added recomp021 to record behaviour with non implicit includes add a note additional pointer to the note Mention #16956 in Note
* Support new parser types in GHCAlfredo Di Napoli2021-05-2647-1307/+1569
| | | | | | | | | | | | | | This commit converts the lexers and all the parser machinery to use the new parser types and diagnostics infrastructure. Furthermore, it cleans up the way the parser code was emitting hints. As a result of this systematic approach, the test output of the `InfixAppPatErr` and `T984` tests have been changed. Previously they would emit a `SuggestMissingDo` hint, but this was not at all helpful in resolving the error, and it was even confusing by just looking at the original program that triggered the errors. Update haddock submodule
* Add 9.2 release note about linear caseRichard Eisenberg2021-05-251-0/+6
| | | | | | This is part of #18738 [skip ci]
* Revert "hadrian: Don't always links against libffi"Matthew Pickering2021-05-251-1/+2
| | | | This reverts commit 673ff667c98eafc89e6746d1ac69d33b8330d755.
* [hadrian] Properly build hsc2hs wrapperMoritz Angermann2021-05-251-18/+23
|
* [ci] faster pipelineMoritz Angermann2021-05-251-5/+1
|