1. 24 May, 2016 7 commits
    • niteria's avatar
      Document some benign nondeterminism · 4c6e69d5
      niteria authored
      I've changed the functions to their nonDet equivalents and explained
      why they're OK there. This allowed me to remove foldNameSet,
      foldVarEnv, foldVarEnv_Directly, foldVarSet and foldUFM_Directly.
      
      Test Plan: ./validate, there should be no change in behavior
      
      Reviewers: simonpj, simonmar, austin, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2244
      
      GHC Trac Issues: #4012
      4c6e69d5
    • Josh Price's avatar
      Add support for unicode TH quotes (#11743) · 8f7d0163
      Josh Price authored
      I've also added cases for `IToparenbar` and `ITcparenbar` (aka banana
      brackets) to `isUnicode`.
      
      Document unicode TH quote alternatives (#11743)
      
      Test Plan: ./validate
      
      Reviewers: austin, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2185
      
      GHC Trac Issues: #11743
      8f7d0163
    • Gabor Greif's avatar
      Spelling · 1bf5c126
      Gabor Greif authored
      1bf5c126
    • Simon Peyton Jones's avatar
      Comments only · 9c3e55bd
      Simon Peyton Jones authored
      9c3e55bd
    • Simon Peyton Jones's avatar
      Remove unused Type.splitFunTysN · 839b4248
      Simon Peyton Jones authored
      839b4248
    • Simon Peyton Jones's avatar
      Spelling in comment · eb8eb02b
      Simon Peyton Jones authored
      eb8eb02b
    • Simon Peyton Jones's avatar
      Don't split the arg types in a PatSyn signature · 03d89603
      Simon Peyton Jones authored
      This patch fixes Trac #11977, and #12108, rather satisfactorily
      maily by deleting code!
      
        pattern P :: Eq a => a -> a -> Int
      
      The idea is simply /not/ to split the bit after the '=>' into the
      pattern argument types, but to keep the (a->a->Int) part
      un-decomposed, in the patsig_body_ty field of a TcPatSynInfo.
      
      There is one awkward wrinkle, which is that we can't split the
      implicitly-bound type variables into existential and universal until
      we know which types are arguments and which are part of the result.
      So we postpone the decision until we have the declaration in hand.
      See TcPatSyn Note [The pattern-synonym signature splitting rule]
      03d89603
  2. 23 May, 2016 3 commits
  3. 22 May, 2016 1 commit
  4. 21 May, 2016 2 commits
    • Andrew Farmer's avatar
      Fix deriving Ord when RebindableSyntax is enabled · 527ed724
      Andrew Farmer authored
      Deriving clauses (Ord especially) generated if-expressions with nlHsIf
      which were subject to RebindableSyntax. This changes nlHsIf to generate
      concrete if-expressions.
      
      There was also an error about calling tagToEnum# at a polymorphic type,
      which is not allowed. Fixing nlHsIf didn't fix this for some reason, so
      I generated a type ascription around the call to tagToEnum#. Not sure
      why the typechecker could not figure this out.
      
      Test Plan: Added a test, ran validate.
      
      Reviewers: simonpj, simonmar, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2247
      
      GHC Trac Issues: #12080
      527ed724
    • 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
  5. 20 May, 2016 1 commit
  6. 19 May, 2016 5 commits
  7. 18 May, 2016 7 commits
    • niteria's avatar
      Kill varEnvElts in tcPragExpr · 13e40f99
      niteria authored
      I had to refactor some things to take VarSet instead of [Var],
      but I think it's more precise this way.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, simonpj, austin, bgamari, goldfire
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2227
      
      GHC Trac Issues: #4012
      13e40f99
    • niteria's avatar
      Kill varSetElems in tidyFreeTyCoVars · 6282bc31
      niteria authored
      I haven't observed this to have an effect on nondeterminism,
      but tidyOccName appears to modify the TidyOccEnv in a
      way dependent on the order of inputs.
      It's easy enough to change it to be deterministic to be on the
      safe side.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2238
      
      GHC Trac Issues: #4012
      6282bc31
    • Ben Gamari's avatar
      CLabel: Catch #11155 during C-- pretty-printing · f091218a
      Ben Gamari authored
      In #11555 we ended up generating references to the non-existence
      stg_ap_0_upd. Here we add asserts to verify that we don't generate
      references to non-existent selector or application symbols.
      
      It would likely also make sense to add further asserts during code
      generation, so we can catch the issue even closer to its source.
      
      Test Plan: Validate
      
      Reviewers: simonmar, austin, ezyang
      
      Reviewed By: simonmar, austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2230
      
      GHC Trac Issues: #11155
      f091218a
    • Ben Gamari's avatar
      rts: Add isPinnedByteArray# primop · 310371ff
      Ben Gamari authored
      Adds a primitive operation to determine whether a particular
      `MutableByteArray#` is backed by a pinned buffer.
      
      Test Plan: Validate with included testcase
      
      Reviewers: austin, simonmar
      
      Reviewed By: austin, simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2217
      
      GHC Trac Issues: #12059
      310371ff
    • Dave Laing's avatar
      Rework parser to allow use with DynFlags · 39a2faa0
      Dave Laing authored
      Split out the options needed by the parser from DynFlags, making the
      parser more friendly to standalone usage.
      
      Test Plan: validate
      
      Reviewers: simonmar, alanz, bgamari, austin, thomie
      
      Reviewed By: simonmar, alanz, bgamari, thomie
      
      Subscribers: thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2208
      
      GHC Trac Issues: #10961
      39a2faa0
    • mlen's avatar
      Fix histograms for ticky code · f0f0ac85
      mlen authored
      This patch fixes Cmm generation required to produce histograms when
      compiling with -ticky flag, strips dead code from rts/Ticky.c and
      reworks it to use a shared constant in both C and Haskell code.
      
      Fixes #8308.
      
      Test Plan: T8308
      
      Reviewers: jstolarek, simonpj, austin
      
      Reviewed By: simonpj
      
      Subscribers: mpickering, simonpj, bgamari, mlen, thomie, jstolarek
      
      Differential Revision: https://phabricator.haskell.org/D931
      
      GHC Trac Issues: #8308
      f0f0ac85
    • niteria's avatar
      Make inert_model and inert_eqs deterministic sets · fffe3a25
      niteria authored
      The order inert_model and intert_eqs fold affects the order that the
      typechecker looks at things. I've been able to experimentally confirm
      that the order of equalities and the order of the model matter for
      determinism. This is just a straigthforward replacement of
      nondeterministic VarEnv for deterministic DVarEnv.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, goldfire, austin, bgamari, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2232
      
      GHC Trac Issues: #4012
      fffe3a25
  8. 17 May, 2016 1 commit
  9. 16 May, 2016 3 commits
    • niteria's avatar
      Kill varSetElems in tcInferPatSynDecl · 21fe4ffd
      niteria authored
      varSetElems introduces unnecessary non-determinism and while
      I didn't estabilish experimentally that this matters here
      I'm convinced that it will, because I expect pattern synonyms
      to end up in interface files.
      
      Test Plan: ./validate
      
      Reviewers: austin, simonmar, bgamari, mpickering, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2206
      
      GHC Trac Issues: #4012
      21fe4ffd
    • Ben Gamari's avatar
      Move Extension type to ghc-boot-th · eed820b6
      Ben Gamari authored
      This creates a new package, `ghc-boot-th`, to contain the `Extension`
      type, which now lives in `GHC.LanguageExtension.Type`. This ensures that
      the transitive dependency set of the `template-haskell` package remains
      minimal.
      
      The `GHC.LanguageExtensions.Type` module is also re-exported by
      `ghc-boot`, which provides an orphan `binary` instance as well.
      
      Test Plan: Validate
      
      Reviewers: goldfire, thomie, hvr, austin
      
      Reviewed By: thomie
      
      Subscribers: RyanGlScott, thomie, erikd, ezyang
      
      Differential Revision: https://phabricator.haskell.org/D2224
      eed820b6
    • Peter Trommler's avatar
      PPC NCG: Fix pretty printing of st[wd]ux instr. · 2dbdc79b
      Peter Trommler authored
      Printing STU was mixed up. The tab character must appear
      after the 'x'.
      
      Test Plan: validate on powerpc
      
      Reviewers: bgamari, austin, erikd
      
      Reviewed By: austin, erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2214
      
      GHC Trac Issues: #12054
      2dbdc79b
  10. 15 May, 2016 1 commit
    • Ömer Sinan Ağacan's avatar
      Fix a performance issue with -fprint-expanded-synonyms · e4834edf
      Ömer Sinan Ağacan authored
      The type synonym expander was doing redundant work by looking at same
      types again and again. This patch fixes the loop code when both of the
      types can be expanded, to do `O(min(n, m))` comparisons and `O(n + m)`
      expansions, where `n` is expansions of the first type and `m` is
      expansions of the second type.
      
      Reported by sjcjoosten in T10547.
      
      Test Plan:
      Added a regression test that was taking several minutes to type check
      before this patch.
      
      Reviewers: bgamari, simonpj, austin, ezyang
      
      Reviewed By: bgamari, simonpj, austin, ezyang
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2198
      
      GHC Trac Issues: #10547
      e4834edf
  11. 12 May, 2016 9 commits
    • niteria's avatar
      Refactor some ppr functions to use pprUFM · 5416fadb
      niteria authored
      Nondeterminism doesn't matter in these places and pprUFM makes
      it obvious. I've flipped the order of arguments for convenience.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, bgamari, austin, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2205
      
      GHC Trac Issues: #4012
      5416fadb
    • niteria's avatar
      Kill varEnvElts in specImports · 6bf0eef7
      niteria authored
      We need the order of specialized binds and rules to be deterministic,
      so we use a deterministic set here.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, bgamari, austin, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2197
      
      GHC Trac Issues: #4012
      6bf0eef7
    • niteria's avatar
      Document zonkTyCoVarsAndFV determinism · 01bc1096
      niteria authored
      I've changed it to use nonDetEltsUFM and documented why
      it's OK.
      
      Test Plan: it builds
      
      Reviewers: bgamari, austin, simonmar, goldfire, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2204
      
      GHC Trac Issues: #4012
      01bc1096
    • Ryan Scott's avatar
      Allow putting Haddocks on derived instances · 69714306
      Ryan Scott authored
      Currently, one can document top-level instance declarations, but derived
      instances (both those in `deriving` clauses and standalone `deriving`
      instances) do not enjoy the same privilege. This makes the necessary
      changes to the parser to enable attaching Haddock comments for derived
      instances.
      
      Updates haddock submodule.
      
      Fixes #11768.
      
      Test Plan: ./validate
      
      Reviewers: hvr, bgamari, austin
      
      Reviewed By: austin
      
      Subscribers: thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2175
      
      GHC Trac Issues: #11768
      69714306
    • Ryan Scott's avatar
      Make Generic1 poly-kinded · b8e25651
      Ryan Scott authored
      This generalizes the `Generic1` typeclass to be of kind `k -> *`, and
      this also makes the relevant datatypes and typeclasses in `GHC.Generics`
      poly-kinded. If `PolyKinds` is enabled, `DeriveGeneric` derives
      `Generic1` instances such that they use the most general kind possible.
      Otherwise, deriving `Generic1` defaults to make an instance where the
      argument is of kind `* -> *` (the current behavior).
      
      Fixes #10604. Depends on D2117.
      
      Test Plan: ./validate
      
      Reviewers: kosmikus, dreixel, goldfire, austin, hvr, simonpj, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie, ekmett
      
      Differential Revision: https://phabricator.haskell.org/D2168
      
      GHC Trac Issues: #10604
      b8e25651
    • Ryan Scott's avatar
      Fix deriveTyData's kind unification when two kind variables are unified · e53f2180
      Ryan Scott authored
      When `deriveTyData` attempts to unify two kind variables (which can
      happen if both the typeclass and the datatype are poly-kinded), it
      mistakenly adds an extra mapping to its substitution which causes the
      unification to fail when applying the substitution. This can be
      prevented by checking both the domain and the range of the original
      substitution to see which kind variables shouldn't be put into the
      domain of the substitution. A more in-depth explanation is included in
      `Note [Unification of two kind variables in deriving]`.
      
      Fixes #11837.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, hvr, goldfire, niteria, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: niteria, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2117
      
      GHC Trac Issues: #11837
      e53f2180
    • bollmann's avatar
      Add TH support for pattern synonyms (fixes #8761) · c079de3c
      bollmann authored
      This commit adds Template Haskell support for pattern synonyms as
      requested by trac ticket #8761.
      
      Test Plan: ./validate
      
      Reviewers: thomie, jstolarek, osa1, RyanGlScott, mpickering, austin,
      goldfire, bgamari
      
      Reviewed By: goldfire, bgamari
      
      Subscribers: rdragon
      
      Differential Revision: https://phabricator.haskell.org/D1940
      
      GHC Trac Issues: #8761
      c079de3c
    • niteria's avatar
      Make absentError not depend on uniques · 925b0aea
      niteria authored
      As explained in the comment it will cause changes in
      inlining if we don't suppress them.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, austin, simonpj, goldfire, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2203
      
      GHC Trac Issues: #4012
      925b0aea
    • Edward Z. Yang's avatar
      Don't prematurely force TyThing thunks with -ddump-if-trace. · da105ca1
      Edward Z. Yang authored
      
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2187
      da105ca1