summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Do eager instantation in termswip/T17173Simon Peyton Jones2020-04-2171-849/+943
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements eager instantiation, a small but critical change to the type inference engine, #17173. The main change is this: When inferring types, always return an instantiated type (for now, deeply instantiated; in future shallowly instantiated) There is more discussion in https://www.tweag.io/posts/2020-04-02-lazy-eager-instantiation.html There is quite a bit of refactoring in this patch: * The ir_inst field of GHC.Tc.Utils.TcType.InferResultk has entirely gone. So tcInferInst and tcInferNoInst have collapsed into tcInfer. * Type inference of applications, via tcInferApp and tcInferAppHead, are substantially refactored, preparing the way for Quick Look impredicativity. * New pure function GHC.Tc.Gen.Expr.collectHsArgs and applyHsArgs are beatifully dual. We can see the zipper! * GHC.Tc.Gen.Expr.tcArgs is now much nicer; no longer needs to return a wrapper * In HsExpr, HsTypeApp now contains the the actual type argument, and is used in desugaring, rather than putting it in a mysterious wrapper. * I struggled a bit with good error reporting in Unify.matchActualFunTysPart. It's a little bit simpler than before, but still not great. Some smaller things * Rename tcPolyExpr --> tcCheckExpr tcMonoExpr --> tcLExpr * tcPatSig moves from GHC.Tc.Gen.HsType to GHC.Tc.Gen.Pat Metric Decrease: T9961 Reduction of 1.6% in comiler allocation on T9961, I think.
* CmmToAsm DynFlags refactoring (#17957)Sylvain Henry2020-04-2114-276/+298
| | | | | | | | | | | | | * Remove `DynFlags` parameter from `isDynLinkName`: `isDynLinkName` used to test the global `ExternalDynamicRefs` flag. Now we test it outside of `isDynLinkName` * Add new fields into `NCGConfig`: current unit id, sse/bmi versions, externalDynamicRefs, etc. * Replace many uses of `DynFlags` by `NCGConfig` * Moved `BMI/SSE` datatypes into `GHC.Platform`
* Avoid `sdocWithDynFlags` in `pprCLbl` (#17957)Sylvain Henry2020-04-211-125/+100
| | | | | | * add a `DynFlags` parameter to `pprCLbl` * put `maybe_underscore` and `pprAsmCLbl` in a `where` clause to avoid `DynFlags` parameters
* Avoid using sdocWithDynFlags (#17957)Sylvain Henry2020-04-213-14/+13
| | | | | Remove one use of `sdocWithDynFlags` from `GHC.CmmToLlvm.llvmCodeGen'` and from `GHC.Driver.CodeOutput.profilingInitCode`
* Avoid DynFlags in Ppr code (#17957)Sylvain Henry2020-04-217-42/+49
| | | | | | | | | | * replace `DynFlags` parameters with `SDocContext` parameters for a few Ppr related functions: `bufLeftRenderSDoc`, `printSDoc`, `printSDocLn`, `showSDocOneLine`. * remove the use of `pprCols :: DynFlags -> Int` in Outputable. We already have the information via `sdocLineLength :: SDocContext -> Int`
* GHC.Runtime: avoid DynFlags (#17957)Sylvain Henry2020-04-213-11/+18
| | | | | * add `getPlatform :: TcM Platform` helper * remove unused `DynFlags` parameter from `emptyPLS`
* Use ParserFlags in GHC.Runtime.Eval (#17957)Sylvain Henry2020-04-213-22/+25
| | | | | | Instead of passing `DynFlags` to functions such as `isStmt` and `hasImport` in `GHC.Runtime.Eval` we pass `ParserFlags`. It's a much simpler structure that can be created purely with `mkParserFlags'`.
* docs: drop note about not supporting shared libraries on unix systemsAdam Sandberg Ericsson2020-04-211-2/+0
| | | | [skip ci]
* Mark T12010 fragile on 32-bitÖmer Sinan Ağacan2020-04-201-5/+5
|
* Fix a buglet in redundant-constraint warningsSimon Peyton Jones2020-04-205-3/+46
| | | | | | | | Ticket #18036 pointed out that we were reporting a redundant constraint when it really really wasn't. Turned out to be a buglet in the SkolemInfo for the relevant implication constraint. Easily fixed!
* Derive Ord instance for ExtensionShayne Fletcher2020-04-201-0/+4
| | | | | | Metric Increase: T12150 T12234
* Add missing addInScope call for letrec binders in OccurAnalAlexis King2020-04-191-3/+5
| | | | | | | | This fixes #18044, where a shadowed variable was incorrectly substituted by the binder swap on the RHS of a floated-in letrec. This can only happen when the uniques line up *just* right, so writing a regression test would be very difficult, but at least the fix is small and straightforward.
* Modules (#13009)Sylvain Henry2020-04-18250-1058/+1038
| | | | | | | | | | | | | | * SysTools * Parser * GHC.Builtin * GHC.Iface.Recomp * Settings Update Haddock submodule Metric Decrease: Naperian parsing001
* GHC.Core.Opt renamingSylvain Henry2020-04-1882-302/+302
| | | | | | | | | | | * GHC.Core.Op => GHC.Core.Opt * GHC.Core.Opt.Simplify.Driver => GHC.Core.Opt.Driver * GHC.Core.Opt.Tidy => GHC.Core.Tidy * GHC.Core.Opt.WorkWrap.Lib => GHC.Core.Opt.WorkWrap.Utils As discussed in: * https://mail.haskell.org/pipermail/ghc-devs/2020-April/018758.html * https://gitlab.haskell.org/ghc/ghc/issues/13009#note_264650
* Improve prepForeignCall error reportingÖmer Sinan Ağacan2020-04-181-9/+21
| | | | | | | Show parameters and description of the error code when ffi_prep_cif fails. This may be helpful for debugging #17018.
* Bump hsc2hs submoduleBen Gamari2020-04-181-0/+0
|
* gitlab-ci: Use rules syntax for conditional jobsBen Gamari2020-04-181-74/+41
|
* gitlab-ci: Enable FreeBSD job for so-labelled MRsBen Gamari2020-04-181-2/+5
|
* gitlab-ci: Bump FreeBSD bootstrap compiler to 8.10.1Ben Gamari2020-04-182-8/+2
|
* Add a missing zonk in tcHsPartialTypeSimon Peyton Jones2020-04-184-14/+94
| | | | | | | | | | | | | I omitted a vital zonk when refactoring tcHsPartialType in commit 48fb3482f8cbc8a4b37161021e846105f980eed4 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Wed Jun 5 08:55:17 2019 +0100 Fix typechecking of partial type signatures This patch fixes it and adds commentary to explain why. Fixes #18008
* Use FailOperator in more places, define a couple datatypes (XBindStmtRn and ↵Cale Gibbard2020-04-1711-60/+97
| | | | XBindStmtTc) to help clarify the meaning of XBindStmt in the renamer and typechecker
* Use trees that grow for rebindable operators for `<-` bindsJohn Ericson2020-04-1718-118/+135
| | | | Also add more documentation.
* Change the fail operator argument of BindStmt to be a MaybeCale Gibbard2020-04-1710-44/+66
| | | | | Don't use noSyntaxExpr for it. There is no good way to defensively case on that, nor is it clear one ought to do so.
* Fix #18065 by fixing an InstCo oversight in Core LintRyan Scott2020-04-173-6/+115
| | | | | | | | | | There was a small thinko in Core Lint's treatment of `InstCo` coercions that ultimately led to #18065. The fix: add an apostrophe. That's it! Fixes #18065. Co-authored-by: Simon Peyton Jones <simonpj@microsoft.com>
* Hadrian: fix dyn_o/dyn_hi rule (#17534)Sylvain Henry2020-04-171-1/+16
|
* rts: ProfHeap: Fix wrong time in last heap profile sampleDaniel Gröber2020-04-151-3/+4
| | | | | | | | | | | | | | | | | | We've had this longstanding issue in the heap profiler, where the time of the last sample in the profile is sometimes way off causing the rendered graph to be quite useless for long runs. It seems to me the problem is that we use mut_user_time() for the last sample as opposed to getRTSStats(), which we use when calling heapProfile() in GC.c. The former is equivalent to getProcessCPUTime() but the latter does some additional stuff: getProcessCPUTime() - end_init_cpu - stats.gc_cpu_ns - stats.nonmoving_gc_cpu_ns So to fix this just use getRTSStats() in both places.
* Fix #18052 by using pprPrefixOcc in more placesRyan Scott2020-04-159-34/+96
| | | | | This fixes several small oversights in the choice of pretty-printing function to use. Fixes #18052.
* Bump template-haskell version to 2.17.0.0Ryan Scott2020-04-147-10/+10
| | | | | | | | | | | | | | | | | | This requires bumping the `exceptions` and `text` submodules to bring in commits that bump their respective upper version bounds on `template-haskell`. Fixes #17645. Fixes #17696. Note that the new `text` commit includes a fair number of additions to the Haddocks in that library. As a result, Haddock has to do more work during the `haddock.Cabal` test case, increasing the number of allocations it requires. Therefore, ------------------------- Metric Increase: haddock.Cabal -------------------------
* rts: Assert LDV_recordDead is not called for inherently used closuresDaniel Gröber2020-04-143-24/+44
| | | | | The comments make it clear LDV_recordDead should not be called for inhererently used closures, so add an assertion to codify this fact.
* Remove call to LDV_RECORD_CREATE for array resizingDaniel Gröber2020-04-141-15/+10
|
* rts: Fix nomenclature in OVERWRITING_CLOSURE macrosDaniel Gröber2020-04-142-19/+32
| | | | | | | | | | The additional commentary introduced by commit 8916e64e5437 ("Implement shrinkSmallMutableArray# and resizeSmallMutableArray#.") unfortunately got this wrong. We set 'prim' to true in overwritingClosureOfs because we _don't_ want to call LDV_recordDead(). The reason is because of this "inherently used" distinction made in the LDV profiler so I rename the variable to be more appropriate.
* rts: Underline some Notes as is conventionalDaniel Gröber2020-04-144-0/+4
|
* rts: allocatePinned: Fix confusion about word/byte unitsDaniel Gröber2020-04-141-19/+22
|
* rts: Expand and add more notes regarding slopDaniel Gröber2020-04-145-24/+97
|
* Zero out pinned block alignment slop when profilingDaniel Gröber2020-04-143-26/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The heap profiler currently cannot traverse pinned blocks because of alignment slop. This used to just be a minor annoyance as the whole block is accounted into a special cost center rather than the respective object's CCS, cf. #7275. However for the new root profiler we would like to be able to visit _every_ closure on the heap. We need to do this so we can get rid of the current 'flip' bit hack in the heap traversal code. Since info pointers are always non-zero we can in principle skip all the slop in the profiler if we can rely on it being zeroed. This assumption caused problems in the past though, commit a586b33f8e ("rts: Correct handling of LARGE ARR_WORDS in LDV profiler"), part of !1118, tried to use the same trick for BF_LARGE objects but neglected to take into account that shrink*Array# functions don't ensure that slop is zeroed when not compiling with profiling. Later, commit 0c114c6599 ("Handle large ARR_WORDS in heap census (fix as we will only be assuming slop is zeroed when profiling is on. This commit also reduces the ammount of slop we introduce in the first place by calculating the needed alignment before doing the allocation for small objects where we know the next available address. For large objects we don't know how much alignment we'll have to do yet since those details are hidden behind the allocateMightFail function so there we continue to allocate the maximum additional words we'll need to do the alignment. So we don't have to duplicate all this logic in the cmm code we pull it into the RTS allocatePinned function instead. Metric Decrease: T7257 haddock.Cabal haddock.base
* Hadrian: Make -i paths absoluteMatthew Pickering2020-04-141-5/+8
| | | | | | The primary reason for this change is that ghcide does not work with relative paths. It also matches what cabal and stack do, they always pass absolute paths.
* base: Enable large file support for OFD locking impl.Ben Gamari2020-04-141-0/+3
| | | | | Not only is this a good idea in general but this should also avoid issue #17950 by ensuring that off_t is 64-bits.
* rts: Don't mark evacuate_large as inlineBen Gamari2020-04-141-1/+1
| | | | | | This function has two callsites and is quite large. GCC consequently decides not to inline and warns instead. Given the situation, I can't blame it. Let's just remove the inline specifier.
* StgCRun: Enable unwinding only on LinuxBen Gamari2020-04-141-4/+11
| | | | | | It's broken on macOS due and SmartOS due to assembler differences (#15207) so let's be conservative in enabling it. Also, refactor things to make the intent clearer.
* doc (Foldable): Add examples to Data.FoldableJulien Debon2020-04-141-3/+470
| | | | See #17929
* hadrian: get rid of unnecessary levels of nesting in source-distAlp Mestanogullari2020-04-142-4/+7
|
* Small change to the windows ticker.Andreas Klebinger2020-04-141-1/+7
| | | | | We already have a function to go from time to ms so use it. Also expand on the state of timer resolution.
* Change zipWith to zipWithEqual in a few placesKrzysztof Gogolewski2020-04-1412-21/+28
|
* Add an INLINE pragma to Control.Category.>>>Alexis King2020-04-126-4/+355
| | | | | | | This fixes #18013 by adding INLINE pragmas to both Control.Category.>>> and GHC.Desugar.>>>. The functional change in this patch is tiny (just two lines of pragmas!), but an accompanying Note explains in gory detail what’s going on.
* hadrian: Don't --export-dynamic on DarwinBen Gamari2020-04-122-1/+14
| | | | | When fixing #17962 I neglected to consider that --export-dynamic is only supported on ELF platforms.
* Use conLikeUserTyVarBinders to quantify field selector typesRyan Scott2020-04-1212-23/+297
| | | | | | | | | | | | | This patch: 1. Writes up a specification for how the types of top-level field selectors should be determined in a new section of the GHC User's Guide, and 2. Makes GHC actually implement that specification by using `conLikeUserTyVarBinders` in `mkOneRecordSelector` to preserve the order and specificity of type variables written by the user. Fixes #18023.
* Implement extensible interface filesJosh Meredith2020-04-128-8/+224
|
* Significant refactor of LintSimon Peyton Jones2020-04-124-518/+577
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This refactoring of Lint was triggered by #17923, which is fixed by this patch. The main change is this. Instead of lintType :: Type -> LintM LintedKind we now have lintType :: Type -> LintM LintedType Previously, all of typeKind was effectively duplicate in lintType. Moreover, since we have an ambient substitution, we still had to apply the substition here and there, sometimes more than once. It was all very tricky, in the end, and made my head hurt. Now, lintType returns a fully linted type, with all substitutions performed on it. This is much simpler. The same thing is needed for Coercions. Instead of lintCoercion :: OutCoercion -> LintM (LintedKind, LintedKind, LintedType, LintedType, Role) we now have lintCoercion :: Coercion -> LintM LintedCoercion Much simpler! The code is shorter and less bug-prone. There are a lot of knock on effects. But life is now better. Metric Decrease: T1969
* testsuite: Fix comment for a language extensionTakenobu Tani2020-04-121-2/+2
| | | | [skip ci]
* Testsuite: mark T11531 fragilePeter Trommler2020-04-101-1/+2
| | | | | | | | The test depends on a link editor allowing undefined symbols in an ELF shared object. This is the standard but it seems some distributions patch their link editor. See the report by @hsyl20 in #11531. Fixes #11531