1. 02 Mar, 2017 2 commits
  2. 01 Mar, 2017 10 commits
    • David Feuer's avatar
      Upgrade UniqSet to a newtype · cbe569a5
      David Feuer authored
      The fundamental problem with `type UniqSet = UniqFM` is that `UniqSet`
      has a key invariant `UniqFM` does not. For example, `fmap` over
      `UniqSet` will generally produce nonsense.
      
      * Upgrade `UniqSet` from a type synonym to a newtype.
      
      * Remove unused and shady `extendVarSet_C` and `addOneToUniqSet_C`.
      
      * Use cached unique in `tyConsOfType` by replacing
        `unitNameEnv (tyConName tc) tc` with `unitUniqSet tc`.
      
      Reviewers: austin, hvr, goldfire, simonmar, niteria, bgamari
      
      Reviewed By: niteria
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3146
      cbe569a5
    • David Feuer's avatar
      Change catch# demand signature · 701256df
      David Feuer authored
      * Give `catch#` a lazy demand signature, to make it more honest.
      
      * Make `catchException` and `catchAny` force their arguments so they
      actually behave as advertised.
      
      * Use `catch` rather than `catchException` in `forkIO`, `forkOn`, and
      `forkOS` to avoid losing exceptions.
      
      Fixes #13330
      
      Reviewers: rwbarton, simonpj, simonmar, bgamari, hvr, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3244
      701256df
    • Ben Gamari's avatar
      rts: Fix build · b86d226f
      Ben Gamari authored
      I evidently neglected to consider that validate doesn't build profiled
      ways. Arg.
      b86d226f
    • David Feuer's avatar
      Update containers again · 916658d6
      David Feuer authored
      submodule update
      
      Get the version with `COMPLETE` pragmas for `Data.Sequence`.
      
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3249
      916658d6
    • Simon Peyton Jones's avatar
      Move isJoinId, isJoinId_maybe to Id · 2ab6ce78
      Simon Peyton Jones authored
      This is just a refactoring, moving these two functions where
      they belong.
      
      The reason they were there was because of the use of isJoinId_maybe
      in the OutputableBndr instance of TaggedBndr, which was in CoreSyn.
      I moved it to PprCore, to join the OutputableBndr instance for
      Var.  That makes more sense anyway.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3207
      2ab6ce78
    • Simon Peyton Jones's avatar
      Mark non-recursive join lambdas as one-shot · 777b7707
      Simon Peyton Jones authored
      When we have
      
        join j x y = rhs in ...
      
      we know that the lambdas for 'x' and 'y' are one-shot.
      Let's mark them as such!
      
      This doesn't fix a specific bug, but it feels right to me.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: lukemaurer, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3196
      777b7707
    • Simon Peyton Jones's avatar
      Improve SetLevels for join points · 6eb52cfc
      Simon Peyton Jones authored
      C.f. Trac #13286, #13236
      
      * Never destroy a join point unless it goes to top level
        See Note [Floating join point bindings]
      
      * Never float a MFE if it has a free join variable
        Note [Free join points]
      
      * Stop treating nullary join points specially
      
      * Enforce the invariant that le_join_ceil >= le_ctxt_lvl
        (Needs more thought...)
      
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3199
      6eb52cfc
    • Simon Peyton Jones's avatar
      Improve pretty-printing of types · 871b63e4
      Simon Peyton Jones authored
      When doing debug-printing it's really important that the free vars
      of a type are printed with their uniques.  The IfaceTcTyVar thing
      was a stab in that direction, but it only worked for TcTyVars, not
      TyVars.
      
      This patch does it properly, by keeping track of the free vars of the
      type when translating Type -> IfaceType, and passing that down through
      toIfaceTypeX.  Then when we find a variable, look in that set, and
      translate it to IfaceFreeTyVar if so.  (I renamed IfaceTcTyVar to
      IfaceFreeTyVar.)
      
      Fiddly but not difficult.
      
      Reviewers: austin, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3201
      871b63e4
    • Simon Peyton Jones's avatar
      Add VarSet.anyDVarSet, allDVarSet · cdf6b695
      Simon Peyton Jones authored
      I need these in a later commit.
      
      Also rename
        varSetAny  -->  anyVarSet
        varSetAll  -->  allVarSet
      for consistency with other functions; eg filterVarSet
      
      Reviewers: austin, goldfire, bgamari
      
      Subscribers: niteria, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3202
      cdf6b695
    • David Feuer's avatar
      Fix redundant import in CSE · 4f10a229
      David Feuer authored
      4f10a229
  3. 28 Feb, 2017 23 commits
  4. 27 Feb, 2017 5 commits
    • Simon Peyton Jones's avatar
      Stop uniques ending up in SPEC rule names · 0f7a369f
      Simon Peyton Jones authored
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3191
      0f7a369f
    • Alan Zimmerman's avatar
      Explicitly capture whether a splice has a dollar prefix · c0af206f
      Alan Zimmerman authored
      A top-level splice can be written
      
          $splice
      
      or
      
          splice
      
      For accurate pretty-printing, and for ghc-exactprint, capture in the hsSyn AST
      which variant was parsed.
      c0af206f
    • Simon Peyton Jones's avatar
      Occurrence-analyse the result of rule firings · 76f2cd02
      Simon Peyton Jones authored
      When studying simplCore/should_compile/T7785 I found that a long
      chain of maps
      
        map f (map f (map f (map f (...))))
      
      took an unreasonably long time to simplify.  The problem got
      worse when I started inlining in the InitialPhase, which is how
      I stumbled on it.
      
      The solution turned  out to be rather simple.  It's described in
      
         Note [Occurence-analyse after rule firing]
      
      in Simplify.hs
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3190
      76f2cd02
    • Simon Peyton Jones's avatar
      Add -fspec-constr-keen · 4f38fa10
      Simon Peyton Jones authored
      I discovered that the dramatic imprvoement in perf/should_run/T9339
      with the introduction of join points was really rather a fluke, and
      very fragile.
      
      The real problem (see Note [Making SpecConstr keener]) is that
      SpecConstr wasn't specialising a function even though it was applied
      to a freshly-allocated constructor.  The paper describes plausible
      reasons for this, but I think it may well be better to be a bit more
      aggressive.
      
      So this patch add -fspec-constr-keen, which makes SpecConstr a bit
      keener to specialise, by ignoring whether or not the argument
      corresponding to a call pattern is scrutinised in the function body.
      Now the gains in T9339 should be robust; and it might even be a
      better default.
      
      I'd be interested in what happens if we switched on -fspec-constr-keen
      with -O2.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3186
      4f38fa10
    • Simon Peyton Jones's avatar
      Refactor floating of bindings (fiBind) · e4188b53
      Simon Peyton Jones authored
      This is just a local refactoring.
      
      I originally planned to try floating top-level bindings inwards,
      but I backed off from that leaving only this (harmless) refactoring,
      which has no behavioural effect.
      
      I also make FloatIn into a ModGuts -> ModGuts function; again not
      necessary now, but no harm either.
      
      My attempt also used the new function CoreFVs.freeVarsBind; but
      that too is a plausible refactorig of freeVars, so I left it in too.
      
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3180
      e4188b53