summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Use tcView, not coreView, in the pure unifier.wip/T11715-2020Richard Eisenberg2020-08-052-3/+24
| | | | Addresses a lingering point within #11715.
* Bignum: fix powMod for gmp backend (#18515)Sylvain Henry2020-07-307-13/+20
| | | | | Also reenable integerPowMod test which had never been reenabled by mistake.
* DynFlags: don't use sdocWithDynFlags in datacon pprSylvain Henry2020-07-306-24/+25
| | | | | | | We don't need to use `sdocWithDynFlags` to know whether we should display linear types for datacon types, we already have `sdocLinearTypes` field in `SDocContext`. Moreover we want to remove `sdocWithDynFlags` (#10143, #17957)).
* Fix minimal imports dump for boot files (fix #18497)Sylvain Henry2020-07-309-10/+60
|
* Add two bangs to improve perf of flatteningSimon Peyton Jones2020-07-301-4/+6
| | | | | | | | | | | | | | | | | | | | This tiny patch improves the compile time of flatten-heavy programs by 1-2%, by adding two bangs. Addresses (somewhat) #18502 This reduces allocation by T9872b -1.1% T9872d -3.3% T5321Fun -0.2% T5631 -0.2% T5837 +0.1% T6048 +0.1% Metric Decrease: T9872b T9872d
* Remove an incorrect WARN in extendLocalRdrEnvSimon Peyton Jones2020-07-302-20/+41
| | | | | | I noticed this warning going off, and discovered that it's really fine. This small patch removes the warning, and docments what is going on.
* Don't mark closed type family equations as occurrencesRyan Scott2020-07-3011-71/+147
| | | | | | | | | | | | | | | | | | | | | | | | Previously, `rnFamInstEqn` would mark the name of the type/data family used in an equation as an occurrence, regardless of what sort of family it is. Most of the time, this is the correct thing to do. The exception is closed type families, whose equations constitute its definition and therefore should not be marked as occurrences. Overzealously counting the equations of a closed type family as occurrences can cause certain warnings to not be emitted, as observed in #18470. See `Note [Type family equations and occurrences]` in `GHC.Rename.Module` for the full story. This fixes #18470 with a little bit of extra-casing in `rnFamInstEqn`. To accomplish this, I added an extra `ClosedTyFamInfo` field to the `NonAssocTyFamEqn` constructor of `AssocTyFamInfo` and refactored the relevant call sites accordingly so that this information is propagated to `rnFamInstEqn`. While I was in town, I moved `wrongTyFamName`, which checks that the name of a closed type family matches the name in an equation for that family, from the renamer to the typechecker to avoid the need for an `ASSERT`. As an added bonus, this lets us simplify the details of `ClosedTyFamInfo` a bit.
* Clean up the inferred type variable restrictionRyan Scott2020-07-3014-128/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch primarily: * Documents `checkInferredVars` (previously called `check_inferred_vars`) more carefully. This is the function which throws an error message if a user quantifies an inferred type variable in a place where specificity cannot be observed. See `Note [Unobservably inferred type variables]` in `GHC.Rename.HsType`. Note that I now invoke `checkInferredVars` _alongside_ `rnHsSigType`, `rnHsWcSigType`, etc. rather than doing so _inside_ of these functions. This results in slightly more call sites for `checkInferredVars`, but it makes it much easier to enumerate the spots where the inferred type variable restriction comes into effect. * Removes the inferred type variable restriction for default method type signatures, per the discussion in #18432. As a result, this patch fixes #18432. Along the way, I performed some various cleanup: * I moved `no_nested_foralls_contexts_err` into `GHC.Rename.Utils` (under the new name `noNestedForallsContextsErr`), since it now needs to be invoked from multiple modules. I also added a helper function `addNoNestedForallsContextsErr` that throws the error message after producing it, as this is a common idiom. * In order to ensure that users cannot sneak inferred type variables into `SPECIALISE instance` pragmas by way of nested `forall`s, I now invoke `addNoNestedForallsContextsErr` when renaming `SPECIALISE instance` pragmas, much like when we rename normal instance declarations. (This probably should have originally been done as a part of the fix for #18240, but this task was somehow overlooked.) As a result, this patch fixes #18455 as a side effect.
* Add haddock comment for unfilteredEdgescgibbard2020-07-301-9/+8
| | | and move the note about drop_hs_boot_nodes into it.
* For `-fkeep-going` do not duplicate dependency edge codeJohn Ericson2020-07-301-45/+47
| | | | | | | | We now compute the deps for `-fkeep-going` the same way that the original graph calculates them, so the edges are correct. Upsweep really ought to take the graph rather than a topological sort so we are never recalculating anything, but at least things are recaluclated consistently now.
* Fix validation errors (#18510)Krzysztof Gogolewski2020-07-295-10/+12
| | | | | | | Test T2632 is a stage1 test that failed because of the Q => Quote change. The remaining tests did not use quotation and failed when the path contained a space.
* Fix bug in Natural multiplication (fix #18509)Sylvain Henry2020-07-296-8/+19
| | | | | | A bug was lingering in Natural multiplication (inverting two limbs) despite QuickCheck tests used during the development leading to wrong results (independently of the selected backend).
* configure: Fix build system on ARMPeter Trommler2020-07-291-1/+1
|
* Kill off sc_mult and as_mult fieldsSimon Peyton Jones2020-07-292-67/+42
| | | | | | | They are readily derivable from other fields, so this is more efficient, and less error prone. Fixes #18494
* Filter out unreachable constructors when deriving stock instances (#16431)Brandon Chinn2020-07-293-18/+103
|
* Pass tc_args to gen_fnBrandon Chinn2020-07-293-32/+33
|
* Pass dit_rep_tc_args to dsm_stock_gen_fnBrandon Chinn2020-07-292-9/+15
|
* Add regression test for #16341Brandon Chinn2020-07-292-0/+32
|
* Fix typoFelix Wiemuth2020-07-291-1/+1
|
* ghc/mk: don't build gmp packages for BIGNUM_BACKEND=nativeSergei Trofimovich2020-07-281-0/+2
| | | | | | | | | | | | | | | Before this change make-based `BIGNUM_BACKEND=native` build was failing as: ``` x86_64-pc-linux-gnu-gcc: error: libraries/ghc-bignum/gmp/objs/*.o: No such file or directory ``` This happens because ghc.mk was pulling in gmp-dependent ghc-bignum library unconditionally. The change avoid building ghc-bignum. Bug: https://gitlab.haskell.org/ghc/ghc/-/issues/18437 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Fix typo in haddockOleg Grenrus2020-07-281-1/+1
| | | | Spotted by `vilpan` on `#haskell`
* config: Fix Haskell platform constructor w/ paramsPeter Trommler2020-07-281-4/+4
| | | | Fixes #18505
* Bignum: add support for negative shifts (fix #18499)Sylvain Henry2020-07-284-4/+60
| | | | | | | shiftR/shiftL support negative arguments despite Haskell 2010 report saying otherwise. We explicitly test for negative values which is bad (it gets in the way of constant folding, etc.). Anyway, for consistency we fix Bits instancesof Integer/Natural.
* This patch addresses the exponential blow-up in the simplifier.Simon Peyton Jones2020-07-2833-277/+848
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically: #13253 exponential inlining #10421 ditto #18140 strict constructors #18282 another nested-function call case This patch makes one really significant changes: change the way that mkDupableCont handles StrictArg. The details are explained in GHC.Core.Opt.Simplify Note [Duplicating StrictArg]. Specific changes * In mkDupableCont, when making auxiliary bindings for the other arguments of a call, add extra plumbing so that we don't forget the demand on them. Otherwise we haev to wait for another round of strictness analysis. But actually all the info is to hand. This change affects: - Make the strictness list in ArgInfo be [Demand] instead of [Bool], and rename it to ai_dmds. - Add as_dmd to ValArg - Simplify.makeTrivial takes a Demand - mkDupableContWithDmds takes a [Demand] There are a number of other small changes 1. For Ids that are used at most once in each branch of a case, make the occurrence analyser record the total number of syntactic occurrences. Previously we recorded just OneBranch or MultipleBranches. I thought this was going to be useful, but I ended up barely using it; see Note [Note [Suppress exponential blowup] in GHC.Core.Opt.Simplify.Utils Actual changes: * See the occ_n_br field of OneOcc. * postInlineUnconditionally 2. I found a small perf buglet in SetLevels; see the new function GHC.Core.Opt.SetLevels.hasFreeJoin 3. Remove the sc_cci field of StrictArg. I found I could get its information from the sc_fun field instead. Less to get wrong! 4. In ArgInfo, arrange that ai_dmds and ai_discs have a simpler invariant: they line up with the value arguments beyond ai_args This allowed a bit of nice refactoring; see isStrictArgInfo, lazyArgcontext, strictArgContext There is virtually no difference in nofib. (The runtime numbers are bogus -- I tried a few manually.) Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- fft +0.0% -2.0% -48.3% -49.4% 0.0% multiplier +0.0% -2.2% -50.3% -50.9% 0.0% -------------------------------------------------------------------------------- Min -0.4% -2.2% -59.2% -60.4% 0.0% Max +0.0% +0.1% +3.3% +4.9% 0.0% Geometric Mean +0.0% -0.0% -33.2% -34.3% -0.0% Test T18282 is an existing example of these deeply-nested strict calls. We get a big decrease in compile time (-85%) because so much less inlining takes place. Metric Decrease: T18282
* gitlab-ci: Bump bootstrap compiler to 8.8.4Ben Gamari2020-07-271-6/+6
| | | | Hopefully this will make the Windows jobs a bit more reliable.
* gitlab-ci: Ensure that Hadrian jobs don't download artifactsBen Gamari2020-07-271-0/+1
| | | | | | Previously the Hadrian jobs had the default dependencies, meaning that they would download artifacts from all jobs of earlier stages. This is unneccessary.
* Eta-expand the Simplifier monadSimon Peyton Jones2020-07-271-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch eta-expands the Simplifier's monad, using the method explained in GHC.Core.Unify Note [The one-shot state monad trick]. It's part of the exta-expansion programme in #18202. It's a tiny patch, but is worth a 1-2% reduction in bytes-allocated by the compiler. Here's the list, based on the compiler-performance tests in perf/compiler: Reduction in bytes allocated T10858(normal) -0.7% T12425(optasm) -1.3% T13056(optasm) -1.8% T14683(normal) -1.1% T15164(normal) -1.3% T15630(normal) -1.4% T17516(normal) -2.3% T18282(normal) -1.6% T18304(normal) -0.8% T1969(normal) -0.6% T4801(normal) -0.8% T5321FD(normal) -0.7% T5321Fun(normal) -0.5% T5642(normal) -0.9% T6048(optasm) -1.1% T9020(optasm) -2.7% T9233(normal) -0.7% T9675(optasm) -0.5% T9961(normal) -2.9% WWRec(normal) -1.2% Metric Decrease: T12425 T9020 T9961
* Use allocate, not ALLOC_PRIM_P for unpackClosure#Michalis Pardalos2020-07-271-5/+7
| | | | | | | ALLOC_PRIM_P fails for large closures, by directly using allocate we can handle closures which are larger than the block size. Fixes #12492
* Add minimal test for #12492Michalis Pardalos2020-07-272-0/+12
|
* Drop 32-bit Windows supportBen Gamari2020-07-272-37/+5
| | | | As noted in #18487, we have reached the end of this road.
* Refactor the parser a littleVladislav Zavialov2020-07-272-39/+23
| | | | | | * Create a dedicated production for type operators * Create a dedicated type for the UNPACK pragma * Remove an outdated part of Note [Parsing data constructors is hard]
* fix typo referring to non-existent `-ohidir` flag, should be `-hidir` I thinkleiftw2020-07-271-1/+1
|
* Improve NegativeLiterals (#18022, GHC Proposal #344)Vladislav Zavialov2020-07-277-39/+149
| | | | | | | | | | | | | | | | | | | | Before this patch, NegativeLiterals used to parse x-1 as x (-1). This may not be what the user expects, and now it is fixed: x-1 is parsed as (-) x 1. We achieve this by the following requirement: * When lexing a negative literal, it must not be preceded by a 'closing token'. This also applies to unboxed literals, e.g. -1#. See GHC Proposal #229 for the definition of a closing token. A nice consequence of this change is that -XNegativeLiterals becomes a subset of -XLexicalNegation. In other words, enabling both of those extensions has the same effect as enabling -XLexicalNegation alone.
* winio: update codeownersTamar Christina2020-07-261-0/+15
|
* winio: fix detection of tty terminalsTamar Christina2020-07-261-2/+2
|
* winio: remove dead argument to stg_newIOPortzhTamar Christina2020-07-261-1/+1
|
* gitlab-ci: Kill ssh-agent after pushing test metricsBen Gamari2020-07-261-0/+5
| | | | | Otherwise the Windows builds hang forever waiting for the process to terminate.
* testsuite: Normalise WinIO error message differencesBen Gamari2020-07-262-3/+27
| | | | | Previously the old Windows IO manager threw different errors than WinIO. We now canonicalise these to the WinIO errors.
* testsuite: Update win32 output for parseTreeBen Gamari2020-07-261-7/+7
|
* rts/win32: Exit with EXIT_HEAPOVERFLOW if memory commit failsBen Gamari2020-07-261-1/+1
| | | | | | | | Since switching to the two-step allocator, the `outofmem` test fails via `osCommitMemory` failing to commit. However, this was previously exiting with `EXIT_FAILURE`, rather than `EXIT_HEAPOVERFLOW`. I think the latter is a more reasonable exit code for this case and matches the behavior on POSIX platforms.
* Document loadFramework changes. (#18446)Matthias Andreas Benkard2020-07-261-0/+35
| | | | | Adds commentary on the rationale for the changes made in merge request !3689.
* Require SMP support in order to build a threaded stage1Stefan Schulze Frielinghaus2020-07-251-1/+5
| | | | Fixes 18266
* Add accessors to ArchOSSylvain Henry2020-07-251-1/+4
|
* Bump CountParserDepsSylvain Henry2020-07-251-1/+1
|
* Fix build systemsSylvain Henry2020-07-258-30/+15
|
* Move GHC.Platform into the compilerSylvain Henry2020-07-2518-349/+337
| | | | | | | Previously it was in ghc-boot so that ghc-pkg could use it. However it wasn't necessary because ghc-pkg only uses a subset of it: reading target arch and OS from the settings file. This is now done via GHC.Platform.ArchOS (was called PlatformMini before).
* Remove dead code in utils/derivConstantsSylvain Henry2020-07-251-48/+0
|
* Remove platform constant wrappersSylvain Henry2020-07-2541-1289/+1392
| | | | | | | | | | Platform constant wrappers took a DynFlags parameter, hence implicitly used the target platform constants. We removed them to allow support for several platforms at once (#14335) and to avoid having to pass the full DynFlags to every function (#17957). Metric Decrease: T4801
* Put PlatformConstants into PlatformSylvain Henry2020-07-2512-28/+49
|
* Add GHC.Platform.ProfileSylvain Henry2020-07-255-26/+61
|