- 01 Oct, 2013 1 commit
-
-
Simon Marlow authored
-
- 23 Sep, 2013 1 commit
-
-
Krzysztof Gogolewski authored
-
- 02 Sep, 2013 1 commit
-
-
Simon Peyton Jones authored
Part of Nick Frisby's patch (c080f727) for late demand-analysis removed the over-zealous short-cut whereby strictness wrappers were not spelled out in detail in interface files. This patch completes the process by * removing InlineWrapper from UnfoldingSource * removing IfWrapper from IfaceUnfolding There was a tiny bit of special ad-hocery for wrappers, in OccurAnal, but fortunately that too turns out to be rendered irrelevant by the more uniform treatment, and after that there was no need to remember which functions are wrappers.
-
- 29 Aug, 2013 1 commit
-
-
nfrisby authored
cf http://ghc.haskell.org/trac/ghc/wiki/LateDmd
-
- 30 May, 2013 1 commit
-
-
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!
-
- 28 Jan, 2013 1 commit
-
-
Simon Peyton Jones authored
-
- 24 Jan, 2013 1 commit
-
-
Simon Peyton Jones authored
The main payload of this patch is to extend CPR so that it detects when a function always returns a result constructed with the *same* constructor, even if the constructor comes from a sum type. This doesn't matter very often, but it does improve some things (results below). Binary sizes increase a little bit, I think because there are more wrappers. This with -split-objs. Without split-ojbs binary sizes increased by 6% even for HelloWorld.hs. It's hard to see exactly why, but I think it was because System.Posix.Types.o got included in the linked binary, whereas it didn't before. Program Size Allocs Runtime Elapsed TotalMem fluid +1.8% -0.3% 0.01 0.01 +0.0% tak +2.2% -0.2% 0.02 0.02 +0.0% ansi +1.7% -0.3% 0.00 0.00 +0.0% cacheprof +1.6% -0.3% +0.6% +0.5% +1.4% parstof +1.4% -4.4% 0.00 0.00 +0.0% reptile +2.0% +0.3% 0.02 0.02 +0.0% ---------------------------------------------------------------------- Min +1.1% -4.4% -4.7% -4.7% -15.0% Max +2.3% +0.3% +8.3% +9.4% +50.0% Geometric Mean +1.9% -0.1% +0.6% +0.7% +0.3% Other things in this commit ~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Got rid of the Lattice class in Demand * Refactored the way that products and newtypes are decomposed (no change in functionality)
-
- 05 Dec, 2012 1 commit
-
-
chak@cse.unsw.edu.au. authored
* Vectorisation avoidance is now the default * Types and values from unvectorised modules are permitted in scalar code * Simplified the VECTORISE pragmas (see http://hackage.haskell.org/trac/ghc/wiki/DataParallel/VectPragma for the spec) * Vectorisation information is now included in the annotated Core AST
-
- 01 Dec, 2012 1 commit
-
-
eir@cis.upenn.edu authored
As per a request from Simon PJ, I wrote up a formalism of the core language in GHC, System FC. The writeup lives in docs/core-spec. I also added comments to a number of files dealing with the core language reminding authors to update the formalism when updating the code. In the next commit will be a README file in docs/core-spec with more details of how to do this.
-
- 16 Nov, 2012 1 commit
-
-
Gabor Greif authored
-
- 17 Sep, 2012 2 commits
-
-
ian@well-typed.com authored
-
ian@well-typed.com authored
-
- 28 Aug, 2012 1 commit
-
-
Simon Peyton Jones authored
-
- 15 Aug, 2012 1 commit
-
-
Simon Peyton Jones authored
-
- 27 Jun, 2012 1 commit
-
-
Simon Peyton Jones authored
Silent superclass parameters solve the problem that the superclasses of a dicionary construction can easily turn out to be (wrongly) bottom. The problem and solution are described in Note [Silent superclass arguments] in TcInstDcls I first implemented this fix (with Dimitrios) in Dec 2010, but removed it again in Jun 2011 becuase we thought it wasn't necessary any more. (The reason we thought it wasn't necessary is that we'd stopped generating derived superclass constraints for *wanteds*. But we were wrong; that didn't solve the superclass-loop problem.) So we have to re-implement it. It's not hard. Main features: * The IdDetails for a DFunId says how many silent arguments it has * A DFunUnfolding describes which dictionary args are just parameters (DFunLamArg) and which are a function to apply to the parameters (DFunPolyArg). This adds the DFunArg type to CoreSyn * Consequential changes to IfaceSyn. (Binary hi file format changes slightly.) * TcInstDcls changes to generate the right dfuns * CoreSubst.exprIsConApp_maybe handles the new DFunUnfolding The thing taht is *not* done yet is to alter the vectoriser to pass the relevant extra argument when building a PA dictionary.
-
- 12 Jun, 2012 1 commit
-
-
Ian Lynagh authored
-
- 06 Jun, 2012 1 commit
-
-
Ian Lynagh authored
This will let us get at the types of the Id, which in particular means that for a rule for intToInteger :: Int# -> Integer we can get the "Integer" type, which we can use to build an Integer literal.
-
- 09 May, 2012 1 commit
-
-
Simon Peyton Jones authored
When inlining, we are making a copy of the expression, so we have to be careful about duplicating work. Previously we were using exprIsCheap for that, but it is willing to duplicate a cheap primop -- and that is terribly bad if it happens inside some inner array loop (Trac #5623). So now we use a new function exprIsWorkFree. Even then there is some wiggle room: see Note [exprIsWorkFree] in CoreUtils This commit does make wheel-sieve1 allocate a lot more, but we decided that's just tough; it's more important for inlining to be robust about not duplicating work.
-
- 02 May, 2012 1 commit
-
-
Simon Peyton Jones authored
This patch allows, for the first time, case expressions with an empty list of alternatives. Max suggested the idea, and Trac #6067 showed that it is really quite important. So I've implemented the idea, fixing #6067. Main changes * See Note [Empty case alternatives] in CoreSyn * Various foldr1's become foldrs * IfaceCase does not record the type of the alternatives. I added IfaceECase for empty-alternative cases. * Core Lint does not complain about empty cases * MkCore.castBottomExpr constructs an empty-alternative case expression (case e of ty {}) * CoreToStg converts '(case e of {})' to just 'e'
-
- 21 Mar, 2012 1 commit
-
-
batterseapower authored
Makes the following changes: 1. Generalises the type signatures of some functions relating to alternatives so that the type of "variables" and "expression" is not specified 2. Puts the bulk of the alternative-filtering code into a new function filterAlts (in CoreUtils) that can be used outside of the SimplM monad 3. Allows prepareAlts to return a null alternatives list if none are applicable - it turns out that this case was already handled by the caller (in the simplifier). This should result in a modest optimisation improvement in some cases. Conflicts: compiler/coreSyn/CoreUtils.lhs compiler/simplCore/SimplUtils.lhs
-
- 12 Jan, 2012 1 commit
-
-
Simon Peyton Jones authored
-
- 11 Jan, 2012 1 commit
-
-
Ian Lynagh authored
-
- 03 Jan, 2012 1 commit
-
-
Simon Peyton Jones authored
This patch should have no user-visible effect. It implements a significant internal refactoring of the way that FC axioms are handled. The ultimate goal is to put us in a position to implement "pattern-matching axioms". But the changes here are only does refactoring; there is no change in functionality. Specifically: * We now treat data/type family instance declarations very, very similarly to types class instance declarations: - Renamed InstEnv.Instance as InstEnv.ClsInst, for symmetry with FamInstEnv.FamInst. This change does affect the GHC API, but for the better I think. - Previously, each family type/data instance declaration gave rise to a *TyCon*; typechecking a type/data instance decl produced that TyCon. Now, each type/data instance gives rise to a *FamInst*, by direct analogy with each class instance declaration giving rise to a ClsInst. - Just as each ClsInst contains its evidence, a DFunId, so each FamInst contains its evidence, a CoAxiom. See Note [FamInsts and CoAxioms] in FamInstEnv. The CoAxiom is a System-FC thing, and can relate any two types, whereas the FamInst relates directly to the Haskell source language construct, and always has a function (F tys) on the LHS. - Just as a DFunId has its own declaration in an interface file, so now do CoAxioms (see IfaceSyn.IfaceAxiom). These changes give rise to almost all the refactoring. * We used to have a hack whereby a type family instance produced a dummy type synonym, thus type instance F Int = Bool -> Bool translated to axiom FInt :: F Int ~ R:FInt type R:FInt = Bool -> Bool This was always a hack, and now it's gone. Instead the type instance declaration produces a FamInst, whose axiom has kind axiom FInt :: F Int ~ Bool -> Bool just as you'd expect. * Newtypes are done just as before; they generate a CoAxiom. These CoAxioms are "implicit" (do not generate an IfaceAxiom declaration), unlike the ones coming from family instance declarations. See Note [Implicit axioms] in TyCon On the whole the code gets significantly nicer. There were consequential tidy-ups in the vectoriser, but I think I got them right.
-
- 19 Dec, 2011 1 commit
-
-
Simon Peyton Jones authored
We already have a class OutputableBndr; this patch adds methods pprInfixOcc and pprPrefixOcc, so that we can get rid of the hideous hack (the old) Outputable.pprHsVar. The hack was exposed by Trac #5657, which is thereby fixed.
-
- 02 Dec, 2011 1 commit
-
-
Simon Marlow authored
-
- 25 Nov, 2011 1 commit
-
-
chak@cse.unsw.edu.au. authored
* Correct usage of new type wrappers from MkId * 'VECTORISE [SCALAR] type T = S' didn't work correctly across module boundaries * Clean up 'VECTORISE SCALAR instance'
-
- 22 Nov, 2011 1 commit
-
-
Michal Terepeta authored
-
- 09 Nov, 2011 1 commit
-
-
Simon Peyton Jones authored
...and make sure it is, esp in the call to findAlt in the mighty Simplifier. Failing to check this led to searching a bunch of DataAlts for a LitAlt Integer. Naughty. See Trac #5603 for a case in point.
-
- 04 Nov, 2011 1 commit
-
-
Ian Lynagh authored
We only use it for "compiler" sources, i.e. not for libraries. Many modules have a -fno-warn-tabs kludge for now.
-
- 02 Nov, 2011 1 commit
-
-
Simon Marlow authored
User visible changes ==================== Profilng -------- Flags renamed (the old ones are still accepted for now): OLD NEW --------- ------------ -auto-all -fprof-auto -auto -fprof-exported -caf-all -fprof-cafs New flags: -fprof-auto Annotates all bindings (not just top-level ones) with SCCs -fprof-top Annotates just top-level bindings with SCCs -fprof-exported Annotates just exported bindings with SCCs -fprof-no-count-entries Do not maintain entry counts when profiling (can make profiled code go faster; useful with heap profiling where entry counts are not used) Cost-centre stacks have a new semantics, which should in most cases result in more useful and intuitive profiles. If you find this not to be the case, please let me know. This is the area where I have been experimenting most, and the current solution is probably not the final version, however it does address all the outstanding bugs and seems to be better than GHC 7.2. Stack traces ------------ +RTS -xc now gives more information. If the exception originates from a CAF (as is common, because GHC tends to lift exceptions out to the top-level), then the RTS walks up the stack and reports the stack in the enclosing update frame(s). Result: +RTS -xc is much more useful now - but you still have to compile for profiling to get it. I've played around a little with adding 'head []' to GHC itself, and +RTS -xc does pinpoint the problem quite accurately. I plan to add more facilities for stack tracing (e.g. in GHCi) in the future. Coverage (HPC) -------------- * derived instances are now coloured yellow if they weren't used * likewise record field names * entry counts are more accurate (hpc --fun-entry-count) * tab width is now correct (markup was previously off in source with tabs) Internal changes ================ In Core, the Note constructor has been replaced by Tick (Tickish b) (Expr b) which is used to represent all the kinds of source annotation we support: profiling SCCs, HPC ticks, and GHCi breakpoints. Depending on the properties of the Tickish, different transformations apply to Tick. See CoreUtils.mkTick for details. Tickets ======= This commit closes the following tickets, test cases to follow: - Close #2552: not a bug, but the behaviour is now more intuitive (test is T2552) - Close #680 (test is T680) - Close #1531 (test is result001) - Close #949 (test is T949) - Close #2466: test case has bitrotted (doesn't compile against current version of vector-space package)
-
- 31 Oct, 2011 1 commit
-
-
chak@cse.unsw.edu.au. authored
* Frontend support (not yet used in the vectoriser)
-
- 10 Oct, 2011 1 commit
-
-
chak@cse.unsw.edu.au. authored
-
- 23 Sep, 2011 1 commit
-
-
Simon Peyton Jones authored
and comment its invariants in Note [CoreProgram] in CoreSyn I'm not totally convinced that CoreProgram is the right name (perhaps CoreTopBinds might better), but it is useful to have a clue that you are looking at the top-level bindings. This is only a matter of a type synonym change; no deep refactoring here.
-
- 05 Sep, 2011 1 commit
-
-
Simon Peyton Jones authored
-
- 18 Aug, 2011 1 commit
-
-
chak@cse.unsw.edu.au. authored
- Pragma to determine how a given type is vectorised - At this stage only the VECTORISE SCALAR variant is used by the vectoriser. - '{-# VECTORISE SCALAR type t #-}' implies that 't' cannot contain parallel arrays and may be used in vectorised code. However, its constructors can only be used in scalar code. We use this, e.g., for 'Int'. - May be used on imported types See also http://hackage.haskell.org/trac/ghc/wiki/DataParallel/VectPragma
-
- 27 Jul, 2011 1 commit
-
-
Simon Peyton Jones authored
-
- 26 Jul, 2011 1 commit
-
-
batterseapower authored
-
- 23 Jun, 2011 1 commit
-
-
Simon Peyton Jones authored
This type was mainly there to support silent superclass parameters for dfuns, and they have gone away. So this patch is another minor simplification. (Interface format change; you need to make clean.)
-
- 22 Jun, 2011 1 commit
-
-
Simon Peyton Jones authored
We introduced silent superclass parameters as a way to avoid superclass loops, but we now solve that problem a different way ("derived" superclass constraints carry no evidence). So they aren't needed any more. Apart from being a needless complication, they broke DoCon. Admittedly in a very obscure way, but still the result is hard to explain. To see the details see Trac #5051, with test case typecheck/should_compile/T5051. (The test is nice and small!)
-
- 13 Jun, 2011 1 commit
-
-
chak@cse.unsw.edu.au. authored
-