1. 12 Oct, 2016 5 commits
  2. 11 Oct, 2016 2 commits
    • Joachim Breitner's avatar
      Add a broken test case for #12689 · f8d2c205
      Joachim Breitner authored
      A rule with a phase specification trying to match on a constructor with
      a wrapper will fail to match, as the wrapper will be inlined by then.
      The fact that it works in the other case is also mostly by accident.
      (Split into two test cases so that regressions with regard what works so
      far are caught.)
      f8d2c205
    • Joachim Breitner's avatar
      Add test case for #12689 · b5be2ec3
      Joachim Breitner authored
      which test a few variants of rules involving constructors, including
      nullary constructors, constructors with wrappers, and unsaturated of
      constructors.
      
      At the moment, all the rules work as expected, despite GHC’s compile
      time warnings when called with -Wall.
      b5be2ec3
  3. 10 Oct, 2016 6 commits
    • Simon Peyton Jones's avatar
      More tests for Trac #12522 · a6111b8c
      Simon Peyton Jones authored
      These ones test the variations in coment:15 of the ticket
      a6111b8c
    • Simon Peyton Jones's avatar
      Improved stats for Trac #1969 · cc5ca21b
      Simon Peyton Jones authored
      With my latest commits
      
        76a5477b Move zonking out of tcFamTyPats
        b255ae7b Orient improvement constraints better
      
      perf has improved slightly for T1969:
      
      allocs:    733M -> 26M
      residency: 43M  -> 41M
      
      I don't know exactly why, but hey, it's good
      cc5ca21b
    • Simon Peyton Jones's avatar
      Move zonking out of tcFamTyPats · 76a5477b
      Simon Peyton Jones authored
      In tcFamTyPats we were zonking from the TcType world to the
      Type world, ready to build the results into a CoAxiom (which
      should have no TcType stuff.  But the 'thing_inside' for
      tcFamTyPats also must be zonked, and that zonking must have
      the ZonkEnv from the binders zonked tcFamTyPats.
      
      Ugh.  This caused an assertion failure (with DEBUG on) in
      RaeBlobPost and TypeLevelVec, both in tests/dependent, as
      shown in Trac #12682.  Why it hasn't shown up before now
      is obscure to me.
      
      So I moved the zonking stuff out of tcFamTyPats to its
      three call sites, where we can do it all together. Very
      slightly longer, but much more robust.
      76a5477b
    • Simon Peyton Jones's avatar
      Delete orphan where clause · 88eb7738
      Simon Peyton Jones authored
      88eb7738
    • Simon Peyton Jones's avatar
      Rename a parameter; trivial refactor · b5c89636
      Simon Peyton Jones authored
      b5c89636
    • Simon Peyton Jones's avatar
      Orient improvement constraints better · b255ae7b
      Simon Peyton Jones authored
      This patch fixes an infinite loop in the constraint solver,
      shown up by Trac #12522.
      
      The solution is /very/ simple: just reverse the orientation of the
      derived constraints arising from improvement using type-family
      injectivity.  I'm not very proud of the fix --- it seems fragile
      --- but it has the very great merit of simplicity, and it works
      fine.
      
      See Note [Improvement orientation] in TcInteract, and some
      discussion on the Trac ticket.
      b255ae7b
  4. 09 Oct, 2016 6 commits
    • Vaibhav Sagar's avatar
      Escape lambda. · 1a9705c3
      Vaibhav Sagar authored
      Test Plan: View updated documentation?
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2583
      
      GHC Trac Issues: #12672
      1a9705c3
    • Simon Marlow's avatar
      Turn on -n4m with -A16m or greater · 85e81a85
      Simon Marlow authored
      Nursery chunks help reduce the cost of GC when capabilities are unevenly
      loaded, by ensuring that we use more of the available nursery.
      
      The rationale for enabling this at -A16m is that any negative effects
      due to loss of cache locality are less likely to be an issue at -A16m
      and above.  It's a conservative guess.  If we had a lot of benchmark
      data we could probably do better.
      
      Results for nofib/parallel at -N4 -A32m with and without -n4m:
      
      ```
      ------------------------------------------------------------------------
              Program           Size    Allocs   Runtime   Elapsed  TotalMem
      ------------------------------------------------------------------------
         blackscholes           0.0%     -9.5%     -9.0%    -15.0%     -2.2%
                coins           0.0%     -4.7%     -3.6%     -0.6%    -13.6%
               mandel           0.0%     -0.3%     +7.7%    +13.1%     +0.1%
              matmult           0.0%     +1.5%    +10.0%     +7.7%     +0.1%
                nbody           0.0%     -4.1%     -2.9%     0.085      0.0%
               parfib           0.0%     -1.4%     +1.0%     +1.5%     +0.2%
              partree           0.0%     -0.3%     +0.8%     +2.9%     -0.8%
                 prsa           0.0%     -0.5%     -2.1%     -7.6%      0.0%
               queens           0.0%     -3.2%     -1.4%     +2.2%     +1.3%
                  ray           0.0%     -5.6%    -14.5%     -7.6%     +0.8%
             sumeuler           0.0%     -0.4%     +2.4%     +1.1%      0.0%
      ------------------------------------------------------------------------
                  Min           0.0%     -9.5%    -14.5%    -15.0%    -13.6%
                  Max           0.0%     +1.5%    +10.0%    +13.1%     +1.3%
       Geometric Mean          +0.0%     -2.6%     -1.3%     -0.5%     -1.4%
      ```
      
      Not conclusive, but slightly better.  This matters a lot more when you
      have more cores.
      
      Test Plan: validate, nofib/paralel
      
      Reviewers: niteria, ezyang, nh2, trofi, austin, erikd, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2581
      
      GHC Trac Issues: #9221
      85e81a85
    • Simon Marlow's avatar
      Default +RTS -qn to the number of cores · 6c47f2ef
      Simon Marlow authored
      Setting a -N value that is too large has a dramatic negative effect on
      performance, but the new -qn flag can mitigate the worst of the effects
      by limiting the number of GC threads.
      
      So now, if you don't explcitly set +RTS -qn, and you set -N larger than
      the number of cores (or use setNumCapabilities to do the same), we'll
      default -qn to the number of cores.
      
      These are the results from nofib/parallel on my 4-core (2 cores x 2
      threads) i7 laptop, comparing -N8 before and after this change.
      
      ```
      ------------------------------------------------------------------------
              Program           Size    Allocs   Runtime   Elapsed  TotalMem
      ------------------------------------------------------------------------
         blackscholes          +0.0%     +0.0%    -72.5%    -72.0%     +9.5%
                coins          +0.0%     -0.0%    -73.7%    -72.2%     -0.8%
               mandel          +0.0%     +0.0%    -76.4%    -75.4%     +3.3%
              matmult          +0.0%    +15.5%    -26.8%    -33.4%     +1.0%
                nbody          +0.0%     +2.4%     +0.7%     0.076      0.0%
               parfib          +0.0%     -8.5%    -33.2%    -31.5%     +2.0%
              partree          +0.0%     -0.0%    -60.4%    -56.8%     +5.7%
                 prsa          +0.0%     -0.0%    -65.4%    -60.4%      0.0%
               queens          +0.0%     +0.2%    -58.8%    -58.8%     -1.5%
                  ray          +0.0%     -1.5%    -88.7%    -85.6%     -3.6%
             sumeuler          +0.0%     -0.0%    -47.8%    -46.9%      0.0%
      ------------------------------------------------------------------------
                  Min          +0.0%     -8.5%    -88.7%    -85.6%     -3.6%
                  Max          +0.0%    +15.5%     +0.7%    -31.5%     +9.5%
       Geometric Mean          +0.0%     +0.6%    -61.4%    -63.1%     +1.4%
      ```
      
      Test Plan: validate, nofib/parallel benchmarks
      
      Reviewers: niteria, ezyang, nh2, austin, erikd, trofi, bgamari
      
      Reviewed By: trofi, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2580
      
      GHC Trac Issues: #9221
      6c47f2ef
    • Moritz Angermann's avatar
      Cleanup PosixSource.h · 8dc72f3c
      Moritz Angermann authored
      When trying to build arm64-apple-iso, the build fell over `strdup`, as
      the arm64-apple-ios build did not fall into `darwin_HOST_OS`, and would
      need `ios_HOST_OS`.
      
      This diff tries to clean up PosixSource.h, instead of layering another
      define on top.
      
      As we use `strnlen` in sources that include PosixSource.h, and `strnlen`
      is defined in POSIX.1-2008, the `_POSIX_C_SOURCE` and `_XOPEN_SOURCE`
      are increased accordingly.
      
      Furthermore the `_DARWIN_C_SOURCE` (required for `u_char`, etc. used in
      sysctl.h) define is moved into `OSThreads.h` alongside a similar ifdef
      for freebsd.
      
      Test Plan: Build on all supported platforms.
      
      Reviewers: austin, simonmar, erikd, kgardas, bgamari
      
      Reviewed By: simonmar, erikd, kgardas, bgamari
      
      Subscribers: Phyx, hvr, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2579
      
      GHC Trac Issues: #12624
      8dc72f3c
    • Moritz Angermann's avatar
      Do not segfault if no common root can be found · bcd34451
      Moritz Angermann authored
      When trying to profile a plugin, ghc mysteriously segfaulted.  Upon
      closer examination the segfault happend due to a `->prevStack` lookup
      on a NULL pointer.
      
      A new CostCentre: Unknown is introduced that is set, if ccsapp and
      ccsfn are of equal depth (e.g. 0), and do not have a common CostCentre
      in their stacks.
      
      Reviewers: bgamari, simonmar, austin, erikd
      
      Reviewed By: simonmar
      
      Subscribers: Phyx, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2551
      bcd34451
    • Edward Z. Yang's avatar
      Generate a unique symbol for signature object stub files, fixes #12673 · 7b060e12
      Edward Z. Yang authored
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2585
      
      GHC Trac Issues: #12673
      7b060e12
  5. 08 Oct, 2016 13 commits
  6. 07 Oct, 2016 3 commits
  7. 06 Oct, 2016 5 commits
    • Edward Z. Yang's avatar
    • Joachim Breitner's avatar
      Remove dead code “mkHsConApp” · 57a207ca
      Joachim Breitner authored
      Differential Revision: https://phabricator.haskell.org/D2574
      57a207ca
    • Joachim Breitner's avatar
      RegAlloc: Make some pattern matched complete · a2bedb5c
      Joachim Breitner authored
      these actually are complete, but due to the use of pattern guards, the
      compiler does not see that. Refactor the code that it does.
      
      Differential Revision: https://phabricator.haskell.org/D2574
      a2bedb5c
    • Ryan Scott's avatar
      Refactor TcDeriv and TcGenDeriv · 4a03012a
      Ryan Scott authored
      Summary:
      Keeping a promise I made to Simon to clean up these modules.
      
      This change splits up the massive `TcDeriv` and `TcGenDeriv` modules into
      somewhat more manageable pieces. The new modules are:
      
      * `TcGenFunctor`: This contains the deriving machinery for `Functor`,
        `Foldable`, and `Traversable` (which all use the same underlying algorithm).
      * `TcDerivInfer`: This is the new home for `inferConstraints`,
        `simplifyInstanceContexts`, and related functions, whose role is to come up
        with the derived instance context and subsequently simplify it.
      * `TcDerivUtils`: This is a grab-bag module that contains several
        error-checking utilities originally in `TcDeriv`, as well as some functions
        that `TcDeriv` and `TcDerivInfer` both need.
      
      The end result is that `TcDeriv` is now less than 1,600 SLOC (originally 2,686
      SLOC), and `TcGenDeriv` is now about 2,000 SLOC (originally 2,964).
      
      In addition, this also implements a couple of tiny refactorings:
      
      * I transformed `type Condition = (DynFlags, TyCon) -> Validity` into
        `type Condition = DynFlags -> TyCon -> Validity`
      * I killed the `DerivSpecGeneric` constructor for `DerivSpecMechanism`, and
        merged its functionality into `DerivSpecStock`. In addition,
        `hasStockDeriving` now contains key-value pairs for `Generic` and `Generic1`,
        so they're no longer treated as an awkward special case in `TcDeriv`.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2568
      4a03012a
    • Ryan Scott's avatar
      Remove unused T12124.srderr · 58ecdf83
      Ryan Scott authored
      This was (accidentally?) introduced in 465c6c5d
      58ecdf83