- 14 Apr, 2015 1 commit
-
-
Simon Peyton Jones authored
Trac #10218 reports a subtle bug that turned out to be: - CSE invalidated the usage information computed by earlier demand analysis, by increasing sharing - that made a single-entry thunk into a multi-entry thunk - and with -feager-blackholing, that led to <<loop>> The patch fixes it by making the CSE pass zap usage information for let-bound identifiers. It can be restored by -flate-dmd-anal. (But making -flate-dmd-anal the default needs some careful work; see Trac #7782.)
-
- 10 Apr, 2015 1 commit
-
-
Gabor Greif authored
-
- 07 Apr, 2015 1 commit
-
-
Simon Peyton Jones authored
This patch fixes Trac #10148, an outright and egregious bug in the demand analyser. It is explained in Note [Demand on case-alternative binders] in Demand.hs. I did some other minor refactoring. To my astonishment I got some big compiler perf changes * perf/compiler/T5837: bytes allocated -76% * perf/compiler/T5030: bytes allocated -10% * perf/compiler/T3294: max bytes used -25% Happy days
-
- 04 Mar, 2015 1 commit
-
-
Simon Peyton Jones authored
(Triggered by investigating Trac #10102 etc.)
-
- 03 Dec, 2014 1 commit
-
-
Austin Seipp authored
Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
- 04 Nov, 2014 1 commit
-
-
Simon Peyton Jones authored
-
- 13 Oct, 2014 1 commit
-
-
Joachim Breitner authored
otherwise this can retain large lazy calculations. This fixed one space leak pointed out in #9675.
-
- 01 Jul, 2014 1 commit
-
-
Simon Peyton Jones authored
This is a tricky case exposed by Trac #9254. I'm surprised it hasn't shown up before, because it's happens when you use unsafePerformIO in the right way. Anyway, fixed now. See Note [Analysing with absent demand] in Demand.lhs
-
- 20 Jun, 2014 1 commit
-
-
Simon Peyton Jones authored
The issue here is avoiding a GHC crash when a program uses unsafeCoerce is a dangerous (or even outright-wrong) way. See Trac #9208
-
- 15 May, 2014 1 commit
-
-
Herbert Valerio Riedel authored
In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
-
- 06 Mar, 2014 1 commit
-
-
Simon Peyton Jones authored
Because of GADTs and casts we were getting binders whose demand annotation was more deeply nested than made sense for its type. See Note [Trimming a demand to a type], in Demand.lhs, which I reproduce here: Note [Trimming a demand to a type] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider this: f :: a -> Bool f x = case ... of A g1 -> case (x |> g1) of (p,q) -> ... B -> error "urk" where A,B are the constructors of a GADT. We'll get a U(U,U) demand on x from the A branch, but that's a stupid demand for x itself, which has type 'a'. Indeed we get ASSERTs going off (notably in splitUseProdDmd, Trac #8569). Bottom line: we really don't want to have a binder whose demand is more deeply-nested than its type. There are various ways to tackle this. When processing (x |> g1), we could "trim" the incoming demand U(U,U) to match x's type. But I'm currently doing so just at the moment when we pin a demand on a binder, in DmdAnal.findBndrDmd.
-
- 01 Feb, 2014 1 commit
-
-
Gabor Greif authored
-
- 23 Jan, 2014 1 commit
-
-
Joachim Breitner authored
I did some refactoring of the demand analyser, because I was smelling some minor code smell. Most of my changes I had to undo, though, adding notes and testcases on why the existing code was correct after all. Especially the semantics of the DmdResult is confusing, as it differs in a DmdType and a StrictSig. I got to imrpove the readability of the code for lubDmdType, though. Also, dmdAnalRhs was a bit fishy in how it removed the demand on further arguments of the body, but used the DmdResult. This would be wrong if a body would return a demand type of "<L>m" (which currently does not happen). This is now treated better in removeDmdTyArgs.
-
- 16 Jan, 2014 4 commits
-
-
Joachim Breitner authored
-
Joachim Breitner authored
-
Joachim Breitner authored
Instead of first checking whether splitting is useful, and then firing up the worker-wrapper-machinery, which will do the same checks again, we now simply generate a worker and wrapper, and while doing so keep track of whether what we did was in any way useful. So now there is only one place left where we decide whether we want to do w/w, and that place has access to more information, in particular the actual types at hand.
-
Joachim Breitner authored
these functions were almost equal, and neither validate nor nofib show any difference replacing one by the other. So lets simplify this. (This also prepares for a refactoring that will get rid of worthSplittingArgDmd completely.)
-
- 10 Jan, 2014 2 commits
-
-
Gabor Greif authored
-
Joachim Breitner authored
Explain why defaultDmd resTypeArgDmd are similar, but both needed, and apply slight code cosmetics.
-
- 16 Dec, 2013 7 commits
-
-
Joachim Breitner authored
by only passing the demand on the free variables, and whether the argument (resp. scrunitee) may or will diverge.
-
Joachim Breitner authored
Make different postProcess code paths for function arguments (which are post-processed just to be both'ed) and unsaturated functions (which are post-processed for other reasons.)
-
Joachim Breitner authored
its first argument is just used for its length (the arity of the call). So changing the type to Int to reflect that. Also add a note [Demands from unsaturated function calls] that hopefully comprehensively and comprehensibly explains what is going on here.
-
Joachim Breitner authored
-
Joachim Breitner authored
-
Joachim Breitner authored
this is a small-step-refactoring patch and not very interesting on its own.
-
Joachim Breitner authored
by adding Notes and using easier to understand combinators.
-
- 12 Dec, 2013 4 commits
-
-
Joachim Breitner authored
-
Simon Peyton Jones authored
Joachim and I are committing this onto a branch so that we can share it, but we expect to do a bit more work before merging it onto head. Nofib staus: - Most programs, no change - A few improve - A couple get worse (cacheprof, tak, rfib) Investigating the "get worse" set is what's holding up putting this on head. The major issue is this. Consider map (f g) ys where f's demand signature looks like f :: <L,C1(C1(U))> -> <L,U> -> . So 'f' is not saturated. What demand do we place on g? Answer C(C1(U)) That is, the inner C1 should stay, even though f is not saturated. I found that this made a significant difference in the demand signatures inferred in GHC.IO, which uses lots of higher-order exception handlers. I also had to add used-once demand signatures for some of the 'catch' primops, so that we know their handlers are only called once.
-
Simon Peyton Jones authored
This patch was authored by SPJ, and extracted from "Improve the handling of used-once stuff" by Joachim.
-
Simon Peyton Jones authored
This was authored by SPJ and extracted from the "Improve the handling of used-once stuff" patch by Joachim.
-
- 09 Dec, 2013 3 commits
-
-
Joachim Breitner authored
because it is not a top deman (see previous commit), and it is only used in an argument to mkStrictSig.
-
Joachim Breitner authored
because topDmdType is ''not'' the top of the lattice, as it puts an implicit absent demand on free variables, but Abs is the bottom of the Usage lattice. Why nopDmdType? Becuase it is the demand of doing nothing: Everything lazy, everything absent, no definite divergence.
-
Joachim Breitner authored
but do forget about certain divergence, if required. Fixes one part of ticket #8598. The added function (deferAfterIO) can maybe be merged with existing code, but given the ongoing work in the nested-cpr branch, I defer that work.
-
- 04 Dec, 2013 1 commit
-
-
Simon Peyton Jones authored
-
- 02 Dec, 2013 2 commits
-
-
Gabor Greif authored
-
Joachim Breitner authored
This note is a summary of an explanation by SPJ to me.
-
- 01 Oct, 2013 2 commits
-
-
Gabor Greif authored
-
Simon Peyton Jones authored
Here's the Note about the (simple) fix. Apparently #8329 prevented all 23 packages of the Snap framework from compiling. Note [Demand transformer for a ditionary selector] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we evaluate (op dict-expr) under demand 'd', then we can push the demand 'd' into the appropriate field of the dictionary. What *is* the appropriate field? We just look at the strictness signature of the class op, which will be something like: U(AAASAAAAA). Then replace the 'S' by the demand 'd'. For single-method classes, which are represented by newtypes the signature of 'op' won't look like U(...), so the splitProdDmd_maybe will fail. That's fine: if we are doing strictness analysis we are also doing inling, so we'll have inlined 'op' into a cast. So we can bale out in a conservative way, returning topDmdType. It is (just.. Trac #8329) possible to be running strictness analysis *without* having inlined class ops from single-method classes. Suppose you are using ghc --make; and the first module has a local -O0 flag. So you may load a class without interface pragmas, ie (currently) without an unfolding for the class ops. Now if a subsequent module in the --make sweep has a local -O flag you might do strictness analysis, but there is no inlining for the class op. This is wierd so I'm not worried about whether this optimises brilliantly; but it should not fall over.
-
- 08 Sep, 2013 1 commit
-
-
nfrisby authored
also added -fdmd-tx-dict-sel, on by default
-
- 06 Jun, 2013 1 commit
-
-
Simon Peyton Jones authored
If either side diverges, both do!
-