1. 02 Jun, 2020 1 commit
  2. 01 Jun, 2020 1 commit
  3. 29 May, 2020 10 commits
    • Alp Mestanogullari's avatar
      hadrian: introduce 'install' target · f9a513e0
      Alp Mestanogullari authored
      Its logic is very simple. It `need`s the `binary-dist-dir` target
      and runs suitable `configure` and `make install` commands for the
      user. A new `--prefix` command line argument is introduced to
      specify where GHC should be installed.
      f9a513e0
    • Gleb Popov's avatar
      998450f4
    • Jeremy Schlatter's avatar
      Fix typo in documentation · 8b494895
      Jeremy Schlatter authored
      8b494895
    • Simon Jakobi's avatar
      base: Scrap deprecation plan for Data.Monoid.{First,Last} · f44d7ae0
      Simon Jakobi authored
      See the discussion on the libraries mailing list for context:
      
      https://mail.haskell.org/pipermail/libraries/2020-April/030357.html
      f44d7ae0
    • Ben Gamari's avatar
      Eta expand un-saturated primops · 277c2f26
      Ben Gamari authored
      Now since we no longer try to predict CAFfyness we have no need for the
      solution to #16846. Eta expanding unsaturated primop applications is
      conceptually simpler, especially in the presence of levity polymorphism.
      
      This essentially reverts cac8dc9f,
      as suggested in #18079.
      
      Closes #18079.
      277c2f26
    • Ben Gamari's avatar
      Allow simplification through runRW# · 46720997
      Ben Gamari authored
      Because runRW# inlines so late, we were previously able to do very
      little simplification across it. For instance, given even a simple
      program like
      
          case runRW# (\s -> let n = I# 42# in n) of
            I# n# -> f n#
      
      we previously had no way to avoid the allocation of the I#.
      
      This patch allows the simplifier to push strict contexts into the
      continuation of a runRW# application, as explained in
      in Note [Simplification of runRW#] in GHC.CoreToStg.Prep.
      
      Fixes #15127.
      
      Metric Increase:
          T9961
      Metric Decrease:
          ManyConstructors
      Co-Authored-By: Simon Peyton Jones's avatarSimon Peyton-Jone <simonpj@microsoft.com>
      46720997
    • Simon Peyton Jones's avatar
      Do not float join points in exprIsConApp_maybe · c49f7df0
      Simon Peyton Jones authored
      We hvae been making exprIsConApp_maybe cleverer in recent times:
      
          commit b78cc64e
          Date:   Thu Nov 15 17:14:31 2018 +0100
          Make constructor wrappers inline only during the final phase
      
          commit 7833cf40
          Date:   Thu Jan 24 17:58:50 2019 +0100
          Look through newtype wrappers (Trac #16254)
      
          commit c25b135f
          Date:   Thu Feb 21 12:03:22 2019 +0000
          Fix exprIsConApp_maybe
      
      But alas there was still a bug, now immortalised in
        Note [Don't float join points]
      in SimpleOpt.
      
      It's quite hard to trigger because it requires a dead
      join point, but it came up when compiling Cabal
      Cabal.Distribution.Fields.Lexer.hs, when working on
      !3113.
      
      Happily, the fix is extremly easy.  Finding the
      bug was not so easy.
      c49f7df0
    • Simon Peyton Jones's avatar
      Make Lint check return type of a join point · 0e3361ca
      Simon Peyton Jones authored
      Consider
         join x = rhs in body
      It's important that the type of 'rhs' is the same as the type of
      'body', but Lint wasn't checking that invariant.
      
      Now it does!  This was exposed by investigation into !3113.
      0e3361ca
    • Ben Gamari's avatar
      CoreToStg: Add Outputable ArgInfo instance · bbeb2389
      Ben Gamari authored
      bbeb2389
    • Andreas Klebinger's avatar
      Fix "build/elem" RULE. · f10d11fa
      Andreas Klebinger authored
      An redundant constraint prevented the rule from matching.
      
      Fixing this allows a call to elem on a known list to be translated
      into a series of equality checks, and eventually a simple case
      expression.
      
      Surprisingly this seems to regress elem for strings. To avoid
      this we now also allow foldrCString to inline and add an UTF8
      variant. This results in elem being compiled to a tight
      non-allocating loop over the primitive string literal which
      performs a linear search.
      
      In the process this commit adds UTF8 variants for some of the
      functions in GHC.CString. This is required to make this work for
      both ASCII and UTF8 strings.
      
      There are also small tweaks to the CString related rules.
      We now allow ourselfes the luxury to compare the folding function
      via eqExpr, which helps to ensure the rule fires before we inline
      foldrCString*. Together with a few changes to allow matching on both
      the UTF8 and ASCII variants of the CString functions.
      f10d11fa
  4. 28 May, 2020 9 commits
    • Ben Gamari's avatar
      Rip out CmmStackInfo(updfr_space) · 13d9380b
      Ben Gamari authored
      As noted in #18232, this field is currently completely unused and
      moreover doesn't have a clear meaning.
      13d9380b
    • Ben Gamari's avatar
      hadrian: Don't track GHC's verbosity argument · 8f021b8c
      Ben Gamari authored
      Teach hadrian to ignore GHC's -v argument in its recompilation check,
      thus fixing #18131.
      8f021b8c
    • Ben Gamari's avatar
      Ticky-ticky: Record DataCon name in ticker name · aef95f11
      Ben Gamari authored
      This makes it significantly easier to spot the nature of
      allocations regressions and comes at a reasonably low cost.
      aef95f11
    • Sebastian Graf's avatar
      DmdAnal: Recognise precise exceptions from case alternatives (#18086) · 08dab5f7
      Sebastian Graf authored
      Consider
      
      ```hs
      m :: IO ()
      m = do
        putStrLn "foo"
        error "bar"
      ```
      
      `m` (from #18086) always throws a (precise or imprecise) exception or
      diverges. Yet demand analysis infers `<L,A>` as demand signature instead
      of `<L,A>x` for it.
      
      That's because the demand analyser sees `putStrLn` occuring in a case
      scrutinee and decides that it has to `deferAfterPreciseException`,
      because `putStrLn` throws a precise exception on some control flow
      paths. This will mask the `botDiv` `Divergence`of the single case alt
      containing `error` to `topDiv`. Since `putStrLn` has `topDiv` itself,
      the final `Divergence` is `topDiv`.
      
      This is easily fixed: `deferAfterPreciseException` works by `lub`ing
      with the demand type of a virtual case branch denoting the precise
      exceptional control flow. We used `nopDmdType` before, but we can be
      more precise and use `exnDmdType`, which is `nopDmdType` with `exnDiv`.
      
      Now the `Divergence` from the case alt will degrade `botDiv` to `exnDiv`
      instead of `topDiv`, which combines with the result from the scrutinee
      to `exnDiv`, and all is well.
      
      Fixes #18086.
      08dab5f7
    • Sebastian Graf's avatar
      FloatOut: Only eta-expand dead-end RHS if arity will increase (#18231) · 10e6982c
      Sebastian Graf authored
      Otherwise we risk turning trivial RHS into non-trivial RHS, introducing
      unnecessary bindings in the next Simplifier run, resulting in more
      churn.
      
      Fixes #18231.
      10e6982c
    • xldenis's avatar
      Fix #18071 · dc5f004c
      xldenis authored
      Run the core linter on candidate instances to ensure they are
      well-kinded.
      
      Better handle quantified constraints by using a CtWanted to avoid
      having unsolved constraints thrown away at the end by the solver.
      dc5f004c
    • Vladislav Zavialov's avatar
      Add Semigroup/Monoid for Q (#18123) · 5f621a78
      Vladislav Zavialov authored
      5f621a78
    • Ben Gamari's avatar
      Avoid unnecessary allocations due to tracing utilities · 1f393e1e
      Ben Gamari authored
      While ticky-profiling the typechecker I noticed that hundreds of
      millions of SDocs are being allocated just in case -ddump-*-trace is
      enabled. This is awful.
      
      We avoid this by ensuring that the dump flag check is inlined into the
      call site, ensuring that the tracing document needn't be allocated
      unless it's actually needed.
      
      See Note [INLINE conditional tracing utilities] for details.
      
      Fixes #18168.
      
      Metric Decrease:
        T9961
        haddock.Cabal
        haddock.base
        haddock.compiler
      1f393e1e
    • Ben Gamari's avatar
      GHC.Core.Unfold: Refactor traceInline · 28deee28
      Ben Gamari authored
      This reduces duplication as well as fixes a bug wherein -dinlining-check
      would override -ddump-inlinings. Moreover, the new variant
      28deee28
  5. 27 May, 2020 3 commits
    • Joshua Price's avatar
      d6203f24
    • Ben Gamari's avatar
      eventlog: Fix racy flushing · 04750304
      Ben Gamari authored
      Previously no attempt was made to avoid multiple threads writing their
      capability-local eventlog buffers to the eventlog writer simultaneously.
      This could result in multiple eventlog streams being interleaved. Fix
      this by documenting that the EventLogWriter's write() and flush()
      functions may be called reentrantly and fix the default writer to
      protect its FILE* by a mutex.
      
      Fixes #18210.
      04750304
    • Takenobu Tani's avatar
      core-spec: Modify file paths according to new module hierarchy · ede24126
      Takenobu Tani authored
      This patch updates file paths according to new module hierarchy [1]:
      
        * GHC/Core.hs                <= coreSyn/CoreSyn.hs
        * GHC/Core/Coercion.hs       <= types/Coercion.hs
        * GHC/Core/Coercion/Axiom.hs <= types/CoAxiom.hs
        * GHC/Core/Coercion/Opt.hs   <= types/OptCoercion.hs
        * GHC/Core/DataCon.hs        <= basicTypes/DataCon.hs
        * GHC/Core/FamInstEnv.hs     <= types/FamInstEnv.hs
        * GHC/Core/Lint.hs           <= coreSyn/CoreLint.hs
        * GHC/Core/Subst.hs          <= coreSyn/CoreSubst.hs
        * GHC/Core/TyCo/Rep.hs       <= types/TyCoRep.hs
        * GHC/Core/TyCon.hs          <= types/TyCon.hs
        * GHC/Core/Type.hs           <= types/Type.hs
        * GHC/Core/Unify.hs          <= types/Unify.hs
        * GHC/Types/Literal.hs       <= basicTypes/Literal.hs
        * GHC/Types/Var.hs           <= basicTypes/Var.hs
      
      [1]: https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular
      
      [skip ci]
      ede24126
  6. 26 May, 2020 3 commits
    • Sylvain Henry's avatar
      Enhance Note [About units] for Backpack · cf772f19
      Sylvain Henry authored
      cf772f19
    • Sebastian Graf's avatar
      Make WorkWrap.Lib.isWorkerSmallEnough aware of the old arity · 6604906c
      Sebastian Graf authored
      We should allow a wrapper with up to 82 parameters when the original
      function had 82 parameters to begin with.
      
      I verified that this made no difference on NoFib, but then again
      it doesn't use huge records...
      
      Fixes #18122.
      6604906c
    • wz1000's avatar
      Add info about typeclass evidence to .hie files · 53814a64
      wz1000 authored
      See `testsuite/tests/hiefile/should_run/HieQueries.hs` and
      `testsuite/tests/hiefile/should_run/HieQueries.stdout` for an example of this
      
      We add two new fields, `EvidenceVarBind` and `EvidenceVarUse` to the
      `ContextInfo` associated with an Identifier. These are associated with the
      appropriate identifiers for the evidence variables collected when we come across
      `HsWrappers`, `TcEvBinds` and `IPBinds` while traversing the AST.
      
      Instance dictionary and superclass selector dictionaries from `tcg_insts` and
      classes defined in `tcg_tcs` are also recorded in the AST as originating from
      their definition span
      
      This allows us to save a complete picture of the evidence constructed by the
      constraint solver, and will let us report this to the user, enabling features
      like going to the instance definition from the invocation of a class method(or
      any other method taking a constraint) and finding all usages of a particular
      instance.
      
      Additionally,
      
      - Mark NodeInfo with an origin so we can differentiate between bindings
        origininating in the source vs those in ghc
      - Along with typeclass evidence info, also include information on Implicit
        Parameters
      - Add a few utility functions to HieUtils in order to query the new info
      
      Updates haddock submodule
      53814a64
  7. 25 May, 2020 6 commits
  8. 24 May, 2020 7 commits