| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: none
Reviewers: bgamari, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3165
|
|
|
|
|
|
|
|
| |
They broke everything and the solution will be non-trivial.
This reverts commit 8ccbc2e5252abd4fa67d155d4fff489ee9929906.
This reverts commit c8d995db5d743358b0583fe97f8113bf9047641e.
This reverts commit 7153370288e6075c4f8c996ff02227e48805da06.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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].
|
| |
|
|
|
|
|
|
|
|
| |
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'.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
[ci skip]
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
| |
Previously the comment was correct, but the expected value itself was never
updated.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
This unfortunately had quite a number of knock-on effects, including a need for
new releases of directory and unix.
|
| |
|
|
|
|
|
| |
These are right on the edge of acceptance and are only reproducible on a
stressed machine.
|
|
|
|
| |
We are now tracking the 2.0 branch.
|
|
|
|
| |
I forgot to fold these in to the patch merged earlier.
|
| |
|
|
|
|
|
|
|
|
|
| |
If a JoinId (bogusly) ends up in an argument position we printed
f jump j
rather than
f (jump j)
Easy to fix.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
They take a long time to run, and are effectively superseded by the -ddump-*-ast
tests.
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: none
Reviewers: simonmar, bgamari, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3148
|
|
|
|
|
| |
These things are simply too expensive to generate at the moment. More
work is needed here; see #13276 and #13261.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|