Skip to content
Snippets Groups Projects
  1. Mar 10, 2022
    • Matthew Pickering's avatar
      Normalise output of T10970 test · 844cf1e1
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The output of this test changes each time the containers submodule
      version updates. It's easier to apply the version normaliser so that
      the test checks that there is a version number, but not which one it is.
      844cf1e1
    • Matthew Pickering's avatar
      Add an inline pragma to lookupVarEnv · 8532b8a9
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The containers bump reduced the size of the Data.IntMap.Internal.lookup
      function so that it no longer experienced W/W. This means that the size
      of lookupVarEnv increased over the inlining threshold and it wasn't
      inlined into the hot code path in substTyVar.
      
      See containers#821, #21159 and !7638 for some more explanation.
      
      -------------------------
      Metric Decrease:
          LargeRecord
          T12227
          T13386
          T15703
          T18223
          T5030
          T8095
          T9872a
          T9872b
          T9872c
          TcPlugin_RewritePerf
      -------------------------
      8532b8a9
    • Vladislav Zavialov's avatar
      Bump submodules: containers, exceptions · 7f5f4ede
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      GHC Proposal #371 requires TypeOperators to use type equality a~b.
      This submodule update pulls in the appropriate forward-compatibility
      changes in 'libraries/containers' and 'libraries/exceptions'
      7f5f4ede
    • Ben Gamari's avatar
      mr-template: Mention timeframe for review · bc684dfb
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      bc684dfb
  2. Mar 09, 2022
  3. Mar 08, 2022
    • Matthew Pickering's avatar
      Move bootstrap and cabal-reinstall test jobs to nightly · a60ddffd
      Matthew Pickering authored
      CI is creaking under the pressure of too many jobs so attempt to reduce
      the strain by removing a couple of jobs.
      a60ddffd
    • Ryan Scott's avatar
      Delete GenericKind_ in favor of GenericKind_DC · d0f892fe
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      When deriving a `Generic1` instance, we need to know what the last type
      variable of a data type is. Previously, there were two mechanisms to determine
      this information:
      
      * `GenericKind_`, where `Gen1_` stored the last type variable of a data type
         constructor (i.e., the `tyConTyVars`).
      * `GenericKind_DC`, where `Gen1_DC` stored the last universally quantified
        type variable in a data constructor (i.e., the `dataConUnivTyVars`).
      
      These had different use cases, as `GenericKind_` was used for generating
      `Rep(1)` instances, while `GenericKind_DC` was used for generating `from(1)`
      and `to(1)` implementations. This was already a bit confusing, but things went
      from confusing to outright wrong after !6976. This is because after !6976,
      the `deriving` machinery stopped using `tyConTyVars` in favor of
      `dataConUnivTyVars`. Well, everywhere with the sole exception of
      `GenericKind_`, which still continued to use `tyConTyVars`. This lead to
      disaster when deriving a `Generic1` instance for a GADT family instance, as
      the `tyConTyVars` do not match the `dataConUnivTyVars`. (See #21185.)
      
      The fix is to stop using `GenericKind_` and replace it with `GenericKind_DC`.
      For the most part, this proves relatively straightforward. Some highlights:
      
      * The `forgetArgVar` function was deleted entirely, as it no longer proved
        necessary after `GenericKind_`'s demise.
      * The substitution that maps from the last type variable to `Any` (see
        `Note [Generating a correctly typed Rep instance]`) had to be moved from
        `tc_mkRepTy` to `tc_mkRepFamInsts`, as `tc_mkRepTy` no longer has access to
        the last type variable.
      
      Fixes #21185.
      d0f892fe
    • Andreas Klebinger's avatar
      Expand and improve the Note [Strict Worker Ids]. · 6ce6c250
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      I've added an explicit mention of the invariants surrounding those. As well as adding
      more direct cross references to the Strict Field Invariant.
      6ce6c250
  4. Mar 07, 2022
  5. Mar 06, 2022
  6. Mar 05, 2022
    • sheaf's avatar
      Don't allow Float#/Double# literal patterns · 584cd5ae
      sheaf authored and Marge Bot's avatar Marge Bot committed
        This patch does the following two things:
      
          1. Fix the check in Core Lint to properly throw an error when it
             comes across Float#/Double# literal patterns. The check
             was incorrect before, because it expected the type to be
             Float/Double instead of Float#/Double#.
      
          2. Add an error in the parser when the user writes a floating-point
             literal pattern such as `case x of { 2.0## -> ... }`.
      
        Fixes #21115
      584cd5ae
    • Artem Pelenitsyn's avatar
      remove MonadFail instances of ST · 6f84ee33
      Artem Pelenitsyn authored and Marge Bot's avatar Marge Bot committed
      CLC proposal: https://github.com/haskell/core-libraries-committee/issues/33
      
      The instances had `fail` implemented in terms of `error`, whereas the
      idea of the `MonadFail` class is that the `fail` method should be
      implemented in terms of the monad itself.
      6f84ee33
  7. Mar 04, 2022
  8. Mar 03, 2022
  9. Mar 02, 2022
    • Matthew Pickering's avatar
      ci: Add check to CI to ensure compiler uses correct BIGNUM_BACKEND · 9579bf35
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      9579bf35
    • Matthew Pickering's avatar
      base: Remove default method from bitraversable · 73864f00
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The default instance leads to an infinite loop.
      bisequenceA is defined in terms of bisquence which is defined in terms
      of bitraverse.
      
      ```
      bitraverse f g
      = (defn of bitraverse)
      bisequenceA . bimap f g
      = (defn of bisequenceA)
      bitraverse id id . bimap f g
      = (defn of bitraverse)
      ...
      ```
      
      Any instances defined without an explicitly implementation are currently
      broken, therefore removing it will alert users to an issue in their
      code.
      
      CLC issue: https://github.com/haskell/core-libraries-committee/issues/47
      
      Fixes #20329 #18901
      73864f00
    • jeffrey young's avatar
      GenStgAlt 3-tuple synonym --> Record type · 91a10cb0
      jeffrey young authored and Marge Bot's avatar Marge Bot committed
      This commit alters GenStgAlt from a type synonym to a Record with field
      accessors. In pursuit of #21078, this is not a required change but cleans
      up several areas for nicer code in the upcoming js-backend, and in GHC
      itself.
      
      GenStgAlt: 3-tuple -> record
      
      Stg.Utils: GenStgAlt 3-tuple -> record
      
      Stg.Stats: StgAlt 3-tuple --> record
      
      Stg.InferTags.Rewrite: StgAlt 3-tuple -> record
      
      Stg.FVs: GenStgAlt 3-tuple -> record
      
      Stg.CSE: GenStgAlt 3-tuple -> record
      
      Stg.InferTags: GenStgAlt 3-tuple --> record
      
      Stg.Debug: GenStgAlt 3-tuple --> record
      
      Stg.Lift.Analysis: GenStgAlt 3-tuple --> record
      
      Stg.Lift: GenStgAlt 3-tuple --> record
      
      ByteCode.Instr: GenStgAlt 3-tuple --> record
      
      Stg.Syntax: add GenStgAlt helper functions
      
      Stg.Unarise: GenStgAlt 3-tuple --> record
      
      Stg.BcPrep: GenStgAlt 3-tuple --> record
      
      CoreToStg: GenStgAlt 3-tuple --> record
      
      StgToCmm.Expr: GenStgAlt 3-tuple --> record
      
      StgToCmm.Bind: GenStgAlt 3-tuple --> record
      
      StgToByteCode: GenStgAlt 3-tuple --> record
      
      Stg.Lint: GenStgAlt 3-tuple --> record
      
      Stg.Syntax: strictify GenStgAlt
      
      GenStgAlt: add haddock, some cleanup
      
      fixup: remove calls to pure, single ViewPattern
      
      StgToByteCode: use case over viewpatterns
      91a10cb0
    • Richard Eisenberg's avatar
      Make Constraint not *apart* from Type. · c8652a0a
      Richard Eisenberg authored and Marge Bot's avatar Marge Bot committed
      More details in Note [coreView vs tcView]
      
      Close #21092.
      c8652a0a
    • Richard Eisenberg's avatar
      Make inert_cycle_breakers into a stack. · 1617fed3
      Richard Eisenberg authored and Marge Bot's avatar Marge Bot committed
      Close #20231.
      1617fed3
    • sheaf's avatar
      Improve out-of-order inferred type variables · f596c91a
      sheaf authored and Marge Bot's avatar Marge Bot committed
        Don't instantiate type variables for :type in
        `GHC.Tc.Gen.App.tcInstFun`, to avoid inconsistently instantianting
        `r1` but not `r2` in the type
      
          forall {r1} (a :: TYPE r1) {r2} (b :: TYPE r2). ...
      
        This fixes #21088.
      
        This patch also changes the primop pretty-printer to ensure
        that we put all the inferred type variables first. For example,
        the type of reallyUnsafePtrEquality# is now
      
          forall {l :: Levity} {k :: Levity}
                 (a :: TYPE (BoxedRep l))
                 (b :: TYPE (BoxedRep k)).
            a -> b -> Int#
      
        This means we avoid running into issue #21088 entirely with
        the types of primops. Users can still write a type signature where
        the inferred type variables don't come first, however.
      
        This change to primops had a knock-on consequence, revealing that
        we were sometimes performing eta reduction on keepAlive#.
        This patch updates tryEtaReduce to avoid eta reducing functions
        with no binding, bringing it in line with tryEtaReducePrep,
        and thus fixing #21090.
      f596c91a
    • Matthew Pickering's avatar
      Make -dannot-lint not panic on let bound type variables · 81b7c436
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      After certain simplifier passes we end up with let bound type variables
      which are immediately inlined in the next pass. The core diff utility
      implemented by -dannot-lint failed to take these into account and
      paniced.
      
      Progress towards #20965
      81b7c436
    • sheaf's avatar
      Introduce ConcreteTv metavariables · b27b2af3
      sheaf authored and Marge Bot's avatar Marge Bot committed
        This patch introduces a new kind of metavariable, by adding the
        constructor `ConcreteTv` to `MetaInfo`. A metavariable with
        `ConcreteTv` `MetaInfo`, henceforth a concrete metavariable, can only
        be unified with a type that is concrete (that is, a type that answers
        `True` to `GHC.Core.Type.isConcrete`).
      
        This solves the problem of dangling metavariables in `Concrete#`
        constraints: instead of emitting `Concrete# ty`, which contains a
        secret existential metavariable, we simply emit a primitive equality
        constraint `ty ~# concrete_tv` where `concrete_tv` is a fresh concrete
        metavariable.
      
        This means we can avoid all the complexity of canonicalising
        `Concrete#` constraints, as we can just re-use the existing machinery
        for `~#`.
      
        To finish things up, this patch then removes the `Concrete#` special
        predicate, and instead introduces the special predicate `IsRefl#`
        which enforces that a coercion is reflexive.
        Such a constraint is needed because the canonicaliser is quite happy
        to rewrite an equality constraint such as `ty ~# concrete_tv`, but
        such a rewriting is not handled by the rest of the compiler currently,
        as we need to make use of the resulting coercion, as outlined in the
        FixedRuntimeRep plan.
      
        The big upside of this approach (on top of simplifying the code)
        is that we can now selectively implement PHASE 2 of FixedRuntimeRep,
        by changing individual calls of `hasFixedRuntimeRep_MustBeRefl` to
        `hasFixedRuntimeRep` and making use of the obtained coercion.
      b27b2af3
    • jeffrey young's avatar
      StgToCmm.cgTopBinding: no isNCG, use binBlobThresh · aeea6bd5
      jeffrey young authored and Marge Bot's avatar Marge Bot committed
      This is a one line change. It is a fixup from MR!7325, was pointed out
      in review of MR!7442, specifically: ghc/ghc!7442 (comment 406581)
      
      The change removes isNCG check from cgTopBinding. Instead it changes the
      type of binBlobThresh in DynFlags from Word to Maybe Word, where a Just
      0 or a Nothing indicates an infinite threshold and thus the disable
      CmmFileEmbed case in the original check.
      
      This improves the cohesion of the module because more NCG related
      Backend stuff is moved into, and checked in, StgToCmm.Config. Note, that
      the meaning of a Just 0 or a Nothing in binBlobThresh is indicated in a
      comment next to its field in GHC.StgToCmm.Config.
      
      DynFlags: binBlobThresh: Word -> Maybe Word
      
      StgToCmm.Config: binBlobThesh add not ncg check
      
      DynFlags.binBlob: move Just 0 check to dflags init
      
      StgToCmm.binBlob: only check isNCG, Just 0 check to dflags
      
      StgToCmm.Config: strictify binBlobThresh
      aeea6bd5
    • Matthew Pickering's avatar
      Ticky profiling improvements. · 75caafaa
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      This adds a number of changes to ticky-ticky profiling.
      
      When an executable is profiled with IPE profiling it's now possible to
      associate id-related ticky counters to their source location.
      This works by emitting the info table address as part of the counter
      which can be looked up in the IPE table.
      
      Add a `-ticky-ap-thunk` flag. This flag prevents the use of some standard thunks
      which are precompiled into the RTS. This means reduced cache locality
      and increased code size. But it allows better attribution of execution
      cost to specific source locations instead of simple attributing it to
      the standard thunk.
      
      ticky-ticky now uses the `arg` field to emit additional information
      about counters in json format. When ticky-ticky is used in combination
      with the eventlog eventlog2html can be used to generate a html table
      from the eventlog similar to the old text output for ticky-ticky.
      75caafaa
  10. Mar 01, 2022
    • sheaf's avatar
      Core Lint: collect args through floatable ticks · 7aeb6d29
      sheaf authored and Marge Bot's avatar Marge Bot committed
      We were not looking through floatable ticks when collecting arguments in
      Core Lint, which caused `checkCanEtaExpand` to fail on something like:
      
      ```haskell
      reallyUnsafePtrEquality
        = \ @a ->
            (src<loc> reallyUnsafePtrEquality#)
              @Lifted @a @Lifted @a
      ```
      
      We fix this by using `collectArgsTicks tickishFloatable` instead of
      `collectArgs`, to be consistent with the behaviour of eta expansion
      outlined in Note [Eta expansion and source notes] in GHC.Core.Opt.Arity.
      
      Fixes #21152.
      7aeb6d29
Loading