summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Bump template-haskell version to 2.18.0.0wip/T19083Ryan Scott2021-03-206-6/+6
| | | | | | | This requires bumping the `exceptions` and `text` submodules to bring in commits that bump their respective upper version bounds on `template-haskell`. Fixes #19083.
* Move miscategorized items in template-haskell changelogRyan Scott2021-03-201-6/+6
|
* Clean up TBDs in changelogBen Gamari2021-03-201-1/+7
| | | | (cherry picked from commit 4f334120c8e9cc4aefcbf11d99f169f648af9fde)
* gitlab-ci: Always start with fresh clonewip/ci-fixes-2Ben Gamari2021-03-201-0/+3
| | | | | Currently we are suffering from issues that appear to be caused by non-hermetic builds. Try avoiding this by setting `GIT_STRATEGY` to `clone`.
* Add error information to osCommitMemory on failure.Moritz Angermann2021-03-201-1/+1
|
* Remove outdated VagrantfileSebastian Graf2021-03-201-50/+0
|
* Add fold vs. mconcat test T17123Viktor Dukhovni2021-03-202-0/+14
|
* Fix fake import in GHC.Exception.Type boot moduleSylvain Henry2021-03-205-23/+22
| | | | | | | | | It seems like I imported "GHC.Types ()" thinking that it would transitively import GHC.Num.Integer when I wrote that module; but it doesn't. This led to build failures. See https://mail.haskell.org/pipermail/ghc-devs/2021-March/019641.html
* Fix literals for unregisterized backend of small typesJohn Ericson2021-03-201-5/+16
| | | | | | | | | | | | | | | | | | | | | | All credit to @hsyl20, who in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4717#note_338560 figured out this was a problem. To fix this, we use casts in addition to the shrinking and suffixing that is already done. It might make for more verbose code, I don't think that matters too much. In the future, perhaps some of the shrinking and suffixing can be removed for being redundant. That proved less trivial than it sounds, so this wasn't done at this time. Progress towards #19026 Metric Increase: T12707 T13379 Co-authored-by: Sylvain Henry <hsyl20@gmail.com>
* Add more boundary checks for `rem` and `mod`John Ericson2021-03-201-18/+44
| | | | | | | | | | | | | | | | | It's quite backend-dependent whether we will actually handle that case right, so let's just always do this as a precaution. In particular, once we replace the native primops used here with the new sized primops, the 16-bit ones on x86 will begin to use 16-bit sized instructions where they didn't before. Though I'm not sure of any arch which has 8-bit scalar instructions, I also did those for consistency. Plus, there are *vector* 8-bit ops in the wild, so if we ever got into autovectorization or something maybe it's prudent to put this here as a reminder not to forget about catching overflows. Progress towards #19026
* Fix an levity-polymorphism errorSimon Peyton Jones2021-03-204-89/+107
| | | | | | | | As #19522 points out, we did not account for visible type application when trying to reject naked levity-polymorphic functions that have no binding. This patch tidies up the code, and fixes the bug too.
* Add compiler perf regression test for #9198Simon Jakobi2021-03-202-0/+16
|
* Nested CPR light (#19398)Sebastian Graf2021-03-2028-508/+705
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While fixing #19232, it became increasingly clear that the vestigial hack described in `Note [Optimistic field binder CPR]` is complicated and causes reboxing. Rather than make the hack worse, this patch gets rid of it completely in favor of giving deeply unboxed parameters the Nested CPR property. Example: ```hs f :: (Int, Int) -> Int f p = case p of (x, y) | x == y = x | otherwise = y ``` Based on `p`'s `idDemandInfo` `1P(1P(L),1P(L))`, we can see that both fields of `p` will be available unboxed. As a result, we give `p` the nested CPR property `1(1,1)`. When analysing the `case`, the field CPRs are transferred to the binders `x` and `y`, respectively, so that we ultimately give `f` the CPR property. I took the liberty to do a bit of refactoring: - I renamed `CprResult` ("Constructed product result result") to plain `Cpr`. - I Introduced `FlatConCpr` in addition to (now nested) `ConCpr` and and according pattern synonym that rewrites flat `ConCpr` to `FlatConCpr`s, purely for compiler perf reasons. - Similarly for performance reasons, we now store binders with a Top signature in a separate `IntSet`, see `Note [Efficient Top sigs in SigEnv]`. - I moved a bit of stuff around in `GHC.Core.Opt.WorkWrap.Utils` and introduced `UnboxingDecision` to replace the `Maybe DataConPatContext` type we used to return from `wantToUnbox`. - Since the `Outputable Cpr` instance changed anyway, I removed the leading `m` which we used to emit for `ConCpr`. It's just noise, especially now that we may output nested CPRs. Fixes #19398.
* Make the simplifier slightly stricter.Andreas Klebinger2021-03-205-49/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reduces allocations by the simplifier by 3% for the Cabal test at -O2. We do this by making a few select fields, bindings and arguments strict which reduces allocations for the simplifier by around 3% in total for the Cabal test. Which is about 2% fewer allocations in total at -O2. ------------------------- Metric Decrease: T18698a T18698b T9233 T9675 T9872a T9872b T9872c T9872d T10421 T12425 T13253 T5321FD T9961 -------------------------
* Generate GHCi bytecode from STG instead of Core and support unboxedLuite Stegeman2021-03-2032-632/+2177
| | | | | | tuples and sums. fixes #1257
* Transfer tickish things to GHC.Types.TickishLuite Stegeman2021-03-2052-340/+427
| | | | | Metric Increase: MultiLayerModules
* rename Tickish to CoreTickishLuite Stegeman2021-03-2026-59/+66
|
* remove superfluous 'id' type parameter from GenTickishLuite Stegeman2021-03-2030-80/+99
| | | | | The 'id' type is now determined by the pass, using the XTickishId type family.
* Save the type of breakpoints in the Breakpoint tick in STGLuite Stegeman2021-03-2023-55/+97
| | | | | | | | GHCi needs to know the types of all breakpoints, but it's not possible to get the exprType of any expression in STG. This is preparation for the upcoming change to make GHCi bytecode from STG instead of Core.
* testsuite: Normalise slashesGHC GitLab CI2021-03-202-2/+3
| | | | In the `comments` and `literals` tests, since they contain file paths.
* check-ppr,check-exact: Write out result as binaryGHC GitLab CI2021-03-202-8/+19
| | | | | | | | | | | Previously we would use `writeFile` to write the intermediate files to check for round-tripping. However, this will open the output handle as a text handle, which on Windows will change line endings. Avoid this by opening as binary. Explicitly use utf8 encoding. This is for tests only, do not need to worry about user compatibility.
* GHC Exactprint main commitAlan Zimmerman2021-03-20369-10092/+23718
| | | | | | | | Metric Increase: T10370 parsing001 Updates haddock submodule
* Add the main types to be used for exactprint in the GHC ASTAlan Zimmerman2021-03-201-64/+964
| | | | | | | | | | | | | | | The MR introducing the API Annotations, !2418 is huge. Conceptually it is two parts, the one deals with introducing the new types to be used for annotations, and outlining how they will be used. This is a small change, localised to compiler/GHC/Parser/Annotation.hs and is contained in this commit. The follow-up, larger commit deals with mechanically working this through the entire AST and updating all the parts affected by it. It is being split so the part that needs good review feedback can be seen in isolation, prior to the rest coming in.
* [skip ci] Fix 'Ord' documentation inconsistencyGaël Deest2021-03-201-4/+4
| | | | | | | | | | | | | | | | | | | Current documentation for the `Ord` typeclass is inconsistent. It simultaneously mentions that: > The 'Ord' class is used for totally ordered datatypes. And: > The Haskell Report defines no laws for 'Ord'. However, '<=' is > customarily expected to implement a non-strict partial order […] The Haskell report (both 98 and 2010 versions) mentions total ordering, which implicitly does define laws. Moreover, `compare :: Ord a => a -> a -> Ordering` and `data Ordering = LT | EQ | GT` imply that the order is indeed total (there is no way to say that two elements are not comparable). This MR fixes the Haddock comment, and adds a comparability law to the list of suggested properties.
* gitlab-ci: Ignore performance improvements in marge jobsBen Gamari2021-03-193-14/+29
| | | | | | | | Currently we have far too many merge failures due to cumulative performance improvements. Avoid this by accepting metric decreases in marge-bot jobs. Fixes #19562.
* testsuite: Make --ignore-perf-tests more expressiveBen Gamari2021-03-194-9/+22
| | | | Allow skipping of only increases/decreases.
* Built-in type families: CharToNat, NatToChar (#19535)Vladislav Zavialov2021-03-178-31/+191
| | | | | Co-authored-by: Daniel Rogozin <daniel.rogozin@serokell.io> Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io>
* Document how GADT patterns are matched from left-to-right, outside-inRyan Scott2021-03-171-1/+82
| | | | | | | | | | | | | | This adds some bullet points to the GHC User's Guide section on `GADTs` to explain some subtleties in how GHC typechecks GADT patterns. In particular, this adds examples of programs being rejected for matching on GADTs in a way that does not mesh with GHC's left-to-right, outside-in order for checking patterns, which can result in programs being rejected for seemingly counterintuitive reasons. (See #12018 for examples of confusion that arose from this.) In addition, now that we have visible type application in data constructor patterns, I mention a possible workaround of using `TypeApplications` to repair programs of this sort. Resolves #12018.
* Disable bogus assertion (#19489)Sylvain Henry2021-03-171-2/+15
|
* CmmtoAsm.Reg.Linear: Rewrite processBen Gamari2021-03-171-33/+29
| | | | | | CmmToAsm.Reg.Linear: More strictness More strictness
* CmmToAsm.Reg.Linear: Make linearRA body a join pointBen Gamari2021-03-171-19/+17
| | | | Avoid top-level recursion.
* Eliminate selector thunk allocationsBen Gamari2021-03-171-1/+1
|
* IfaceToType: Ensure that IfaceTyConInfo is sharedBen Gamari2021-03-173-9/+18
| | | | | | | | | | | | | | | | In #19194 mpickering detailed that there are a LOT of allocations of IfaceTyConInfo: There are just two main cases: IfaceTyConInfo IsPromoted IfaceNormalTyCon and IfaceTyConInfo NotPromoted IfaceNormalTyCon. These should be made into CAFs and shared. From my analysis, the most common case is IfaceTyConInfo NotPromoted IfaceNormalTyCon (53 000) then IfaceTyConInfo IsPromoted IfaceNormalTyCon (28 000). This patch makes it so these are properly shared by using a smart constructor. Fixes #19194.
* Enhance pass result forcingSylvain Henry2021-03-172-4/+13
| | | | | | | | When we use `withTiming` we need to force the results of each timed pass to better represent the time spent in each phase. This patch forces some results that weren't before. It also retrieve timings for the CoreToStg and WriteIface passes.
* llvmGen: Accept range of LLVM versionsBen Gamari2021-03-1710-36/+245
| | | | | | | Previously we would support only one LLVM major version. Here we generalize this to accept a range, taking this range to be LLVM 10 to 11, as 11 is necessary for Apple M1 support. We also accept 12, as that is what apple ships with BigSur on the M1.
* fromInteger :: Integer -> {Float,Double} now always round to nearest evenARATA Mizuki2021-03-175-32/+65
| | | | | | | | integerToFloat# and integerToDouble# were moved from ghc-bignum to base. GHC.Integer.floatFromInteger and doubleFromInteger were removed. Fixes #15926, #17231, #17782
* Add a test for fromInteger :: Integer -> Float/Double (#15926, #17231, #17782)ARATA Mizuki2021-03-173-0/+85
|
* [ci] don't make marge double build.wip/angerman/fix-18744Moritz Angermann2021-03-171-1/+0
| | | | This fixes !18744
* Make the CI jobs interruptibleHécate Moonlight2021-03-171-0/+2
| | | | closes #19362
* [ci] Skip test's on windows that often fail in CI.wip/angerman/stable-windowsMoritz Angermann2021-03-162-2/+10
|
* Test chained record construction/update/accessVladislav Zavialov2021-03-153-0/+18
| | | | | | | | | | | According to the proposal, we have the following equivalence: e{lbl1 = val1}.val2 == (e{lbl1 = val1}).val2 This is a matter of parsing. Record construction/update must have the same precedence as dot access. Add a test case to ensure this.
* Fix record dot precedence (#19521)Vladislav Zavialov2021-03-154-21/+20
| | | | | By moving the handling of TIGHT_INFIX_PROJ to the correct place, we can remove the isGetField hack and fix a bug at the same time.
* Document the interaction between ScopedTypeVariables and ↵Ryan Scott2021-03-151-0/+31
| | | | | | | | | StandaloneKindSignatures This documents a limitation of `StandaloneKindSignatures`—namely, that it does not bring type variables bound by an outermost `forall` into scope over a type-level declaration—in the GHC User's Guide. See #19498 for more discussion.
* Compute length only once in foldBalSylvain Henry2021-03-141-4/+11
|
* Write explicit IOEnv's Functor and MonadIO instances (#18202)Sylvain Henry2021-03-141-2/+8
|
* Make traceHeapEventInfo an init eventMatthew Pickering2021-03-141-6/+18
| | | | This means it will be reposted everytime the eventlog is started.
* Pmc: Consider Required Constraints when guessing PatSyn arg types (#19475)Sebastian Graf2021-03-148-130/+236
| | | | | | | | | | | | | | | | | | | | | | This patch makes `guessConLikeUnivTyArgsFromResTy` consider required Thetas of PatSynCons, by treating them as Wanted constraints to be discharged with the constraints from the Nabla's TyState and saying "does not match the match type" if the Wanted constraints are unsoluble. It calls out into a new function `GHC.Tc.Solver.tcCheckWanteds` to do so. In pushing the failure logic around call sites of `initTcDsForSolver` inside it by panicking, I realised that there was a bunch of dead code surrounding `pmTopMoraliseType`: I was successfully able to delete the `NoChange` data constructor of `TopNormaliseTypeResult`. The details are in `Note [Matching against a ConLike result type]` and `Note [Instantiating a ConLike]. The regression test is in `T19475`. It's pretty much a fork of `T14422` at the moment. Co-authored-by: Cale Gibbard <cgibbard@gmail.com>
* Correct module name in `-fprof-callers` documentationMatthew Pickering2021-03-141-1/+1
|
* Implement the UnliftedDatatypes extensionSebastian Graf2021-03-1439-163/+719
| | | | | | | | | | | | | | | | | | GHC Proposal: 0265-unlifted-datatypes.rst Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/265 Issues: https://gitlab.haskell.org/ghc/ghc/-/issues/19523 Implementation Details: Note [Implementation of UnliftedDatatypes] This patch introduces the `UnliftedDatatypes` extension. When this extension is enabled, GHC relaxes the restrictions around what result kinds are allowed in data declarations. This allows data types for which an unlifted or levity-polymorphic result kind is inferred. The most significant changes are in `GHC.Tc.TyCl`, where `Note [Implementation of UnliftedDatatypes]` describes the details of the implementation. Fixes #19523.
* Allow perf-nofib to failwip/angerman/fasterMoritz Angermann2021-03-141-0/+3
|