1. 05 Oct, 2019 1 commit
  2. 03 Oct, 2019 15 commits
  3. 01 Oct, 2019 14 commits
    • Ömer Sinan Ağacan's avatar
      Make small INLINE functions behave properly · 8924224e
      Ömer Sinan Ağacan authored
      Simon writes:
      Currently we check for a type arg rather than isTyCoArg.   This in turn
      makes INLINE things look bigger than they should be, and stops them
      being inlined into boring contexts when they perfectly well could be.
          f x = g <refl> x
          {-# INLINE g #-}
          ... (map (f x) xs) ...
      The context is boring, so don't inline unconditionally.  But f's RHS is
      no bigger than its call, provided you realise that the coercion argument
      is ultimately cost-free.
      This happens in practice for $WHRefl. It's not a big deal: at most it
      means we have an extra function call overhead.  But it's untidy, and
      actually worse than what happens without an INLINE pragma.
      Fixes #17182
      This makes 0.0% change in nofib binary sizes.
    • David Eichmann's avatar
      Hadrian: do not cache GHC configure rule · 0956c194
      David Eichmann authored
    • David Eichmann's avatar
    • Ryan Scott's avatar
      Refactor some cruft in TcDeriv · 9c002177
      Ryan Scott authored
      * `mk_eqn_stock`, `mk_eqn_anyclass`, and `mk_eqn_no_mechanism` all
        took a continuation of type
        `DerivSpecMechanism -> DerivM EarlyDerivSpec` to represent its
        primary control flow. However, in practice this continuation was
        always instantiated with the `mk_originative_eqn` function, so
        there's not much point in making this be a continuation in the
        first place.
        This patch removes these continuations in favor of invoking
        `mk_originative_eqn` directly, which is simpler.
      * There were several parts of `TcDeriv` that took different code
        paths if compiling an `.hs-boot` file. But this is silly, because
        ever since 101a8c77 we simply error
        eagerly whenever attempting to derive any instances in an
        `.hs-boot` file.
        This patch removes all of the unnecessary `.hs-boot` code paths,
        leaving only one (which errors out).
      * Remove various error continuation arguments from `mk_eqn_stock`
        and related functions.
    • Sebastian Graf's avatar
      Add testcases inspired by Luke Maranget's pattern match series · 58013220
      Sebastian Graf authored
      In his paper "Warnings for Pattern Matching", Luke Maranget describes
      three series in his appendix for which GHC's pattern match checker
      scaled very badly. We mostly avoid this now with !1752. This commit adds
      regression tests for each of the series.
      Fixes #17264.
    • Sebastian Graf's avatar
      Add a bunch of testcases for the pattern match checker · 6548b7b0
      Sebastian Graf authored
      Adds regression tests for tickets #17207, #17208, #17215, #17216,
       #17218, #17219, #17248
    • Ben Gamari's avatar
      Bump process submodule · 822481d5
      Ben Gamari authored
      Marks process003 as fragile, as noted in #17245.
    • Ben Gamari's avatar
    • Vladislav Zavialov's avatar
      Do not rely on CUSKs in 'base' · bdba6ac2
      Vladislav Zavialov authored
      Use standalone kind signatures instead of complete user-specified kinds
      in Data.Type.Equality and Data.Typeable
    • Takenobu Tani's avatar
      testsuite: Add minimal test for :doc command · b36dd49b
      Takenobu Tani authored
      Currently, there are no testcases for GHCi `:doc` command.
      Perhaps because it was experimental. And it could be changed in the future.
      But `:doc` command is already useful, so I add a minimal regression test
      to keep current behavior.
      See also 85309a3c for implementation of `:doc` command.
    • Sebastian Graf's avatar
    • Takenobu Tani's avatar
      Add help message for GHCi :instances command · 97811ef5
      Takenobu Tani authored
      This commit updates GHCi's help message for GHC 8.10.
    • Simon Peyton Jones's avatar
      Fix arguments for unbound binders in RULE application · 6a1700aa
      Simon Peyton Jones authored
      We were failing to correctly implement Note [Unbound RULE binders]
      in Rules.hs.  In particular, when cooking up a fake Refl,
      were were failing to apply the substitition.
      This patch fixes that problem, and simultaneously tidies
      up the impedence mis-match between RuleSubst and TCvSubst.
      Thanks to Sebastian!
    • Ömer Sinan Ağacan's avatar
      Refactor iface file generation: · f3cb8c7c
      Ömer Sinan Ağacan authored
      This commit refactors interface file generation to allow information
      from the later passed (NCG, STG) to be stored in interface files.
      We achieve this by splitting interface file generation into two parts:
      * Partial interfaces, built based on the result of the core pipeline
      * A fully instantiated interface, which also contains the final
      fingerprints and can optionally contain information produced by the backend.
      This change is required by !1304 and !1530.
      -dynamic-too handling is refactored too: previously when generating code
      we'd branch on -dynamic-too *before* code generation, but now we do it
      (Original code written by @AndreasK in !1530
      Before this patch interface files where created and immediately flushed
      to disk which made space leaks impossible.
      With this change we instead use NFData to force all iface related data
      structures to avoid space leaks.
      In the process of refactoring it was discovered that the code in the
      ToIface Module allocated a lot of thunks which were immediately forced
      when writing/forcing the interface file. So we made this module more
      strict to avoid creating many of those thunks.
      Bottom line is that allocations go down by about ~0.1% compared to
      Residency is not meaningfully different after this patch.
      Runtime was not benchmarked.
      Co-Authored-By: Andreas Klebinger's avatarAndreas Klebinger <klebinger.andreas@gmx.at>
      Co-Authored-By: Ömer Sinan Ağacan's avatarÖmer Sinan Ağacan <omer@well-typed.com>
  4. 28 Sep, 2019 10 commits
    • Sebastian Graf's avatar
      `exprOkForSpeculation` for Note [IO hack in the demand analyser] · ce64b397
      Sebastian Graf authored
      In #14998 I realised that the notion of speculative execution
      *exactly matches* eager evaluation of expressions in a case alternative
      where the scrutinee is an IO action.
      Normally we have to `deferIO` any result from that single case
      alternative to prevent this speculative execution, so we had a special
      case in place in the demand analyser that would check if the scrutinee
      was a prim-op, in which case we assumed that it would be ok to do the
      eager evaluation.
      Now we just check if the scrutinee is `exprOkForSpeculation`,
      corresponding to the notion that we want to push evaluation of the
      scrutinee *after* eagerly evaluating stuff from the case alternative.
      This fixes #14988, because it resolves the last open Item 4 there.
    • Sebastian Graf's avatar
      PmCheck: No ConLike instantiation in pmcheck · c5d888d4
      Sebastian Graf authored
      `pmcheck` used to call `refineToAltCon` which would refine the knowledge
      we had about a variable by equating it to a `ConLike` application.
      Since we weren't particularly smart about this in the Check module, we
      simply freshened the constructors existential and term binders utimately
      through a call to `mkOneConFull`.
      But that instantiation is unnecessary for when we match against a
      concrete pattern! The pattern will already have fresh binders and field
      types. So we don't call `refineToAltCon` from `Check` anymore.
      Subsequently, we can simplify a couple of call sites and functions in
      `PmOracle`. Also implementing `computeCovered` becomes viable and we
      don't have to live with the hack that was `addVarPatVecCt` anymore.
      A side-effect of not indirectly calling `mkOneConFull` anymore is that
      we don't generate the proper strict argument field constraints anymore.
      Instead we now desugar ConPatOuts as if they had bangs on their strict
      fields. This implies that `PmVar` now carries a `HsImplBang` that we
      need to respect by a (somewhat ephemeral) non-void check. We fix #17234
      in doing so.
    • Ben Gamari's avatar
      testsuite: Mark TH tests as fragile in LLVM built external-interpreter · 6f9fa0be
      Ben Gamari authored
      Due to #16087. This drops the previous explicit list of broken tests and rather
      encompasses the entire set of tests since they all appear to be broken.
    • Ben Gamari's avatar
      testsuite: Mark T3389 as broken in profiled ways on i386 · ad2a1f99
      Ben Gamari authored
      As noted in #17256.
    • Ben Gamari's avatar
      testsuite: Mark hs_try_putmvar003 as fragile in threaded1 · bb984ac6
      Ben Gamari authored
      Due to #16361. Note that I'm leaving out threaded2 since it's not clear
      whether the single crash in that way was due to other causes.
    • Ben Gamari's avatar
      testsuite: Mark compact_gc as fragile in the ghci way · e0bbb961
      Ben Gamari authored
      As noted in #17253.
    • Daniel Gröber (dxld)'s avatar
      Raise minimum GHC version to 8.6 · 24620182
      Daniel Gröber (dxld) authored
      commit 795986aa ("Remove unneeded CPP now that GHC 8.6 is the minimum")
      broke the 8.4 build.
    • Ben Gamari's avatar
      testsuite: Mark cgrun071 as broken on i386 · 0b1fa64d
      Ben Gamari authored
      As described in #17247.
    • Shayne Fletcher's avatar
    • Sebastian Graf's avatar
      PmCheck: Look at precendence to give type signatures to some wildcards · 1582dafa
      Sebastian Graf authored
      Basically do what we currently only do for -XEmptyCase in other cases
      where adding the type signature won't distract from pattern
      matches in other positions.
      We use the precedence to guide us, equating "need to parenthesise" with
      "too much noise".