Skip to content
Snippets Groups Projects
  1. Mar 29, 2017
    • Simon Peyton Jones's avatar
      Fix explicitly-bidirectional pattern synonyms · 8a857f50
      Simon Peyton Jones authored
      This partly fixes Trac #13441, at least for the explicitly
      bidirectional case.
      
      See Note [Checking against a pattern signature], the part about
      "Existential type variables".
      
      Alas, the implicitly-bidirectional case is still not quite right, but
      at least there is a workaround by making it explicitly bidirectional.
      
      (cherry picked from commit 7c7479d0)
      8a857f50
    • Simon Peyton Jones's avatar
      Typechecker comments and debug tracing only · 55adbbde
      Simon Peyton Jones authored
      (cherry picked from commit 7e1c492d)
      55adbbde
    • Simon Peyton Jones's avatar
      Eliminate a user manual warning · 20dc2534
      Simon Peyton Jones authored
      I was getting
        docs/users_guide/glasgow_exts.rst:12783:
           WARNING: Title underline too short.
      
        ``COLUMN`` pragma
        ---------------
      
      So I lengthened the row of hyphens.
      
      (cherry picked from commit af33073c)
      20dc2534
    • Simon Peyton Jones's avatar
      Simplify the logic for tc_hs_sig_type · 208c3ec2
      Simon Peyton Jones authored
      In fixing Trac #13337, and introducing solveSomeEqualities,
      Richard introduce the higher-order function tc_hs_sig_type_x,
      with a solver as its argument.
      
      It turned out that there was a much simpler way to do the
      same thing, which this patch implements.  Less code, easier
      to grok.  No change in behaviour though.
      
      (cherry picked from commit 1e06d8b8)
      208c3ec2
    • Simon Marlow's avatar
      Make the test fail if compiled without -threaded · 67f00af6
      Simon Marlow authored and Ben Gamari's avatar Ben Gamari committed
      Test Plan: validate
      
      Reviewers: bgamari, austin, erikd
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3387
      
      (cherry picked from commit c77551ab)
      67f00af6
    • Simon Marlow's avatar
      Fix #13433 · bdcb0c85
      Simon Marlow authored and Ben Gamari's avatar Ben Gamari committed
      Summary: See comments for details.
      
      Test Plan: validate
      
      Reviewers: mpickering, bgamari, austin, erikd
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3386
      
      (cherry picked from commit 074d13eb)
      bdcb0c85
    • Ben Gamari's avatar
      base: Check for path separators chars in openTempFile' template string · 02a9c6a3
      Ben Gamari authored
      This fixes #13489.
      
      (cherry picked from commit b04ded8f)
      02a9c6a3
    • Simon Marlow's avatar
      More fixes for #5654 · 8a1f4e59
      Simon Marlow authored and Ben Gamari's avatar Ben Gamari committed
      * In stg_ap_0_fast, if we're evaluating a thunk, the thunk might
        evaluate to a function in which case we may have to adjust its CCS.
      
      * The interpreter has its own implementation of stg_ap_0_fast, so we
        have to do the same shenanigans with creating empty PAPs and copying
        PAPs there.
      
      * GHCi creates Cost Centres as children of CCS_MAIN, which enterFunCCS()
        wrongly assumed to imply that they were CAFs.  Now we use the is_caf
        flag for this, which we have to correctly initialise when we create a
        Cost Centre in GHCi.
      
      (cherry picked from commit 3a18baff)
      8a1f4e59
    • Simon Marlow's avatar
      Fix bug in previous fix for #5654 · fd269386
      Simon Marlow authored and Ben Gamari's avatar Ben Gamari committed
      I forgot to account for BCOs, which have a different layout from
      functions.  This caused crashes when using profiling with GHCi (via
      -fexternal-interpreter -prof), which unfortunately is not tested at all
      by validate, even when profiling is enabled.  I'm going to add some
      testing that would have caught this in a separate patch.
      
      Test Plan:
      ```
      cd nofib/spectral/puzzle && make NoFibWithGHCi=YES
      EXTRA_RUNTEST_OPTS='-fexternal-interpreter -prof'
      ```
      New testsuite tests coming in a separate diff.
      
      Reviewers: niteria, austin, erikd, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2868
      
      GHC Trac Issues: #5654
      
      (cherry picked from commit 2a02040b)
      fd269386
    • Simon Marlow's avatar
      Fix cost-centre-stacks bug (#5654) · 9a1ac01f
      Simon Marlow authored and Ben Gamari's avatar Ben Gamari committed
      This fixes some cases of wrong stacks being generated by the profiler.
      For background and details on the fix see
      `Note [Evaluating functions with profiling]` in `rts/Apply.cmm`.
      
      This does have an impact on allocations for some programs when
      profiling.  nofib results:
      
      ```
         k-nucleotide          +0.0%     +8.8%    +11.0%    +11.0%      0.0%
               puzzle          +0.0%    +12.5%     0.244     0.246      0.0%
            typecheck           0.0%     +8.7%    +16.1%    +16.2%      0.0%
      ------------------------------------------------------------------------
      --------
                  Min          -0.0%     -0.0%    -34.4%    -35.5%    -25.0%
                  Max          +0.0%    +12.5%    +48.9%    +49.4%    +10.6%
       Geometric Mean          +0.0%     +0.6%     +2.0%     +1.8%     -0.3%
      
      ```
      
      But runtimes don't seem to be affected much, and the examples I looked
      at were completely legitimate.  For example, in puzzle we have this:
      
      ```
      position :: ItemType -> StateType ->  BankType
      position Bono = bonoPos
      position Edge = edgePos
      position Larry = larryPos
      position Adam = adamPos
      ```
      
      where the identifiers on the rhs are all record selectors.  Previously
      the profiler gave a stack that looked like
      
      ```
        position
        bonoPos
        ...
      ```
      
      i.e. `bonoPos` was at the same level of the call stack as `position`,
      but now it looks like
      
      ```
        position
         bonoPos
         ...
      ```
      
      I used the normaliser from the testsuite to diff the profiling output
      from other nofib programs and they all looked better.
      
      Test Plan:
      * the broken test passes
      * validate
      * compiled and ran all of nofib, measured perf, diff'd several .prof
      files
      
      Reviewers: niteria, erikd, austin, scpmw, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2804
      
      GHC Trac Issues: #5654, #10007
      
      (cherry picked from commit 394231b3)
      9a1ac01f
    • Joachim Breitner's avatar
      Zap Call Arity info in the simplifier · d88d0258
      Joachim Breitner authored and Ben Gamari's avatar Ben Gamari committed
      As #13479 shows, there are corner cases where the simplifier decides to
      not eta-expand a function as much as its call arity would suggest, but
      instead transforms the code that the call arity annotation becomes a
      lie.
      
      As the call arity information is only meant to be used by the
      immediatelly following simplifier run, it makes sense to simply zap the
      information there.
      
      Differential Revision: https://phabricator.haskell.org/D3390
      
      (cherry picked from commit e07211f7)
      d88d0258
  2. Mar 27, 2017
  3. Mar 24, 2017
    • rwbarton's avatar
      x86 nativeGen: Fix test with mask in range [128,255] (#13425) · 85dc0627
      rwbarton authored and Ben Gamari's avatar Ben Gamari committed
      My commit bdb0c43c optimized the encoding of instructions to test
      tag bits, but it did not always set exactly the same condition codes
      since the testb instruction does a single-byte comparison, rather
      than a full-word comparison.
      
      It would be correct to optimize the expression `x .&. 128 > 0` to
      the sequence
      
          testb $128, %al
          seta %al         ; note: 'a' for unsigned comparison,
                           ; not 'g' for signed comparison
      
      but the pretty-printer is not the right place to make this kind of
      context-sensitive optimization.
      
      Test Plan: harbormaster
      
      Reviewers: trofi, austin, bgamari, dfeuer
      
      Reviewed By: trofi, dfeuer
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3359
      
      (cherry picked from commit caf94b06)
      85dc0627
    • Ben Gamari's avatar
      config.mk.in: Add bzip, gzip, and xz executable names to be overridden · efa9f0fe
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Reviewers: austin, hvr, erikd
      
      Reviewed By: erikd
      
      Subscribers: rwbarton, thomie, erikd, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3367
      
      (cherry picked from commit 1b374402)
      efa9f0fe
    • Rufflewind's avatar
      Allow colors to be customized · 7141a183
      Rufflewind authored and Ben Gamari's avatar Ben Gamari committed
      Allow customization of diagnostic colors through the GHC_COLORS
      environment variable.  Some color-related code have been refactored to
      PprColour to reduce the circular dependence between DynFlags,
      Outputable, ErrUtils.  Some color functions that were part of Outputable
      but were never used have been deleted.
      
      Test Plan: validate
      
      Reviewers: austin, hvr, bgamari, dfeuer
      
      Reviewed By: bgamari, dfeuer
      
      Subscribers: dfeuer, rwbarton, thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3364
      
      (cherry picked from commit adf27d61)
      7141a183
  4. Mar 23, 2017
  5. Mar 22, 2017
    • Edward Z. Yang's avatar
      Correctly account for -package-db ordering when picking packages. · 1682980d
      Edward Z. Yang authored
      
      Summary:
      When I originally implemented ABI-based shadowing as per
      ee4e1654, I switched our strategy
      from pasting together lists to creating a map of all units first,
      and then selecting packages from this.  However, what I did
      not realize when doing this was that we actually depended
      on the *ordering* of these lists later, when we selected
      a preferred package to use.
      
      The crux is if I have -package-db db1 -package-db db2 -package p-0.1,
      and p-0.1 is provided by both db1 and db2, which one does the
      -package flag select?  Previously, this was undetermined; now
      we always select the instance from the LATEST package database.
      (If p-0.1 shows up multiple times in the same database, once again
      the chosen package is undefined.)
      
      The reason why cabal08 intermittently failed was that, in practice,
      we were sorting on the UnitId, so when we bumped version numbers,
      that often wibbled the UnitIds so that they compared oppositely.
      I've extended the test so that we check that the relation is
      antisymmetric.
      
      Fixes #13313
      
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, austin
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3369
      
      (cherry picked from commit e0eaea91)
      1682980d
    • David Feuer's avatar
      Make unsafeInterleaveST less unsafe · 167548f4
      David Feuer authored
      * Make `unsafeInterleaveST` use `noDuplicate#` like
      `unsafeInterleaveIO` does to prevent the suspended action from
      being run in two threads.
      
      * In order to accomplish this without `unsafeCoerce#`, generalize
      the type of `noDuplicate#`.
      
      * Add `unsafeDupableInterleaveST` to get the old behavior.
      
      * Document unsafe `ST` functions and clean up some related
      documentation.
      
      Fixes #13457
      
      Reviewers: austin, hvr, bgamari, ekmett
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3370
      
      (cherry picked from commit 30d68d63)
      167548f4
  6. Mar 21, 2017
Loading