1. 04 May, 2016 12 commits
    • Erik de Castro Lopo's avatar
      rts: Replace `nat` with `uint32_t` · db9de7eb
      Erik de Castro Lopo authored
      The `nat` type was an alias for `unsigned int` with a comment saying
      it was at least 32 bits. We keep the typedef in case client code is
      using it but mark it as deprecated.
      Test Plan: Validated on Linux, OS X and Windows
      Reviewers: simonmar, austin, thomie, hvr, bgamari, hsyl20
      Differential Revision: https://phabricator.haskell.org/D2166
    • niteria's avatar
      Kill non-deterministic foldUFM in TrieMap and TcAppMap · ad4392c1
      niteria authored
      foldUFM introduces unnecessary non-determinism that actually
      leads to different generated code as explained in
      Note [TrieMap determinism].
      As we're switching from UniqFM to UniqDFM here you might be
      concerned about performance. There's nothing that ./validate
      detects. nofib reports no change in Compile Allocations, but
      Compile Time got better on some tests and worse on some,
      yielding this summary:
              -1 s.d.                -----            -3.8%
              +1 s.d.                -----            +5.4%
              Average                -----            +0.7%
      This is not a fair comparison as the order of Uniques
      changes what GHC is actually doing. One benefit from making
      this deterministic is also that it will make the
      performance results more stable.
      Full nofib results: P108
      Test Plan: ./validate, nofib
      Reviewers: goldfire, simonpj, simonmar, austin, bgamari
      Reviewed By: simonpj
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D2169
      GHC Trac Issues: #4012
    • Ben Gamari's avatar
      base: Export runRW# from GHC.Exts · 763610e9
      Ben Gamari authored
      Seems like this should be available in GHC.Exts. Thanks for @carter
      for pointing this out.
      Test Plan: Validate
      Reviewers: rwbarton, hvr, austin
      Reviewed By: austin
      Subscribers: thomie, carter
      Differential Revision: https://phabricator.haskell.org/D2171
    • Ben Gamari's avatar
      testsuite: Add test for #11959 · 4f2afe1e
      Ben Gamari authored
      Test Plan: Validate, expected to fail
      Reviewers: goldfire, austin
      Reviewed By: austin
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D2132
      GHC Trac Issues: #11959
    • Iavor S. Diatchki's avatar
      Be more aggressive when checking constraints for custom type errors. · b75d1940
      Iavor S. Diatchki authored
      This fixes #11990.
      The current rule is simpler than before: if we encounter an unsolved
      constraint that contains any mentions of properly applied `TypeError`,
      then we report the type error.
      If there are multiple `TypeErrors`, then we just report one of them.
      Reviewers: simonpj, bgamari, austin
      Reviewed By: simonpj
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D2151
      GHC Trac Issues: #11990
    • Simon Marlow's avatar
      Make 'make fast' work for the User Guide · aa5e2ddc
      Simon Marlow authored
      If you already have mkUserGuidePart compiled.
    • Simon Marlow's avatar
      Don't STATIC_INLINE giveCapabilityToTask · dbcaa8c2
      Simon Marlow authored
      This causes errors with some versions of gcc (4.4.7 here).
    • Simon Marlow's avatar
      schedulePushWork: avoid unnecessary wakeups · 1fa92ca9
      Simon Marlow authored
      This function had some pathalogically bad behaviour: if we had 2 threads
      on the current capability and 23 other idle capabilities, we would
      * grab all 23 capabilities
      * migrate one Haskell thread to one of them
      * wake up a worker on *all* 23 other capabilities.
      This lead to a lot of unnecessary wakeups when using large -N values.
      Now, we
      * Count how many capabilities we need to wake up
      * Start from cap->no+1, so that we don't overload low-numbered capabilities
      * Only wake up capabilities that we migrated a thread to (unless we have
        sparks to steal)
      This results in a pretty dramatic improvement in our production system.
    • Simon Marlow's avatar
      Add +RTS -AL<size> · f703fd6b
      Simon Marlow authored
      +RTS -AL<size> controls the total size of large objects that can be
      allocated before a GC is triggered.  Previously this was always just the
      value of -A, and the limit mainly existed to prevent runaway allocation
      in pathalogical programs that allocate a lot of large objects.  However,
      since the limit is shared between all cores, on a large multicore the
      default becomes more restrictive, and can end up triggering GC well
      before it would normally have been.
      Arguably a better default would be A*N, but this is probably excessive.
      Adding a flag lets you choose, and I've left the default as it was.
      See docs for usage.
    • Simon Marlow's avatar
      Allow limiting the number of GC threads (+RTS -qn<n>) · 76ee2607
      Simon Marlow authored
      This allows the GC to use fewer threads than the number of capabilities.
      At each GC, we choose some of the capabilities to be "idle", which means
      that the thread running on that capability (if any) will sleep for the
      duration of the GC, and the other threads will do its work.  We choose
      capabilities that are already idle (if any) to be the idle capabilities.
      The idea is that this helps in the following situation:
      * We want to use a large -N value so as to make use of hyperthreaded
      * We use a large heap size, so GC is infrequent
      * But we don't want to use all -N threads in the GC, because that
        thrashes the memory too much.
      See docs for usage.
    • Joachim Breitner's avatar
      Adjust testsuite output to bytestring- · f9d93751
      Joachim Breitner authored
      This is a band-aid; the test suite should not be sensitive to these
    • Joachim Breitner's avatar
      Export oneShot from GHC.Exts · 50e70559
      Joachim Breitner authored
      as suggested by carter in #12011.
  2. 03 May, 2016 2 commits
  3. 02 May, 2016 7 commits
    • Simon Marlow's avatar
      Cleanups related to MAX_FREE_LIST · ef446066
      Simon Marlow authored
      - Rename to the (more correct) NUM_FREE_LISTS
      - NUM_FREE_LISTS should be derived from the block and mblock sizes, not
        defined manually.  It was actually too large by one, which caused a
        little bit of (benign) extra work in the form of a redundant loop
        iteration in some cases.
      - Add some ASSERTs for input preconditions to log_2() and log_2_ceil()
      - Fix some comments
      - Fix usage in allocLargeChunk, to account for the fact that
        log_2_ceil() can return NUM_FREE_LISTS.
    • U-THEFACEBOOK\smarlow's avatar
      Revert "Revert "Use __builtin_clz() to implement log_1()"" · 5f8c0b84
      U-THEFACEBOOK\smarlow authored
      This reverts commit 546f24e4.
      And adds a fix for Windows: we need to use __builtin_clzll() rather than
      __builtin_clzl(), because StgWord is unsigned long long on Windows.
    • Facundo Domínguez's avatar
      StaticPointers: Allow closed vars in the static form. · 36d29f7c
      Facundo Domínguez authored
      With this patch closed variables are allowed regardless of whether
      they are bound at the top level or not.
      The FloatOut pass is always performed. When optimizations are
      disabled, only expressions that go to the top level are floated.
      Thus, the applications of the StaticPtr data constructor are always
      The CoreTidy pass makes sure the floated applications appear in the
      symbol table of object files. It also collects the floated bindings
      and inserts them in the static pointer table.
      The renamer does not check anymore if free variables appearing in the
      static form are top-level. Instead, the typechecker looks at the
      tct_closed flag to decide if the free variables are closed.
      The linter checks that applications of StaticPtr only occur at the
      top of top-level bindings after the FloatOut pass.
      The field spInfoName of StaticPtrInfo has been removed. It used to
      contain the name of the top-level binding that contains the StaticPtr
      application. However, this information is no longer available when the
      StaticPtr is constructed, as the binding name is determined now by the
      FloatOut pass.
      Test Plan: ./validate
      Reviewers: goldfire, simonpj, austin, hvr, bgamari
      Reviewed By: simonpj
      Subscribers: thomie, mpickering, mboes
      Differential Revision: https://phabricator.haskell.org/D2104
      GHC Trac Issues: #11656
    • Ryan Scott's avatar
      Make validDerivPred ignore non-visible arguments to a class type constructor · fa86ac7c
      Ryan Scott authored
      GHC choked when trying to derive the following:
      {-# LANGUAGE GeneralizedNewtypeDeriving #-}
      {-# LANGUAGE PolyKinds #-}
      module Example where
      class Category (cat :: k -> k -> *) where
        catId   :: cat a a
        catComp :: cat b c -> cat a b -> cat a c
      newtype T (c :: * -> * -> *) a b = MkT (c a b) deriving Category
      Unlike in #8865, where we were deriving `Category` for a concrete type like
      `Either`, in the above example we are attempting to derive an instance of the
      instance Category * c => Category (T * c) where ...
      (using `-fprint-explicit-kinds` syntax). But `validDerivPred` is checking if
      `sizePred (Category * c)` equals the number of free type variables in
      `Category * c`. But note that `sizePred` counts both type variables //and//
      type constructors, and `*` is a type constructor! So `validDerivPred`
      erroneously rejects the above instance.
      The fix is to make `validDerivPred` ignore non-visible arguments to the class
      type constructor (e.g., ignore `*` is `Category * c`) by using
      Fixes #11833.
      Test Plan: ./validate
      Reviewers: goldfire, hvr, simonpj, austin, bgamari
      Reviewed By: bgamari
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D2112
      GHC Trac Issues: #11833
    • Sergei Trofimovich's avatar
    • Sergei Trofimovich's avatar
      glasgow_exts.rst: fix quoting · 81d8a23e
      Sergei Trofimovich authored
      glasgow_exts.rst:6525: WARNING: Inline literal start-string without end-string.
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
    • Sergei Trofimovich's avatar
  4. 01 May, 2016 17 commits
  5. 30 Apr, 2016 2 commits