Skip to content
Snippets Groups Projects
  1. May 05, 2022
  2. May 04, 2022
  3. May 03, 2022
    • Sebastian Graf's avatar
      Assume at least one evaluation for nested SubDemands (#21081, #21133) · 15ffe2b0
      Sebastian Graf authored
      See the new `Note [SubDemand denotes at least one evaluation]`.
      
      A demand `n :* sd` on a let binder `x=e` now means
      
      > "`x` was evaluated `n` times and in any program trace it is evaluated, `e` is
      >  evaluated deeply in sub-demand `sd`."
      
      The "any time it is evaluated" premise is what this patch adds. As a result,
      we get better nested strictness. For example (T21081)
      ```hs
      f :: (Bool, Bool) -> (Bool, Bool)
      f pr = (case pr of (a,b) -> a /= b, True)
      -- before: <MP(L,L)>
      -- after:  <MP(SL,SL)>
      
      g :: Int -> (Bool, Bool)
      g x = let y = let z = odd x in (z,z) in f y
      ```
      The change in demand signature "before" to "after" allows us to case-bind `z`
      here.
      
      Similarly good things happen for the `sd` in call sub-demands `Cn(sd)`, which
      allows for more eta-reduction (which is only sound with `-fno-pedantic-bottoms`,
      albeit).
      
      We also fix #21085, a surprising inconsistency with `Poly` to `Call` sub-demand
      expansion.
      
      In an attempt to fix a regression caused by less inlining due to eta-reduction
      in T15426, I eta-expanded the definition of `elemIndex` and `elemIndices`, thus
      fixing #21345 on the go.
      
      The main point of this patch is that it fixes #21081 and #21133.
      
      Annoyingly, I discovered that more precise demand signatures for join points can
      transform a program into a lazier program if that join point gets floated to the
      top-level, see #21392. There is no simple fix at the moment, but !5349 might.
      Thus, we accept a ~5% regression in `MultiLayerModulesTH_OneShot`, where #21392
      bites us in `addListToUniqDSet`. T21392 reliably reproduces the issue.
      
      Surprisingly, ghc/alloc perf on Windows improves much more than on other jobs, by
      0.4% in the geometric mean and by 2% in T16875.
      
      Metric Increase:
          MultiLayerModulesTH_OneShot
      Metric Decrease:
          T16875
      15ffe2b0
  4. May 02, 2022
  5. Apr 30, 2022
    • sheaf's avatar
      Testsuite driver: don't crash on empty metrics · a7053a6c
      sheaf authored and Marge Bot's avatar Marge Bot committed
      The testsuite driver crashed when trying to display minimum/maximum
      performance changes when there are no metrics (i.e. there is
      no baseline available). This patch fixes that.
      a7053a6c
    • Ben Gamari's avatar
      rts/m32: Fix assertion failure · b57b5b92
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This fixes an assertion failure in the m32 allocator due to the
      imprecisely specified preconditions of `m32_allocator_push_filled_list`.
      Specifically, the caller must ensure that the page type is set to filled
      prior to calling `m32_allocator_push_filled_list`.
      
      While this issue did result in an assertion failure in the debug RTS,
      the issue is in fact benign.
      b57b5b92
    • Matthew Pickering's avatar
      Hadrian: Update README about the flavour/testsuite contract · ab677cc8
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      There have been a number of tickets about non-tested flavours not
      passing the testsuite.. this is expected and now noted in the
      documentation. You use other flavours to run the testsuite at your own
      risk.
      
      Fixes #21418
      ab677cc8
    • Matthew Pickering's avatar
      Add test for T21229 · ee891c1e
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      ee891c1e
    • Matthew Pickering's avatar
      Revert "Make the specialiser handle polymorphic specialisation" · 34b28200
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      This reverts commit ef013593.
      
      See ticket #21229
      
      -------------------------
      Metric Decrease:
          T15164
      Metric Increase:
          T13056
      -------------------------
      34b28200
    • Chris Martin's avatar
      hacking guide: mention the core libraries committee · d0f14fad
      Chris Martin authored and Marge Bot's avatar Marge Bot committed
      d0f14fad
    • adam's avatar
      users guide: add categories to some flags · d8cbc77e
      adam authored and Marge Bot's avatar Marge Bot committed
      d8cbc77e
    • adam's avatar
      ghc-boot: export typesynonyms from GHC.Utils.Encoding · 2e951e48
      adam authored and Marge Bot's avatar Marge Bot committed
      This makes the Haddocks easier to understand.
      2e951e48
    • Marius Ghita's avatar
      Update user guide example rewrite rules formatting · 39edc7b4
      Marius Ghita authored and Marge Bot's avatar Marge Bot committed
      Change the rewrite rule examples to include a space between the
      composition of `f` and `g` in the map rewrite rule examples.
      
      Without this change, if the user has locally enabled the extension
      OverloadedRecordDot the copied example will result in a compile time
      error that `g` is not a field of `f`.
      
      ```
          • Could not deduce (GHC.Records.HasField "g" (a -> b) (a1 -> b))
              arising from selecting the field ‘g’
      ```
      39edc7b4
    • Ben Gamari's avatar
      Convert More Diagnostics (#20116) · 170da54f
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Replaces uses of `TcRnUnknownMessage` with proper diagnostics
      constructors.
      170da54f
    • Ryan Scott's avatar
      Make mkFunCo take AnonArgFlags into account · e2dd884a
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      Previously, whenever `mkFunCo` would produce reflexive coercions, it would
      use `mkVisFunTy` to produce the kind of the coercion. However, `mkFunCo` is
      also used to produce coercions between types of the form `ty1 => ty2` in
      certain places. This has the unfortunate side effect of causing the type of
      the coercion to appear as `ty1 -> ty2` in certain error messages, as spotted
      in #21328.
      
      This patch address this by changing replacing the use of `mkVisFunTy` with
      `mkFunctionType` in `mkFunCo`. `mkFunctionType` checks the kind of `ty1` and
      makes the function arrow `=>` instead of `->` if `ty1` has kind `Constraint`,
      so this should always produce the correct `AnonArgFlag`. As a result, this
      patch fixes part (2) of #21328.
      
      This is not the only possible way to fix #21328, as the discussion on that
      issue lists some possible alternatives. Ultimately, it was concluded that the
      alternatives would be difficult to maintain, and since we already use
      `mkFunctionType` in `coercionLKind` and `coercionRKind`, using `mkFunctionType`
      in `mkFunCo` is consistent with this choice. Moreover, using `mkFunctionType`
      does not regress the performance of any test case we have in GHC's test suite.
      e2dd884a
    • parsonsmatt's avatar
      Add a note about instance visibility across component boundaries · 0cdef807
      parsonsmatt authored and Marge Bot's avatar Marge Bot committed
      In principle, the *visible* instances are
      * all instances defined in a prior top-level declaration group
        (see docs on `newDeclarationGroup`), or
      * all instances defined in any module transitively imported by the
        module being compiled
      
      However, actually searching all modules transitively below the one being
      compiled is unreasonably expensive, so `reifyInstances` will report only the
      instance for modules that GHC has had some cause to visit during this
      compilation.  This is a shortcoming: `reifyInstances` might fail to report
      instances for a type that is otherwise unusued, or instances defined in a
      different component.  You can work around this shortcoming by explicitly importing the modules
      whose instances you want to be visible. GHC issue #20529
      has some discussion around this.
      
      Fixes #20529
      0cdef807
Loading