Skip to content
Snippets Groups Projects
  1. Dec 08, 2020
    • adam's avatar
      hadrian: build the _l and _thr_l rts flavours in the develN flavours · 0abe3ddf
      adam authored and Marge Bot's avatar Marge Bot committed
      The ghc binary requires the eventlog rts since
      fc644b1a
      0abe3ddf
    • Simon Peyton Jones's avatar
      Fix kind inference for data types. Again. · 62ed6957
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      This patch fixes several aspects of kind inference for data type
      declarations, especially data /instance/ declarations
      
      Specifically
      
      1. In kcConDecls/kcConDecl make it clear that the tc_res_kind argument
         is only used in the H98 case; and in that case there is no result
         kind signature; and hence no need for the disgusting splitPiTys in
         kcConDecls (now thankfully gone).
      
         The GADT case is a bit different to before, and much nicer.
         This is what fixes #18891.
      
         See Note [kcConDecls: kind-checking data type decls]
      
      2. Do not look at the constructor decls of a data/newtype instance
         in tcDataFamInstanceHeader. See GHC.Tc.TyCl.Instance
         Note [Kind inference for data family instances].  This was a
         new realisation that arose when doing (1)
      
         This causes a few knock-on effects in the tests suite, because
         we require more information than before in the instance /header/.
      
         New user-manual material about this in "Kind inference in data type
         declarations" and "Kind inference for data/newtype instance
         declarations".
      
      3. Minor improvement in kcTyClDecl, combining GADT and H98 cases
      
      4. Fix #14111 and #8707 by allowing the header of a data instance
         to affect kind inferece for the the data constructor signatures;
         as described at length in Note [GADT return types] in GHC.Tc.TyCl
      
         This led to a modest refactoring of the arguments (and argument
         order) of tcConDecl/tcConDecls.
      
      5. Fix #19000 by inverting the sense of the test in new_locs
         in GHC.Tc.Solver.Canonical.canDecomposableTyConAppOK.
      62ed6957
  2. Dec 05, 2020
  3. Dec 04, 2020
  4. Dec 03, 2020
  5. Dec 02, 2020
    • Ben Gamari's avatar
      rts/linker: Use m32 to allocate symbol extras in PEi386 · 41c64eb5
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      41c64eb5
    • Ben Gamari's avatar
      rts/m32: Introduce NEEDS_M32 macro · c35d0e03
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Instead of relying on RTS_LINKER_USE_MMAP
      c35d0e03
    • Ben Gamari's avatar
      rts/Linker: Introduce Windows implementations for mmapForLinker, et al. · d8872af0
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      d8872af0
    • Ben Gamari's avatar
      rts/linker: Introduce munmapForLinker · 97d71646
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Consolidates munmap calls to ensure consistent error handling.
      97d71646
    • Ben Gamari's avatar
      rts: Introduce mmapAnonForLinker · add0aeae
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously most of the uses of mmapForLinker were mapping anonymous
      memory, resulting in a great deal of unnecessary repetition. Factor this
      out into a new helper.
      
      Also fixes a few places where error checking was missing or suboptimal.
      add0aeae
    • Richard Eisenberg's avatar
      Rename the flattener to become the rewriter. · d66660ba
      Richard Eisenberg authored and Marge Bot's avatar Marge Bot committed
      Now that flattening doesn't produce flattening variables,
      it's not really flattening anything: it's rewriting. This
      change also means that the rewriter can no longer be confused
      the core flattener (in GHC.Core.Unify), which is sometimes used
      during type-checking.
      d66660ba
    • Richard Eisenberg's avatar
      Remove flattening variables · 8bb52d91
      Richard Eisenberg authored and Marge Bot's avatar Marge Bot committed
      This patch redesigns the flattener to simplify type family applications
      directly instead of using flattening meta-variables and skolems. The key new
      innovation is the CanEqLHS type and the new CEqCan constraint (Ct). A CanEqLHS
      is either a type variable or exactly-saturated type family application; either
      can now be rewritten using a CEqCan constraint in the inert set.
      
      Because the flattener no longer reduces all type family applications to
      variables, there was some performance degradation if a lengthy type family
      application is now flattened over and over (not making progress). To
      compensate, this patch contains some extra optimizations in the flattener,
      leading to a number of performance improvements.
      
      Close #18875.
      Close #18910.
      
      There are many extra parts of the compiler that had to be affected in writing
      this patch:
      
      * The family-application cache (formerly the flat-cache) sometimes stores
        coercions built from Given inerts. When these inerts get kicked out, we must
        kick out from the cache as well. (This was, I believe, true previously, but
        somehow never caused trouble.) Kicking out from the cache requires adding a
        filterTM function to TrieMap.
      
      * This patch obviates the need to distinguish "blocking" coercion holes from
        non-blocking ones (which, previously, arose from CFunEqCans). There is thus
        some simplification around coercion holes.
      
      * Extra commentary throughout parts of the code I read through, to preserve
        the knowledge I gained while working.
      
      * A change in the pure unifier around unifying skolems with other types.
        Unifying a skolem now leads to SurelyApart, not MaybeApart, as documented
        in Note [Binding when looking up instances] in GHC.Core.InstEnv.
      
      * Some more use of MCoercion where appropriate.
      
      * Previously, class-instance lookup automatically noticed that e.g. C Int was
        a "unifier" to a target [W] C (F Bool), because the F Bool was flattened to
        a variable. Now, a little more care must be taken around checking for
        unifying instances.
      
      * Previously, tcSplitTyConApp_maybe would split (Eq a => a). This is silly,
        because (=>) is not a tycon in Haskell. Fixed now, but there are some
        knock-on changes in e.g. TrieMap code and in the canonicaliser.
      
      * New function anyFreeVarsOf{Type,Co} to check whether a free variable
        satisfies a certain predicate.
      
      * Type synonyms now remember whether or not they are "forgetful"; a forgetful
        synonym drops at least one argument. This is useful when flattening; see
        flattenView.
      
      * The pattern-match completeness checker invokes the solver. This invocation
        might need to look through newtypes when checking representational equality.
        Thus, the desugarer needs to keep track of the in-scope variables to know
        what newtype constructors are in scope. I bet this bug was around before but
        never noticed.
      
      * Extra-constraints wildcards are no longer simplified before printing.
        See Note [Do not simplify ConstraintHoles] in GHC.Tc.Solver.
      
      * Whether or not there are Given equalities has become slightly subtler.
        See the new HasGivenEqs datatype.
      
      * Note [Type variable cycles in Givens] in GHC.Tc.Solver.Canonical
        explains a significant new wrinkle in the new approach.
      
      * See Note [What might match later?] in GHC.Tc.Solver.Interact, which
        explains the fix to #18910.
      
      * The inert_count field of InertCans wasn't actually used, so I removed
        it.
      
      Though I (Richard) did the implementation, Simon PJ was very involved
      in design and review.
      
      This updates the Haddock submodule to avoid #18932 by adding
      a type signature.
      
      -------------------------
      Metric Decrease:
          T12227
          T5030
          T9872a
          T9872b
          T9872c
      Metric Increase:
          T9872d
      -------------------------
      8bb52d91
    • Richard Eisenberg's avatar
      Bump the # of commits searched for perf baseline · 0dd45d0a
      Richard Eisenberg authored and Marge Bot's avatar Marge Bot committed
      The previous value of 75 meant that a feature branch with
      more than 75 commits would get spurious CI passes.
      
      This affects #18692, but does not fix that ticket, because
      if a baseline cannot be found, we should fail, not succeed.
      0dd45d0a
    • Richard Eisenberg's avatar
      Move core flattening algorithm to Core.Unify · 72a87fbc
      Richard Eisenberg authored and Marge Bot's avatar Marge Bot committed
      This sets the stage for a later change, where this
      algorithm will be needed from GHC.Core.InstEnv.
      
      This commit also splits GHC.Core.Map into
      GHC.Core.Map.Type and GHC.Core.Map.Expr,
      in order to avoid module import cycles
      with GHC.Core.
      72a87fbc
  6. Dec 01, 2020
  7. Nov 30, 2020
    • Ryan Scott's avatar
      Allow deploy:pages job to fail · 0f8a4655
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      See #18973.
      0f8a4655
    • Ben Gamari's avatar
      rts/linker: Replace some ASSERTs with CHECK · 9f4efa6a
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      In the past some people have confused ASSERT, which is for checking
      internal invariants, which CHECK, which should be used when checking
      things that might fail due to bad input (and therefore should be enabled
      even in the release compiler). Change some of these cases in the linker
      to use CHECK.
      9f4efa6a
    • Ben Gamari's avatar
      rts: Use CHECK instead of assert · b6629289
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Use the GHC wrappers instead of <assert.h>.
      b6629289
    • Ben Gamari's avatar
      rts/m32: Refactor handling of allocator seeding · 8d304a99
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously, in an attempt to reduce fragmentation, each new allocator
      would map a region of M32_MAX_PAGES fresh pages to seed itself. However,
      this ends up being extremely wasteful since it turns out that we often
      use fewer than this.  Consequently, these pages end up getting freed
      which, ends up fragmenting our address space more than than we would
      have if we had naively allocated pages on-demand.
      
      Here we refactor m32 to avoid this waste while achieving the
      fragmentation mitigation previously desired. In particular, we move all
      page allocation into the global m32_alloc_page, which will pull a page
      from the free page pool. If the free page pool is empty we then refill
      it by allocating a region of M32_MAP_PAGES and adding them to the pool.
      
      Furthermore, we do away with the initial seeding entirely. That is, the
      allocator starts with no active pages: pages are rather allocated on an
      as-needed basis.
      
      On the whole this ends up being a pleasingly simple change,
      simultaneously making m32 more efficient, more robust, and simpler.
      
      Fixes #18980.
      8d304a99
  8. Nov 29, 2020
  9. Nov 28, 2020
Loading