1. 14 Oct, 2016 1 commit
    • Ryan Scott's avatar
      Make error when deriving an instance for a typeclass less misleading · d5a4e49d
      Ryan Scott authored
      Before, when you attempted to derive an instance for a typeclass,
      e.g.,
      
      ```
      class C1 (a :: Constraint) where
      class C2 where
      
      deriving instance C1 C2
      ```
      
      GHC would complain that `C2`'s data constructors aren't in scope. But
      that
      makes no sense, since typeclasses don't have constructors! By refining
      the
      checks that GHC performs when deriving, we can make the error message a
      little more sensible.
      
      This also cleans up a related `DeriveAnyClass` infelicity. Before, you
      wouldn't have been able to compile code like this:
      
      ```
      import System.IO (Handle)
      class C a
      deriving instance C Handle
      ```
      
      Since GHC was requiring that all data constructors of `Handle` be in
      scope. But `DeriveAnyClass` doesn't even generate code that mentions
      any data constructors, so this requirement is silly!
      
      Fixes #11509.
      
      Test Plan: make test TEST=T11509
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie, simonpj
      
      Differential Revision: https://phabricator.haskell.org/D2558
      
      GHC Trac Issues: #11509
      d5a4e49d
  2. 01 Oct, 2016 3 commits
    • Tamar Christina's avatar
      Add NUMA support for Windows · c93813d9
      Tamar Christina authored
      Summary:
      NOTE: I have been able to do simple testing on emulated NUMA nodes.
                 Real hardware would be needed for a proper test.
      
      D2199 Added NUMA support for Linux, I have just filled in the missing pieces following
      the description of the Linux APIs.
      
      Test Plan:
      Use `bcdedit.exe /set groupsize 2` to modify the kernel again (Similar to D2533).
      
      This generates some NUMA nodes:
      
      ```
      Logical Processor to NUMA Node Map:
      NUMA Node 0:
      **
      --
      NUMA Node 1:
      --
      **
      
      Approximate Cross-NUMA Node Access Cost (relative to fastest):
           00  01
      00: 1.1 1.1
      01: 1.0 1.0
      ```
      
      run ` ../test-numa.exe +RTS --numa -RTS`
      
      and check PerfMon for NUMA allocations.
      
      Reviewers: simonmar, erikd, bgamari, austin
      
      Reviewed By: simonmar
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2534
      
      GHC Trac Issues: #12602
      c93813d9
    • Tamar Christina's avatar
      Support more than 64 logical processors on Windows · 3c179054
      Tamar Christina authored
      Windows support for more than 64 logical processors are implemented
      using processor groups.
      
      Essentially what it's doing is keeping the existing maximum of 64
      processors and keeping the affinity mask a 64 bit value, but adds an
      hierarchy above that.
      
      This support was added to Windows 7 and so we need to at runtime detect
      if the APIs are still there due to our minimum supported version being
      Windows Vista.
      
      The Maximum number of groups supported at this time is 4, so 256 logical
      cores.  The group indices are 0 based. One thread can have affinity with
      multiple groups.
      
      See
      https://msdn.microsoft.com/en-us/library/windows/desktop/ms684251.aspx
      and particularly helpful is the whitepaper: 'Supporting Systems that
      have more than 64 processors' at
      https://msdn.microsoft.com/en-us/library/windows/hardware/dn653313.aspx
      
      Processor groups are not guaranteed to be uniformly distributed nor
      guaranteed to be filled before a next group is needed. The OS will
      assign processors to groups based on physical proximity and will never
      partially assign cores from one physical cpu to more than one group. If
      one has two 48 core CPUs then you'd end up with two groups of 48 logical
      cpus. Now add a 3rd CPU with 10 cores and the group it is assigned to
      depends where the socket is on the board.
      
      Test Plan:
      ./validate or make test -c . in the rts test folder.
      
      This tests for regressions, to test this particular functionality
      itself:
      
         <program> +RTS -N -qa -RTS
      
      Test is detailed in description.
      
      Reviewers: bgamari, simonmar, austin, erikd
      
      Reviewed By: simonmar
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2533
      
      GHC Trac Issues: #11054
      3c179054
    • Ryan Scott's avatar
      Implement deriving strategies · 9e862765
      Ryan Scott authored
      Allows users to explicitly request which approach to `deriving` to use
      via keywords, e.g.,
      
      ```
      newtype Foo = Foo Bar
        deriving Eq
        deriving stock    Ord
        deriving newtype Show
      ```
      
      Fixes #10598. Updates haddock submodule.
      
      Test Plan: ./validate
      
      Reviewers: hvr, kosmikus, goldfire, alanz, bgamari, simonpj, austin,
      erikd, simonmar
      
      Reviewed By: alanz, bgamari, simonpj
      
      Subscribers: thomie, mpickering, oerjan
      
      Differential Revision: https://phabricator.haskell.org/D2280
      
      GHC Trac Issues: #10598
      9e862765
  3. 01 Sep, 2016 3 commits
  4. 31 Aug, 2016 4 commits
  5. 29 Aug, 2016 1 commit
  6. 23 Aug, 2016 1 commit
    • Ryan Scott's avatar
      Template Haskell support for unboxed sums · 613d7455
      Ryan Scott authored
      This adds new constructors `UnboxedSumE`, `UnboxedSumT`, and
      `UnboxedSumP` to represent unboxed sums in Template Haskell.
      
      One thing you can't currently do is, e.g., `reify ''(#||#)`, since I
      don't believe unboxed sum type/data constructors can be written in
      prefix form.  I will look at fixing that as part of #12514.
      
      Fixes #12478.
      
      Test Plan: make test TEST=T12478_{1,2,3}
      
      Reviewers: osa1, goldfire, austin, bgamari
      
      Reviewed By: goldfire, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2448
      
      GHC Trac Issues: #12478
      613d7455
  7. 22 Aug, 2016 1 commit
    • Ryan Scott's avatar
      Move #12403, #12513 users guide notes to 8.2.1 release notes · acdbd16f
      Ryan Scott authored
      The changes in #12403 and #12513 subtly changed the behavior of Template
      Haskell reification and splicing. While the old behavior was certainly buggy,
      it's possible that there's code in the wild that depended on the old behavior
      to work. To err on the side of caution, I'll postpone these changes to GHC
      8.2.1 instead of having them merged into GHC 8.0.2.
      acdbd16f
  8. 21 Aug, 2016 1 commit
  9. 18 Aug, 2016 1 commit
  10. 20 Jul, 2016 2 commits
    • Dylan Meysmans's avatar
      Data.Either: Add fromLeft and fromRight (#12402) · a0f83a62
      Dylan Meysmans authored
      Reviewers: austin, hvr, RyanGlScott, bgamari
      
      Reviewed By: RyanGlScott, bgamari
      
      Subscribers: RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2403
      
      GHC Trac Issues: #12402
      a0f83a62
    • Ömer Sinan Ağacan's avatar
      Support SCC pragmas in declaration context · 98b2c508
      Ömer Sinan Ağacan authored
      Not having SCCs at the top level is becoming annoying real quick. For
      simplest cases, it's possible to do this transformation:
      
          f x y = ...
          =>
          f = {-# SCC f #-} \x y -> ...
      
      However, it doesn't work when there's a `where` clause:
      
          f x y = <t is in scope>
            where t = ...
          =>
          f = {-# SCC f #-} \x y -> <t is out of scope>
            where t = ...
      
      Or when we have a "equation style" definition:
      
          f (C1 ...) = ...
          f (C2 ...) = ...
          f (C3 ...) = ...
          ...
      
      (usual solution is to rename `f` to `f'` and define a new `f` with a
      `SCC`)
      
      This patch implements support for SCC annotations in declaration
      contexts. This is now a valid program:
      
          f x y = ...
            where
              g z = ...
              {-# SCC g #-}
          {-# SCC f #-}
      
      Test Plan: This passes slow validate (no new failures added).
      
      Reviewers: goldfire, mpickering, austin, bgamari, simonmar
      
      Reviewed By: bgamari, simonmar
      
      Subscribers: simonmar, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2407
      98b2c508
  11. 19 Jul, 2016 1 commit
  12. 16 Jul, 2016 1 commit
  13. 06 Jul, 2016 1 commit
  14. 04 Jul, 2016 1 commit
  15. 01 Jul, 2016 1 commit
  16. 04 Jun, 2016 1 commit
  17. 24 May, 2016 1 commit
    • seraphime's avatar
      Fix: #12084 deprecate old profiling flags · 1956cbf1
      seraphime authored
      Change help message so it doesn't specify -auto-all.
      Make old profiling flags deprecated as they are no longer
      documented.
      Update Makefile and documentation accordingly.
      Update release notes for ghc 8.2
      
      Test Plan:
      ./verify; `ghc --help` shouldn't specify the -auto-all
      flag. Furthermore `ghc -fprof -auto-all` should emit a warning
      
      Reviewed By: thomie, austin
      
      Differential Revision: https://phabricator.haskell.org/D2257
      
      GHC Trac Issues: #12084
      
      Update submodule nofib
      1956cbf1
  18. 23 May, 2016 1 commit
    • Ben Gamari's avatar
      Revert "compiler/iface: compress .hi files" · 9bb27726
      Ben Gamari authored
      This appears to cause validation issues on,
      
          TEST="T11108 T9071 T11076 T7600 T7672 T8329 T10420 T10322 T8308 T4114a
          T4114c T10602 T10110 T9204 T2435 T9838 T4114d T10233 T8696 T1735 T5281
          T6056 T10134 T9580 T6018 T9762 T8103"
      
      With compiler panics of the form,
      
          Compile failed (status 256) errors were:
          ghc: panic! (the 'impossible' happened)
            (GHC version 8.1.20160523 for x86_64-unknown-linux):
                  Binary.readBinMem: decompression failed
          CallStack (from HasCallStack):
            error, called at compiler/utils/Binary.hs:192:16 in ghc:Binary
      
          Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
      
      This reverts commit d9cb7a8a.
      9bb27726
  19. 21 May, 2016 1 commit
    • Austin Seipp's avatar
      compiler/iface: compress .hi files · d9cb7a8a
      Austin Seipp authored
      Compress all interface files generated by the compiler with LZ4. While
      being only a tiny amount of code, LZ4 is both fast at compression and
      decompression, and has good compression ratios.
      
      Non-scientific size test: size of stage2 compiler .hi files:
      
      `find ./compiler/stage2 -type f -iname '*.hi' -exec du -ch {} + | grep total$`
      
      Without this patch: 22MB of .hi files for stage2.
      With this patch: 9.2MB of .hi files for stage2.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D1159
      d9cb7a8a
  20. 18 May, 2016 1 commit
  21. 12 May, 2016 1 commit