summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Set $1_$2_SplitSections in distdir-opts.mk not build-package.mkReid Barton2017-02-232-19/+19
| | | | | | | | | | | | | | | | | | | | | | | After commit a50082c11 we use -ffunction-sections -fdata-sections for all C compilations, when $1_$2_SplitSections is set. But that variable was set in build-package.mk which is not run for the RTS. As a result the RTS was not being split, leading to larger binaries. This commit fixes RTS splitting by moving the definition of $1_$2_SplitSections to distdir-opts.mk, which is run for the RTS (and also from build-package.mk). Test Plan: manual ./validate and check that RTS and base .c files are split, but not object files in the compiler Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, snowleopard, olsner Differential Revision: https://phabricator.haskell.org/D3137
* JSON profiler reportsBen Gamari2017-02-239-27/+200
| | | | | | | | | | | | | | | | | | | This introduces a JSON output format for cost-centre profiler reports. It's not clear whether this is really something we want to introduce given that we may also move to a more Haskell-driven output pipeline in the future, but I nevertheless found this helpful, so I thought I would put it up. Test Plan: Compile a program with `-prof -fprof-auto`; run with `+RTS -pj` Reviewers: austin, erikd, simonmar Reviewed By: simonmar Subscribers: duncan, maoe, thomie, simonmar Differential Revision: https://phabricator.haskell.org/D3132
* Have --backpack complain if multiple files are passed.Edward Z. Yang2017-02-232-8/+11
| | | | | | | | | | | | | | | Summary: At the moment it silently swallows the actual arguments; not good! Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: rwbarton, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3173
* Give better error message with you run ghc foo.bkpEdward Z. Yang2017-02-232-3/+12
| | | | | | | | | | | | | | | | Summary: Detect Backpackish suffixes, and bail out if we try to run them in the pipeline. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: rwbarton, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3172
* testsuite: Bump a performance testsBen Gamari2017-02-231-32/+35
| | | | | | | T5321Fun, T3064, and T12707 are failing, but only on Darwin. I suspect this is probably creep from Typeable and pushed over the edge by some of Simon's recent commits. Unfortunately the tree brokenness due to the recent submodule bumps makes it difficult to pin down.
* Spelling only [ci skip]Gabor Greif2017-02-2315-16/+16
|
* Export commentToAnnotation from Lexer.xAlan Zimmerman2017-02-231-0/+1
|
* Drop NFData constraint from compact.Edward Z. Yang2017-02-2211-62/+31
| | | | | | | | | | | | | | | | | | | | | Summary: It's both unsound (easy to write a bogus NFData instance) and incomplete (you might want to serialize data that doesn't have an NFData instance, and will be fine at runtime.) So better just to drop it. (By the way, we used to need the NFData instance to "pre-evaluate" the data before we copied it into the region, but since Simon Marlow rewrote the code to directly evaluate and copy, this is no longer necessary.) Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, austin, dfeuer, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3168
* Changelog notice for compact.Edward Z. Yang2017-02-221-0/+10
| | | | | | | | | | Test Plan: none Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3165
* Revert recent submodule bumpsBen Gamari2017-02-2213-16/+14
| | | | | | | | They broke everything and the solution will be non-trivial. This reverts commit 8ccbc2e5252abd4fa67d155d4fff489ee9929906. This reverts commit c8d995db5d743358b0583fe97f8113bf9047641e. This reverts commit 7153370288e6075c4f8c996ff02227e48805da06.
* Bump time submoduleBen Gamari2017-02-221-0/+0
| | | | | | | | | My previous attempt at bumping `time` was confused by a non-fast-forward update from upstream. Here we merge the orphaned commit back into master, fixing mirroring. Also, we will now follow upstream's `ghc` branch instead of `master` to prevent this sort of thing happening again in the future.
* A much nicer solution for typechecking ApplicativeDoSimon Peyton Jones2017-02-221-35/+32
| | | | | | | | | | | This patch improves the code for TcMatches.tcApplicativeStmts; see the suggestion in Trac #13242 comment:9. I now use (mapM goArg args) rather than a CPS-style fold. The result is less code, easier to understand, and automatically fixes the original problem in Trac #13242. See Note [ApplicativeDo and constraints].
* Test Trac #13244Simon Peyton Jones2017-02-222-0/+35
|
* Fix ApplicativeDo constraint scopingSimon Peyton Jones2017-02-223-22/+70
| | | | | | | | This patch fixes Trac #13242, by a bit of fancy footwork with the LIE variable in which the WantedConstraints are collected. I think it can be simplified further, using a 'map'.
* Test Trac #13271Simon Peyton Jones2017-02-223-0/+18
|
* Bump Cabal and containers submodulesBen Gamari2017-02-219-12/+14
|
* Fix all broken perf tests on x64 WindowsTamar Christina2017-02-215-6/+29
| | | | | | | | | | | | | various perf tests have been broken over the course of the past few months. This updates the numbers. Test Plan: ./validate Reviewers: austin, bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D3160
* Test Trac #13300Simon Peyton Jones2017-02-213-0/+17
|
* Gather constraints locally in checkMainSimon Peyton Jones2017-02-215-7/+45
| | | | | | | | Wiwth -fdefer-type-errors we were generating some top-level equality constraints, just in a corner of checkMain. The fix is easy. Fixes Trac #13292
* Disallow class instances for synonymsSimon Peyton Jones2017-02-214-6/+60
| | | | | | | | See Trac #13267 and Note [Instances and constraint synonyms] in TcValidity. We can't easily do a perfect job, because the rename is really trying to do its lookup too early. But this is at least an improvement.
* A bit more tc-tracing in TcTyClsDeclsSimon Peyton Jones2017-02-211-0/+2
|
* Remove panics for TcTyConSimon Peyton Jones2017-02-212-50/+57
| | | | | | | | | | | | | Previously TcTyCons were used only for knot-tying, but now they are also used after an error, to add a benign TyCon to the envt so we can carry on; see TyCon.makeRecoveryTyCon. But since it is used in this way, subsequent declarations may see a TcTyCon (e.g. during injectivity checks) and should not have a heart attack as a result. See Note [TcTyCon] in TyCon. This fixes Trac #13271
* A little refactoring of the simplifier around join pointsSimon Peyton Jones2017-02-212-38/+45
| | | | | | | | | | * Rename SimplEnv.setInScope to setInScopeAndZapFloats, because I keep forgetting that's what it does * Remove unnecessary (and hence confusing) zapJoinFloats from simplLazyBind * Reorder args of simplJoinRhs to put the cont last
* Replace some pushTcLevelM's with pushTcLevelM_Ryan Scott2017-02-211-3/+3
| | | | | | | These occurrences of pushTcLevelM weren't using the resulting TcLevel, so they can be replaced with the (ostensibly more efficient) pushTcLevelM_. No change in behavior.
* Minor spelling, grammar, and formatting fixesRyan Scott2017-02-211-6/+7
| | | | [ci skip]
* Fix SetLevels for join pointsSimon Peyton Jones2017-02-211-18/+14
| | | | | | | | | | This fixes Trac #13255. The trouble was that we had a bottoming join point, and tried to float it to top level. But it had free JoinIds, so we tried to abstract over them. Disaster. Lint should have caught it, but didn't (now fixed). This patch fixes the original problem.
* Improve Core Lint, mainly for join pointsSimon Peyton Jones2017-02-211-38/+69
| | | | | | | | | | | | | | | * lintSingleBinding: check that join points have a valid join-point type (Trac #13281) * lintIdBinder: check that a JoinId is bound by a non-top-level let i.e. not a top level binder not lambda/case binder * Check for empty Rec [] bindings * Rename lintIdBndrs to lintLetBndrs
* testsuite: Fix allocations of T10547Ben Gamari2017-02-211-1/+1
| | | | | Previously the comment was correct, but the expected value itself was never updated.
* Refactor inferConstraints not to use CPSSimon Peyton Jones2017-02-212-22/+21
| | | | | | | For some odd reason inferConstraints was using a CPS style, which is entirely unnecessary. This patch straightens it out. No change in what it does.
* Fix computation of dfun_tvs in mkNewTypeEqnSimon Peyton Jones2017-02-213-4/+13
| | | | | | | | This bug was causing Trac #13297. We were recomputing ds_tvs, and doing it wrongly (by omitting variables that appear only in mtheta). But actually plain 'tvs' is just fine. So code deleted, and bug fixed.
* Fix DeriveAnyClass (again)Simon Peyton Jones2017-02-214-118/+172
| | | | | | | | | | | This patch fixes Trac #13272. The general approach was fine, but we were simply not generating the correct implication constraint (in particular generating fresh unification variables). I added a lot more commentary to Note [Gathering and simplifying constraints for DeriveAnyClass] I'm still not very happy with the overall architecture. It feels more complicate than it should.
* Spelling in comments onlySimon Peyton Jones2017-02-211-1/+1
|
* build.mk: Add option for debug symbolsBen Gamari2017-02-201-0/+7
|
* Bump time submodule to 1.8Ben Gamari2017-02-207-2/+2
| | | | | This unfortunately had quite a number of knock-on effects, including a need for new releases of directory and unix.
* Bump Win32 submodule to 2.5.1.0Ben Gamari2017-02-201-0/+0
|
* Bump a few more performance regressions from Type-indexed TypeableBen Gamari2017-02-201-2/+4
| | | | | These are right on the edge of acceptance and are only reproducible on a stressed machine.
* Bump Cabal submoduleBen Gamari2017-02-2010-16/+18
| | | | We are now tracking the 2.0 branch.
* A number of Typeable wibbles from reviewBen Gamari2017-02-204-13/+11
| | | | I forgot to fold these in to the patch merged earlier.
* Remove redundant importSimon Peyton Jones2017-02-201-1/+0
|
* Fix Core pretty printerSimon Peyton Jones2017-02-201-2/+3
| | | | | | | | | If a JoinId (bogusly) ends up in an argument position we printed f jump j rather than f (jump j) Easy to fix.
* Kill off the remaining Rec []Simon Peyton Jones2017-02-203-34/+39
| | | | | | | The desugarer was producing an empty Rec group, which is never supposed to happen. This small patch stops that happening. Next up: Lint should check.
* Change -dppr-ticks to -dsuppress-ticksSimon Peyton Jones2017-02-206-18/+21
| | | | | | | | | | | | | | | | I spent about two hours today hunting fruitlessly for a simplifier bug (when fixing Trac #13255), only to find that it was caused by -ddump-X silently suppressing all ticks in Core. I think this has happened to me once before. So I've changed to make tick-printing on by default (like coercions, etc), with a flag -dsuppress-ticks (like -dsuppress-coercions) to suppress them. Blargh. -dppr-ticks is still there, but deprecated.
* Typos in manual, tests and commentsGabor Greif2017-02-2012-13/+13
|
* Remove ghc-api/landmine testsAlan Zimmerman2017-02-199-206/+0
| | | | | They take a long time to run, and are effectively superseded by the -ddump-*-ast tests.
* Improve Haddock documentation for compact.Edward Z. Yang2017-02-183-35/+110
| | | | | | | | | | Test Plan: none Reviewers: simonmar, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3148
* Disable Typeable binding generation for unboxed sumsBen Gamari2017-02-184-10/+14
| | | | | These things are simply too expensive to generate at the moment. More work is needed here; see #13276 and #13261.
* Type-indexed TypeableBen Gamari2017-02-1879-1026/+3111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This at long last realizes the ideas for type-indexed Typeable discussed in A Reflection on Types (#11011). The general sketch of the project is described on the Wiki (Typeable/BenGamari). The general idea is that we are adding a type index to `TypeRep`, data TypeRep (a :: k) This index allows the typechecker to reason about the type represented by the `TypeRep`. This index representation mechanism is exposed as `Type.Reflection`, which also provides a number of patterns for inspecting `TypeRep`s, ```lang=haskell pattern TRFun :: forall k (fun :: k). () => forall (r1 :: RuntimeRep) (r2 :: RuntimeRep) (arg :: TYPE r1) (res :: TYPE r2). (k ~ Type, fun ~~ (arg -> res)) => TypeRep arg -> TypeRep res -> TypeRep fun pattern TRApp :: forall k2 (t :: k2). () => forall k1 (a :: k1 -> k2) (b :: k1). (t ~ a b) => TypeRep a -> TypeRep b -> TypeRep t -- | Pattern match on a type constructor. pattern TRCon :: forall k (a :: k). TyCon -> TypeRep a -- | Pattern match on a type constructor including its instantiated kind -- variables. pattern TRCon' :: forall k (a :: k). TyCon -> [SomeTypeRep] -> TypeRep a ``` In addition, we give the user access to the kind of a `TypeRep` (#10343), typeRepKind :: TypeRep (a :: k) -> TypeRep k Moreover, all of this plays nicely with 8.2's levity polymorphism, including the newly levity polymorphic (->) type constructor. Library changes --------------- The primary change here is the introduction of a Type.Reflection module to base. This module provides access to the new type-indexed TypeRep introduced in this patch. We also continue to provide the unindexed Data.Typeable interface, which is simply a type synonym for the existentially quantified SomeTypeRep, data SomeTypeRep where SomeTypeRep :: TypeRep a -> SomeTypeRep Naturally, this change also touched Data.Dynamic, which can now export the Dynamic data constructor. Moreover, I removed a blanket reexport of Data.Typeable from Data.Dynamic (which itself doesn't even import Data.Typeable now). We also add a kind heterogeneous type equality type, (:~~:), to Data.Type.Equality. Implementation -------------- The implementation strategy is described in Note [Grand plan for Typeable] in TcTypeable. None of it was difficult, but it did exercise a number of parts of the new levity polymorphism story which had not yet been exercised, which took some sorting out. The rough idea is that we augment the TyCon produced for each type constructor with information about the constructor's kind (which we call a KindRep). This allows us to reconstruct the monomorphic result kind of an particular instantiation of a type constructor given its kind arguments. Unfortunately all of this takes a fair amount of work to generate and send through the compilation pipeline. In particular, the KindReps can unfortunately get quite large. Moreover, the simplifier will float out various pieces of them, resulting in numerous top-level bindings. Consequently we mark the KindRep bindings as noinline, ensuring that the float-outs don't make it into the interface file. This is important since there is generally little benefit to inlining KindReps and they would otherwise strongly affect compiler performance. Performance ----------- Initially I was hoping to also clear up the remaining holes in Typeable's coverage by adding support for both unboxed tuples (#12409) and unboxed sums (#13276). While the former was fairly straightforward, the latter ended up being quite difficult: while the implementation can support them easily, enabling this support causes thousands of Typeable bindings to be emitted to the GHC.Types as each arity-N sum tycon brings with it N promoted datacons, each of which has a KindRep whose size which itself scales with N. Doing this was simply too expensive to be practical; consequently I've disabled support for the time being. Even after disabling sums this change regresses compiler performance far more than I would like. In particular there are several testcases in the testsuite which consist mostly of types which regress by over 30% in compiler allocations. These include (considering the "bytes allocated" metric), * T1969: +10% * T10858: +23% * T3294: +19% * T5631: +41% * T6048: +23% * T9675: +20% * T9872a: +5.2% * T9872d: +12% * T9233: +10% * T10370: +34% * T12425: +30% * T12234: +16% * 13035: +17% * T4029: +6.1% I've spent quite some time chasing down the source of this regression and while I was able to make som improvements, I think this approach of generating Typeable bindings at time of type definition is doomed to give us unnecessarily large compile-time overhead. In the future I think we should consider moving some of all of the Typeable binding generation logic back to the solver (where it was prior to 91c6b1f54aea658b0056caec45655475897f1972). I've opened #13261 documenting this proposal.
* Generalize kind of the (->) tyconBen Gamari2017-02-1831-115/+480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is generalizes the kind of `(->)`, as discussed in #11714. This involves a few things, * Generalizing the kind of `funTyCon`, adding two new `RuntimeRep` binders, ```lang=haskell (->) :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep) (a :: TYPE r1) (b :: TYPE r2). a -> b -> * ``` * Unsaturated applications of `(->)` are expressed as explicit `TyConApp`s * Saturated applications of `(->)` are expressed as `FunTy` as they are currently * Saturated applications of `(->)` are expressed by a new `FunCo` constructor in coercions * `splitTyConApp` needs to ensure that `FunTy`s are split to a `TyConApp` of `(->)` with the appropriate `RuntimeRep` arguments * Teach CoreLint to check that all saturated applications of `(->)` are represented with `FunTy` At the moment I assume that `Constraint ~ *`, which is an annoying source of complexity. This will be simplified once D3023 is resolved. Also, this introduces two known regressions, `tcfail181`, `T10403` ===================== Only shows the instance, instance Monad ((->) r) -- Defined in ‘GHC.Base’ in its error message when -fprint-potential-instances is used. This is because its instance head now mentions 'LiftedRep which is not in scope. I'm not entirely sure of the right way to fix this so I'm just accepting the new output for now. T5963 (Typeable) ================ T5963 is now broken since Data.Typeable.Internals.mkFunTy computes its fingerprint without the RuntimeRep variables that (->) expects. This will be fixed with the merge of D2010. Haddock performance =================== The `haddock.base` and `haddock.Cabal` tests regress in allocations by about 20%. This certainly hurts, but it's also not entirely unexpected: the size of every function type grows with this patch and Haddock has a lot of functions in its heap.
* Bump nofib submoduleBen Gamari2017-02-181-0/+0
|
* Bump libraries/array submoduleBen Gamari2017-02-181-0/+0
|