- 06 Jun, 2013 9 commits
-
-
Simon Peyton Jones authored
If either side diverges, both do!
-
Simon Peyton Jones authored
See Note [Trivial right-hand sides]
-
Simon Peyton Jones authored
We now look inside one layer of recursive types, thanks to checkRecTc. It does mean we need an additional environment field, ae_rec_tc. I also commented out the apparently over-conservative test at coercions. I'm not 100% sure I'm right here, but I can't see why the simpler code will go wrong, so I'm going to suck it and see.
-
Simon Peyton Jones authored
-
Simon Peyton Jones authored
This just formalises an abstraction we've been using anyway, namely to expand "recursive" TyCons until we see them twice. We weren't doing this in typeArity, and that inconsistency was leading to a subsequent ASSERT failure, when compiling Stream.hs, which has a newtype like this newtype Stream m a b = Stream (m (Either b (a, Stream m a b)))
-
Simon Peyton Jones authored
-
Simon Peyton Jones authored
-
Simon Peyton Jones authored
This major patch implements the cardinality analysis described in our paper "Higher order cardinality analysis". It is joint work with Ilya Sergey and Dimitrios Vytiniotis. The basic is augment the absence-analysis part of the demand analyser so that it can tell when something is used never at most once some other way The "at most once" information is used a) to enable transformations, and in particular to identify one-shot lambdas b) to allow updates on thunks to be omitted. There are two new flags, mainly there so you can do performance comparisons: -fkill-absence stops GHC doing absence analysis at all -fkill-one-shot stops GHC spotting one-shot lambdas and single-entry thunks The big changes are: * The Demand type is substantially refactored. In particular the UseDmd is factored as follows data UseDmd = UCall Count UseDmd | UProd [MaybeUsed] | UHead | Used data MaybeUsed = Abs | Use Count UseDmd data Count = One | Many Notice that UCall recurses straight to UseDmd, whereas UProd goes via MaybeUsed. The "Count" embodies the "at most once" or "many" idea. * The demand analyser itself was refactored a lot * The previously ad-hoc stuff in the occurrence analyser for foldr and build goes away entirely. Before if we had build (\cn -> ...x... ) then the "\cn" was hackily made one-shot (by spotting 'build' as special. That's essential to allow x to be inlined. Now the occurrence analyser propagates info gotten from 'build's stricness signature (so build isn't special); and that strictness sig is in turn derived entirely automatically. Much nicer! * The ticky stuff is improved to count single-entry thunks separately. One shortcoming is that there is no DEBUG way to spot if an allegedly-single-entry thunk is acually entered more than once. It would not be hard to generate a bit of code to check for this, and it would be reassuring. But it's fiddly and I have not done it. Despite all this fuss, the performance numbers are rather under-whelming. See the paper for more discussion. nucleic2 -0.8% -10.9% 0.10 0.10 +0.0% sphere -0.7% -1.5% 0.08 0.08 +0.0% -------------------------------------------------------------------------------- Min -4.7% -10.9% -9.3% -9.3% -50.0% Max -0.4% +0.5% +2.2% +2.3% +7.4% Geometric Mean -0.8% -0.2% -1.3% -1.3% -1.8% I don't quite know how much credence to place in the runtime changes, but movement seems generally in the right direction.
-
Simon Peyton Jones authored
-
- 05 Jun, 2013 2 commits
-
-
Krzysztof Gogolewski authored
-
Simon Peyton Jones authored
-
- 04 Jun, 2013 6 commits
-
-
ian@well-typed.com authored
-
-
ian@well-typed.com authored
-
-
-
- Remove unused property `def_prompt`.
-
- 03 Jun, 2013 4 commits
-
-
gmainlan@microsoft.com authored
-
gmainlan@microsoft.com authored
-
gmainlan@microsoft.com authored
-
gmainlan@microsoft.com authored
-
- 02 Jun, 2013 1 commit
-
-
ian@well-typed.com authored
Make expands things even in comments
-
- 01 Jun, 2013 1 commit
-
-
ian@well-typed.com authored
-
- 31 May, 2013 2 commits
-
-
Iavor S. Diatchki authored
-
gmainlan@microsoft.com authored
The LLVM back end does not yet work when building dynamically.
-
- 30 May, 2013 15 commits
-
-
This patch disables shared libs support on arm-unknown-linux platform. It unbreaks ghc-stage2 on this platform after recent Ian's changes in dynamic/shared libs domain. The reason why ghc-stage2 fails when linked with shared libs is still unknown so this is just a workaround at the moment, but it at least recovers previous "correct" behavior of ghc-stage2 on ARM/Linux
-
-
Simon Peyton Jones authored
where the invariant didn't hold, leading to subsequent chaos. Happily an ASSERT caught it.
-
Simon Peyton Jones authored
Somtimes we need (xs ++ ys) in situations where ys is almost always empty. Utils.chkAppend checks for that case first.
-
-
ian@well-typed.com authored
Should help to track down cache-out-of-date problems
-
ian@well-typed.com authored
-
Iavor S. Diatchki authored
The details of this are described in Note [magicSingIId magic] in basicTypes/MkId.lhs
-
ian@well-typed.com authored
-
Simon Peyton Jones authored
-
Simon Peyton Jones authored
This long-overdue fix arranges to eta-reduce the axiom for a data/newtype instance in the same way that we have longq eta-reduced the axiom for a newtype. See Note [Eta reduction for data family axioms] in TcInstDcls and Note [Deriving, type families, and partial applications] in TcDeriv.
-
Simon Peyton Jones authored
Fixes Trac #7809
-
Simon Peyton Jones authored
Finally (I hope) fixes Trac #7903. See Note [Zonking inside the knot] in TcHsSyn
-
Simon Peyton Jones authored
See Note [Type determines value] in Specialise.
-
Simon Peyton Jones authored
This is a long-standing regression (Trac #7797), which meant that in particular the Eq [Char] instance does not get specialised. (The *methods* do, but the dictionary itself doesn't.) So when you call a function f :: Eq a => blah on a string type (ie a=[Char]), 7.6 passes a dictionary of un-specialised methods. This only matters when calling an overloaded function from a specialised context, but that does matter in some programs. I remember (though I cannot find the details) that Nick Frisby discovered this to be the source of some pretty solid performanc regresisons. Anyway it works now. The key change is that a DFunUnfolding now takes a form that is both simpler than before (the DFunArg type is eliminated) and more general: data Unfolding = ... | DFunUnfolding { -- The Unfolding of a DFunId -- See Note [DFun unfoldings] -- df = /\a1..am. \d1..dn. MkD t1 .. tk -- (op1 a1..am d1..dn) -- (op2 a1..am d1..dn) df_bndrs :: [Var], -- The bound variables [a1..m],[d1..dn] df_con :: DataCon, -- The dictionary data constructor (never a newtype datacon) df_args :: [CoreExpr] -- Args of the data con: types, superclasses and methods, } -- in positional order That in turn allowed me to re-enable the DFunUnfolding specialisation in DsBinds. Lots of details here in TcInstDcls: Note [SPECIALISE instance pragmas] I also did some refactoring, in particular to pass the InScopeSet to exprIsConApp_maybe (which in turn means it has to go to a RuleFun). NB: Interface file format has changed!
-