1. 02 Mar, 2017 10 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 20 commits
    • Simon Peyton Jones's avatar
      The Early Inline Patch · 2effe18a
      Simon Peyton Jones authored
      This very small patch switches on sm_inline even in the InitialPhase
      (aka "gentle" phase).   There is no reason not to... and the results
      are astonishing.
      
      I think the peformance of GHC itself improves by about 5%; and some
      programs get much smaller, quicker.  Result: across the board
      irmprovements in
      compile time performance.  Here are the changes in perf/compiler;
      the numbers are decreases in compiler bytes-allocated:
      
        3%   T5837
        7%   parsing001
        9%   T12234
        35%  T9020
        9%   T3064
        13%  T9961
        20%  T13056
        5%   T9872d
        5%   T9872c
        5%   T9872b
        7%   T9872a
        5%   T783
        35%  T12227
        20%  T1969
      
      Plus in perf/should_run
      
        5%   lazy-bs-alloc
      
      It wasn't as easy as it sounds: I did a raft of preparatory work in
      earlier patches.  But it's great!
      
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3203
      2effe18a
    • Simon Peyton Jones's avatar
      Combine identical case alternatives in CSE · 55efc971
      Simon Peyton Jones authored
      See Note [Combine case alternatives] in CSE.  This opportunity
      surfaced when I was was studying early inlining.  It's easy (and
      cheap) to exploit, and sometimes makes a worthwhile saving.
      
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3194
      55efc971
    • Ben Gamari's avatar
      defef527
    • Ben Gamari's avatar
      Try submodule bumps again · 5fdb2b14
      Ben Gamari authored
      Bumps containers, time, and unix submodules.
      
      This reverts commit c347a121.
      5fdb2b14
    • Ryan Scott's avatar
      Add COMPLETE pragmas for TypeRep and ErrorCall pattern synonyms · 122c6776
      Ryan Scott authored
      When programming with the pattern synonyms for `TypeRep`, I noticed that
      I was receiving spurious non-exhaustive pattern-match warnings.  This
      can be easily fixed by adding `COMPLETE` pragmas for them.
      
      Moreover, there's another pattern synonym in `base`: `ErrorCall`. In
      fact, in the original ticket for `COMPLETE` pragmas (#8779), someone
      requested that `ErrorCall` be given a `COMPLETE` pragma as well
      (https://ghc.haskell.org/trac/ghc/ticket/8779#comment:21).  I decided to
      do that as well while I was in town.
      
      Reviewers: bgamari, mpickering, austin, hvr
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3231
      122c6776
    • Moritz Angermann's avatar
      Drop copy step from the rts/ghc.mk · 3e33d334
      Moritz Angermann authored
      Recently I've used a different build system for building the
      rts (Xcode).  And in doing so, I looked through the rts/ghc.mk
      to figure out how to build the rts.
      
      In general it's quite straight forward to just compile all the
      c files with the proper flags.
      
      However there is one rather awkward copy step that copies some
      files for special handling for the rts way.
      
      I'm wondering if the proposed solution in this diff is better
      or worse than the current situation?
      
      The idea is to keep the files, but use #includes to produce
      identical files with just an additional define. It does however
      produce empty objects for non threaded ways.
      
      Reviewers: ezyang, bgamari, austin, erikd, simonmar, rwbarton
      
      Reviewed By: bgamari, simonmar, rwbarton
      
      Subscribers: rwbarton, thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3237
      3e33d334
    • Moritz Angermann's avatar
      Improve documentation for CreateBCOs Message. · aa2143e0
      Moritz Angermann authored
      After falling over the CreateBCOs message, and expecting it to contain
      ByteStrings encoding `ResolvedBCO`s instead of `[ResolvedBCO]`s, when
      deubbing issues with iserv, I'd like to extend the documentation here
      a bit, so the next one won't fall over it.
      
      Reviewers: simonmar, austin, rwbarton, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3234
      aa2143e0
    • Moritz Angermann's avatar
      iOS: shared objects have .dylib extension. · 23aca132
      Moritz Angermann authored
      Reviewers: austin, rwbarton, bgamari
      
      Reviewed By: rwbarton
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3241
      23aca132
    • Ben Gamari's avatar
      config.mk.in: Disable terminfo support on iOS · 65c41cc5
      Ben Gamari authored
      Test Plan: Validate
      
      Reviewers: angerman, austin, rwbarton
      
      Subscribers: thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3242
      65c41cc5
    • Simon Peyton Jones's avatar
      Inline data constructor wrappers in phase 2 only · fc6c222b
      Simon Peyton Jones authored
      This patch prepares for my upcoming early-inlining patch. It arranges
      that data constructor wrappers are not inlined until Phase 2 (the
      first of the "normal" phases.)  That gives rules a chance to fire
      in the InitialPhase (aka "gentle").
      
      This has been a bit of a problem for a while, so it's nice to have
      a fix.  It should make no difference immediately, becuase currently
      nothing is inlined in the InitialPhase anyway.
      
      Reviewers: austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3193
      fc6c222b
    • Simon Peyton Jones's avatar
      Make Specialise work with casts · 1990bb0d
      Simon Peyton Jones authored
      With my upcoming early-inlining patch it turned out that Specialise
      was getting stuck on casts.  This patch fixes it; see Note
      [Account for casts in binding] in Specialise.
      
      Reviewers: austin, goldfire, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3192
      1990bb0d
    • Ben Gamari's avatar
      Again disable stage0 terminfo on Windows · 29b57238
      Ben Gamari authored
      This accidentally regressed in D3177.
      29b57238
    • Ben Gamari's avatar
      rts: Allow profile output path to be specified on RTS command line · db2a6676
      Ben Gamari authored
      This introduces a RTS option, -po, which allows the user to override the stem
      used to form the output file names of the heap profile and cost center summary.
      
      It's a bit unclear to me whether this is really the interface we want.
      Alternatively we could just allow the user to specify the `.hp` and `.prof` file
      names separately. This would arguably be a bit more straightforward and would
      allow the user to name JSON output with an appropriate `.json` suffix if they so
      desired. However, this would come at the cost of taking more of the option
      space, which is a somewhat precious commodity.
      
      Test Plan: Validate, try using `-po` RTS option
      
      Reviewers: simonmar, austin, erikd
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3182
      db2a6676
    • Ben Gamari's avatar
      Add flag allowing convenient disabling of terminfo support · c686af58
      Ben Gamari authored
      This is a common thing that users who cross-compile must fight against.
      It turns out that it's pretty straightforward to make is convenient.
      
      Test Plan: Cross compile without a target `ncurses` available
      
      Reviewers: danharaj, hvr, erikd, austin, rwbarton
      
      Subscribers: rwbarton, thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3177
      c686af58
    • Simon Peyton Jones's avatar
      Small changes to expression sizing in CoreUnfold · c662d41e
      Simon Peyton Jones authored
      The only significant change here is that
      
         case e of {}
      
      should be treated like 'e', rather than like a case expression.
      We don't push a return address, for example, since 'e' is sure to
      diverge.
      
      I forget why I did this; but it will make these empty-case expressions
      (which are only there to satisfy the type checker) cost-free.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3204
      c662d41e
    • rwbarton's avatar
      When floating, don't box an expression that's okay for speculation (#13338) · d0508ef0
      rwbarton authored
      Commit 432f952e (Float unboxed expressions by boxing) lets the float-out pass
      turn, for example,
      
          ... (-# (remInt# x# 100000#) i#) ...
      
      into
      
          let lvl :: Int
              lvl = case remInt# x# 100000# of v { __DEFAULT__ -> I# v }
          in ... (-# (case lvl of { I# v -> v }) i#) ...
      
      But when, as in the example above, the expression that was floated out was
      the argument of an application, the resulting application may no longer
      satisfy the let/app invariant, because exprOkForSpeculation doesn't look
      far enough inside the definition of lvl.
      
      Solution: When the expression we floated out was okay for speculation, don't
      bother boxing it. It will be evaluated earlier, and that's okay by assumption.
      Fixes the let/app invariant and is cheaper too.
      
      Test Plan: make slowtest TEST=T13338
      
      Reviewers: austin, bgamari, simonpj
      
      Reviewed By: bgamari, simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3217
      d0508ef0
    • Ben Gamari's avatar
      Add Eq instances for TrName, Module · 5dc28ba5
      Ben Gamari authored
      Test Plan: Validate
      
      Reviewers: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3227
      5dc28ba5
    • Ben Gamari's avatar
      base: Expose Module from Type.Reflection · 1db71f59
      Ben Gamari authored
      There is no reason why this can't be safely exported.
      
      Test Plan: Validate
      
      Reviewers: austin, hvr
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3226
      1db71f59
    • Ben Gamari's avatar
      configure: detect whether -lpthreads is necessary for pthreads · e94bfb67
      Ben Gamari authored
      Some platforms have pthreads support available without linking against
      libpthread (and indeed don't even offer a libpthread to link against).
      One example of this is Android's bionic library. Teach the RTS about
      this case.
      
      Test Plan: Validate while cross-compiling targetting Android on aarch64
      
      Reviewers: simonmar, austin, hvr, erikd, rwbarton
      
      Subscribers: danharaj, thomie, erikd, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3149
      e94bfb67
    • Ben Gamari's avatar
      36b6e131