summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* WIP: experimenting with tweaking canEqNC to use rewrite_shallowwip/amg/T18965Adam Gundry2021-05-101-2/+15
|
* WIP: shallow rewriting (#18965)Adam Gundry2021-05-101-5/+1642
| | | | | | | | | | This is a WIP approach to #18965. The general idea is outlined in the notes in `GHC.Tc.Solver.Rewrite`. The code is very rough and there are various unresolved issues (summarised at the bottom of the file). The approach in this patch is to have (a new, specialised implementation of) matching call the rewriter directly, when it wants to reduce a type family application, rather than always getting stuck.
* Add a test case for awkward type family compatibility casesAdam Gundry2021-04-302-0/+47
|
* Add StepsProv constructor of UnivCoProvenanceAdam Gundry2021-04-1515-1/+40
|
* Add test for #13386Adam Gundry2021-04-152-0/+24
|
* Add test for #8095Adam Gundry2021-04-152-0/+23
|
* Add test for #15703Adam Gundry2021-04-153-0/+291
|
* Fix some negation issues when creating FractionalLitMatthew Pickering2021-04-147-3/+30
| | | | | | | | | | There were two different issues: 1. integralFractionalLit needed to be passed an already negated value. (T19680) 2. negateFractionalLit did not actually negate the argument, only flipped the negation flag. (T19680A) Fixes #19680
* Add isInjectiveTyCon check to opt_univ (fixes #19509)Adam Gundry2021-04-141-0/+18
|
* Prelude: Fix version bound on Bits importPeter Trommler2021-04-141-2/+1
| | | | Fixes #19683
* Data.List strictness optimisations for maximumBy and minimumByHécate Moonlight2021-04-141-14/+21
| | | | follow-up from !4675
* Always generate ModDetails from ModIfaceMatthew Pickering2021-04-1417-234/+116
| | | | | | | | | | | | | | | | | | This vastly reduces memory usage when compiling with `--make` mode, from about 900M when compiling Cabal to about 300M. As a matter of uniformity, it also ensures that reading from an interface performs the same as using the in-memory cache. We can also delete all the horrible knot-tying in updateIdInfos. Goes some way to fixing #13586 Accept new output of tests fixing some bugs along the way ------------------------- Metric Decrease: T12545 -------------------------
* configure: Bump version to 9.3wip/bump-versionBen Gamari2021-04-132-1/+1
| | | | Bumps the `haddock` submodule.
* Add {lifted,unlifted}DataConKey to pretendNameIsInScope's list of NamesRyan Scott2021-04-1311-1/+56
| | | | Fixes #19688.
* Produce constant file atomically (#19684)Sylvain Henry2021-04-132-6/+18
|
* Make the specialiser handle polymorphic specialisationSimon Peyton Jones2021-04-135-50/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ticket #13873 unexpectedly showed that a SPECIALISE pragma made a program run (a lot) slower, because less specialisation took place overall. It turned out that the specialiser was missing opportunities because of quantified type variables. It was quite easy to fix. The story is given in Note [Specialising polymorphic dictionaries] Two other minor fixes in the specialiser * There is no benefit in specialising data constructor /wrappers/. (They can appear overloaded because they are given a dictionary to store in the constructor.) Small guard in canSpecImport. * There was a buglet in the UnspecArg case of specHeader, in the case where there is a dead binder. We need a LitRubbish filler for the specUnfolding stuff. I expanded Note [Drop dead args from specialisations] to explain. There is a 4% increase in compile time for T13056, because we generate more specialised code. This seems OK. Metric Increase: T13056
* hadrian: Provide build rule for ghc-stage3 wrapperStefan Schulze Frielinghaus2021-04-131-0/+1
|
* CI: Also ignore metric decreases on masterMatthew Pickering2021-04-121-0/+8
| | | | | | Otherwise, if the marge batch has decreased metrics, they will fail on master which will result in the pipeline being cut short and the expected metric values for the other jobs will not be updated.
* Turn T11545 into a normal performance testMatthew Pickering2021-04-121-2/+2
| | | | | This makes it more robust to people running it with `quick` flavour and so on.
* Add regression test for T19615Matthew Pickering2021-04-123-0/+24
| | | | Fixes #19615
* template-haskell: Run TH splices with err_vars from current contextMatthew Pickering2021-04-124-1/+21
| | | | | | Otherwise, errors can go missing which arise when running the splices. Fixes #19470
* More accurate SrcSpan when reporting redundant constraintsSimon Peyton Jones2021-04-1219-58/+204
| | | | | | | | | | | | | | | | | | | | | | | | We want an accurate SrcSpan for redundant constraints: • Redundant constraint: Eq a • In the type signature for: f :: forall a. Eq a => a -> () | 5 | f :: Eq a => a -> () | ^^^^ This patch adds some plumbing to achieve this * New data type GHC.Tc.Types.Origin.ReportRedundantConstraints (RRC) * This RRC value is kept inside - FunSigCtxt - ExprSigCtxt * Then, when reporting the error in GHC.Tc.Errors, use this SrcSpan to control the error message: GHC.Tc.Errors.warnRedundantConstraints Quite a lot of files are touched in a boring way.
* Fix magicDict in ghci (and in the presence of other ticks)Matthew Pickering2021-04-109-3/+71
| | | | | | | | | | | The problem was that ghci inserts some ticks around the crucial bit of the expression. Just like in some of the other rules we now strip the ticks so that the rule fires more reliably. It was possible to defeat magicDict by using -fhpc as well, so not just an issue in ghci. Fixes #19667 and related to #19673
* tests: Allow --skip-perf-tests/--only-perf-tests to be used with ↵Matthew Pickering2021-04-101-1/+1
| | | | --ignore-perf-failures
* Use CI_MERGE_REQUEST_SOURCE_BRANCH_NAME rather than undefined ↵Matthew Pickering2021-04-101-1/+3
| | | | | GITLAB_CI_BRANCH env var See https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
* Report actual port in libiserv:Remote.Slave.startSlaveFacundo Domínguez2021-04-101-1/+2
| | | | | | This allows to start iserv by passing port 0 to startSlave, which in turns allows to get an available port when no port is known to be free a priori.
* Add missing relational constant folding for sized numeric typesJohn Ericson2021-04-104-11/+118
|
* Allow C-- to scrutinize non-native-size wordsJohn Ericson2021-04-103-10/+17
|
* Constants: add a note and fix minor doc glitchesSylvain Henry2021-04-104-29/+79
|
* Don't produce platformConstants fileSylvain Henry2021-04-105-25/+0
| | | | It isn't used for anything anymore
* Read constants header instead of global platformConstantsSylvain Henry2021-04-1010-38/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | With this patch we switch from reading the globally installed platformConstants file to reading the DerivedConstants.h header file that is bundled in the RTS unit. When we build the RTS unit itself, we get it from its includes directories. The new parser is more efficient and strict than the Read instance for PlatformConstants and we get about 2.2MB less allocations in every cases. However it only really shows in tests that don't allocate much, hence the following metric decreases. Metric Decrease: Naperian T10421 T10547 T12150 T12234 T12425 T13035 T18304 T18923 T5837 T6048 T18140
* Generate parser for DerivedConstants.hSylvain Henry2021-04-101-31/+89
| | | | | | deriveConstants utility now generates a Haskell parser for DerivedConstants.h. It can be used to replace the one used to read platformConstants file.
* Enhance pretty-printing perfSylvain Henry2021-04-104-58/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few refactorings made after looking at Core/STG * Use Doc instead of SDoc in pprASCII to avoid passing the SDocContext that is never used. * Inline every SDoc wrappers in GHC.Utils.Outputable to expose Doc constructs * Add text/[] rule for empty strings (i.e., text "") * Use a single occurrence of pprGNUSectionHeader * Use bangs on Platform parameters and some others Metric Decrease: ManyAlternatives ManyConstructors T12707 T13035 T13379 T18698a T18698b T1969 T3294 T4801 T5321FD T783
* Implement list `fold` and `foldMap` via mconcatKoz Ross2021-04-106-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This allows specialized mconcat implementations an opportunity to combine elements efficiently in a single pass. - Inline the default implementation of `mconcat`, this may result in list fusion. - In Monoids with strict `mappend`, implement `mconcat` as a strict left fold: * And (FiniteBits) * Ior (FiniteBits) * Xor (FiniteBits) * Iff (FiniteBits) * Max (Ord) * Min (Ord) * Sum (Num) * Product (Num) * (a -> m) (Monoid m) - Delegate mconcat for WrappedMonoid to the underlying monoid. Resolves: #17123 Per the discussion in !4890, we expect some stat changes: * T17123(normal) run/alloc 403143160.0 4954736.0 -98.8% GOOD This is the expected improvement in `fold` for a long list of `Text` elements. * T13056(optasm) ghc/alloc 381013328.0 447700520.0 +17.5% BAD Here there's an extra simplifier run as a result of the new methods of the Foldable instance for List. It looks benign. The test is a micro benchmark that compiles just the derived foldable instances for a pair of structures, a cost of this magnitude is not expected to extend to more realistic programs. * T9198(normal) ghc/alloc 504661992.0 541334168.0 +7.3% BAD This test regressed from 8.10 and 9.0 back to exponential blowup. This metric also fluctuates, for reasons not yet clear. The issue here is the exponetial blowup, not this MR. Metric Decrease: T17123 Metric Increase: T9198 T13056
* Test #19665 as expect_broken, with commentaryRichard Eisenberg2021-04-104-8/+35
|
* Clarify commentary around the constraint solverRichard Eisenberg2021-04-103-32/+104
| | | | | No changes to code; no changes to theory. Just better explanation.
* Kick out fewer equalities by thinking harderRichard Eisenberg2021-04-102-27/+44
| | | | | | | | | | | | | | | | Close #17672. By scratching our heads quite hard, we realized that we should never kick out Given/Nominal equalities. This commit tweaks the kick-out conditions accordingly. See also Note [K4] which describes what is going on. This does not fix a known misbehavior, but it should be a small improvement in both practice (kicking out is bad, and we now do less of it) and theory (a Given/Nominal should behave just like a filled-in metavariable, which has no notion of kicking out).
* Tweak kick-out condition K2b to deal with LHSsRichard Eisenberg2021-04-105-52/+205
| | | | | | | | | | | | | | Kick out condition K2b really only makes sense for inerts with a type variable on the left. This updates the commentary and the code to skip this check for inerts with type families on the left. Also cleans up some commentary around solver invariants and adds Note [K2b]. Close #19042. test case: typecheck/should_compile/T19042
* Bignum: add BigNat Eq/Ord instances (#19647)Sylvain Henry2021-04-091-0/+16
|
* Update HACKING.mdMatthew Pickering2021-04-091-1/+1
|
* [docs] release notes for !4729 + !3678Douglas Wilson2021-04-091-1/+33
| | | | Also includes small unrelated type fix
* Add perf test for #15304Matthew Pickering2021-04-093-0/+778
| | | | | The test max memory usage improves dramatically with the fixes to memory usage in demand analyser from #15455
* Don't tidy type in pprTypeForUserMatthew Pickering2021-04-092-22/+10
| | | | | | | | | | | | | | | | There used to be some cases were kinds were not generalised properly before being printed in GHCi. This seems to have changed in the past so now it's uncessary to tidy before printing out the test case. ``` > :set -XPolyKinds > data A x y > :k A k1 -> k2 -> A ``` This tidying was causing issues with an attempt to increase sharing by making `mkTyConApp` (see !4762)
* Avoid repeated zonking and tidying of types in `relevant_bindings`Matthew Pickering2021-04-091-41/+81
| | | | | | | | | | | The approach taking in this patch is that the tcl_bndrs in TcLclEnv are zonked and tidied eagerly, so that work can be shared across multiple calls to `relevant_bindings`. To test this patch I tried without the `keepThisHole` filter and the test finished quickly. Fixes #14766
* testsuite/ppc64le: Mark UnboxedTuples test brokenPeter Trommler2021-04-091-0/+1
|
* Fix typoPeter Trommler2021-04-091-1/+1
|
* testsuite: Skip T18623 on powerpc64lePeter Trommler2021-04-091-1/+2
| | | | | | | In commit f3c23939 T18623 is disabled for aarch64. The limit seems to be too low for powerpc64le, too. This could be because tables next to code is not supported and our code generator produces larger code on PowerPC.
* Re-export GHC.Bits from GHC.Prelude with custom shift implementation.Andreas Klebinger2021-04-0938-53/+76
| | | | | | | This allows us to use the unsafe shifts in non-debug builds for performance. For older versions of base we instead export Data.Bits See also #19618
* CoreTidy: handle special cases to preserve more sharing.Sylvain Henry2021-04-091-1/+2
| | | | | Metric Decrease: T16577
* CoreTidy: enhance strictness noteBen Gamari2021-04-091-5/+15
|