1. 15 May, 2014 2 commits
    • Herbert Valerio Riedel's avatar
      Add LANGUAGE pragmas to compiler/ source files · 23892440
      Herbert Valerio Riedel authored
      In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been
      reorganized, while following the convention, to
      
      - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before
        any `{-# OPTIONS_GHC #-}`-lines.
      
      - Moreover, if the list of language extensions fit into a single
        `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one
        line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each
        individual language extension. In both cases, try to keep the
        enumeration alphabetically ordered.
        (The latter layout is preferable as it's more diff-friendly)
      
      While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma
      occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
      23892440
    • Herbert Valerio Riedel's avatar
      Avoid trivial cases of NondecreasingIndentation · e199891f
      Herbert Valerio Riedel authored
      This cleanup allows the following refactoring commit to avoid adding a
      few `{-# LANGUAGE NondecreasingIndentation #-}` pragmas.
      Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
      e199891f
  2. 14 May, 2014 2 commits
  3. 13 May, 2014 3 commits
  4. 12 May, 2014 5 commits
  5. 08 May, 2014 5 commits
  6. 06 May, 2014 4 commits
  7. 05 May, 2014 2 commits
  8. 04 May, 2014 2 commits
  9. 03 May, 2014 1 commit
  10. 02 May, 2014 1 commit
    • Simon Marlow's avatar
      Per-thread allocation counters and limits · b0534f78
      Simon Marlow authored
      This tracks the amount of memory allocation by each thread in a
      counter stored in the TSO.  Optionally, when the counter drops below
      zero (it counts down), the thread can be sent an asynchronous
      exception: AllocationLimitExceeded.  When this happens, given a small
      additional limit so that it can handle the exception.  See
      documentation in GHC.Conc for more details.
      
      Allocation limits are similar to timeouts, but
      
        - timeouts use real time, not CPU time.  Allocation limits do not
          count anything while the thread is blocked or in foreign code.
      
        - timeouts don't re-trigger if the thread catches the exception,
          allocation limits do.
      
        - timeouts can catch non-allocating loops, if you use
          -fno-omit-yields.  This doesn't work for allocation limits.
      
      I couldn't measure any impact on benchmarks with these changes, even
      for nofib/smp.
      b0534f78
  11. 29 Apr, 2014 3 commits
  12. 28 Apr, 2014 4 commits
    • eir@cis.upenn.edu's avatar
      Improve implementation of unSubCo_maybe. · a3896ab5
      eir@cis.upenn.edu authored
      This is the result of an email conversation (off list) with
      Conal Elliott, who needed a stronger unSubCo_maybe. This
      commit adds cases to upgrade the role of a coercion when
      recursion is necessary to do say (for example, for a use of
      TransCo). As a side effect, more coercion optimizations are
      now possible.
      
      This was not done previously because unSubCo_maybe was used
      only during coercion optimization, and the recursive cases
      looked to be unlikely. However, adding them can cause no harm.
      
      unSubCo_maybe is now also exported from Coercion, for use
      cases like Conal's.
      a3896ab5
    • Simon Peyton Jones's avatar
      Print for-alls more often (Trac #9018) · 2f3ea952
      Simon Peyton Jones authored
      We now display the foralls of a type if any of the type variables
      is polykinded.  This put kind polymorphism "in your face" a bit more
      often, but eliminates a lot of head scratching.
      
      The user manual reflects the new behaviour.
      2f3ea952
    • Gergely Risko's avatar
      Fix annotation reification for home package modules · 48e475e4
      Gergely Risko authored
      The reifyAnnotation method of the Q monad correctly gathered annotations
      from TCG and EPS.  Unfortunately it didn't look into the Home Package
      Table.  This resulted in annotations not being found if they are in the
      same package as the splice that is reifying and ghc --make is used for
      compilation management.  Fix this by using the already existing
      prepareAnnotations method from HscTypes.lhs that correctly searches
      in HPT and EPS both.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      48e475e4
    • Simon Peyton Jones's avatar
      Do type-class defaulting even if there are insoluble constraints · ba2e2014
      Simon Peyton Jones authored
      The argument in Trac #9033 is very compelling: we should not report 20
      errors, fix one, and have the other 19 disappear.  They were spurious
      in the first place.
      
      The fix was easy; do type-class defaulting uncondionally, rather than
      only if there are no insoluble constraints.
      
      See Note [When to do type-class defaulting] in TcSimplify.
      
      Error messages generally improve, especially tc211 which actually
      had an example of precisely this phenomenon.
      ba2e2014
  13. 24 Apr, 2014 3 commits
    • Gabor Greif's avatar
      Some typos in comments · 4ceb5dec
      Gabor Greif authored
      4ceb5dec
    • Simon Peyton Jones's avatar
      Don't eta-expand PAPs (fixes Trac #9020) · 79e46aea
      Simon Peyton Jones authored
      See Note [Do not eta-expand PAPs] in SimplUtils.  This has a tremendously
      good effect on compile times for some simple benchmarks.
      
      The test is now where it belongs, in perf/compiler/T9020 (instead of simpl015).
      
      I did a nofib run and got essentially zero change except for cacheprof which
      gets 4% more allocation.  I investigated.  Turns out that we have
      
          instance PP Reg where
             pp ppm ST_0 = "%st"
             pp ppm ST_1 = "%st(1)"
             pp ppm ST_2 = "%st(2)"
             pp ppm ST_3 = "%st(3)"
             pp ppm ST_4 = "%st(4)"
             pp ppm ST_5 = "%st(5)"
             pp ppm ST_6 = "%st(6)"
             pp ppm ST_7 = "%st(7)"
             pp ppm r    = "%" ++ map toLower (show r)
      
      That (map toLower (show r) does a lot of map/toLowers.  But if we inline show
      we get something like
      
             pp ppm ST_0 = "%st"
             pp ppm ST_1 = "%st(1)"
             pp ppm ST_2 = "%st(2)"
             pp ppm ST_3 = "%st(3)"
             pp ppm ST_4 = "%st(4)"
             pp ppm ST_5 = "%st(5)"
             pp ppm ST_6 = "%st(6)"
             pp ppm ST_7 = "%st(7)"
             pp ppm EAX  = map toLower (show EAX)
             pp ppm EBX  = map toLower (show EBX)
             ...etc...
      
      and all those map/toLower calls can now be floated to top level.
      This gives a 4% decrease in allocation.  But it depends on inlining
      a pretty big 'show' function.
      
      With this new patch we get slightly better eta-expansion, which makes
      a function look slightly bigger, which just stops it being inlined.
      The previous behaviour was luck, so I'm not going to worry about
      losing it.
      
      I've added some notes to nofib/Simon-nofib-notes
      79e46aea
    • Simon Peyton Jones's avatar
      Be less verbose when printing Names when we don't know what's in scope · 134b7223
      Simon Peyton Jones authored
      Previously we always printed qualified names, but that makes a lot of debug or
      warning output very verbose. So now we only print qualified names with -dppr-debug.
      
      Civilised output (from pukka error messages, with the environment available) is
      unaffected
      134b7223
  14. 22 Apr, 2014 2 commits
  15. 21 Apr, 2014 1 commit