Skip to content
Snippets Groups Projects
  1. Nov 02, 2021
  2. Nov 01, 2021
  3. Oct 31, 2021
    • Ben Gamari's avatar
      configure: Hide error output from --target check · 6544446d
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      6544446d
    • Ben Gamari's avatar
      ghc: Bump Cabal-Version to 1.22 · 6b38c8a6
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This is necessary to use reexported-modules
      6b38c8a6
    • John Ericson's avatar
      Modularize autoconf platform detection · f5471c0b
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      This will allow better reuse of it, such as in the upcoming RTS
      configure script.
      
      Progress towards #17191
      f5471c0b
    • John Ericson's avatar
      Make build system: Put make generated include's in RTS distdirs · e4095c0c
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      These are best thought of as being part of the RTS.
      
       - After !6791, `ghcautoconf.h` won't be used by the compiler
         inappropriately.
      
       - `ghcversion.h` is only used once outside the RTS, which is
         `compiler/cbits/genSym.c`. Except we *do* mean the RTS GHC is built
         against there, so it's better if we always get get the installed
         version.
      
       - `ghcplatform.h` alone is used extensively outside the RTS, but
         since we no longer have a target platform it is perfectly
         safe/correct to get the info from the previous RTS.
      
      All 3 are exported from the RTS currently and in the bootstrap window.
      
      This commit just swaps directories around, such that the new headers may
      continue to be used in stage 0 despite the reasoning above, but the idea
      is that we can subsequently make more interesting changes doubling down
      on the reasoning above.
      
      In particular, in !6803 we'll start "morally" moving `ghcautonconf.h`
      over, introducing an RTS configure script and temporary header of its
      `AC_DEFINE`s until the top-level configure script doesn't define any
      more.
      
      Progress towards #17191
      e4095c0c
  4. Oct 30, 2021
  5. Oct 29, 2021
    • sheaf's avatar
      User's guide: data family kind-inference changes · 2a4581ff
      sheaf authored and Marge Bot's avatar Marge Bot committed
        Explain that the kind of a data family instance must now be
        fully determined by the header of the instance, and how one
        might migrate code to account for this change.
      
        Fixes #20527
      2a4581ff
    • Sylvain Henry's avatar
      Bignum: add missing rule · c8d89f62
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      Add missing "Natural -> Integer -> Word#" rule.
      c8d89f62
    • Sylvain Henry's avatar
      Add test for T15547 (#15547) · b0a1ed55
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      Fix #15547
      b0a1ed55
    • John Ericson's avatar
      make build system: RTS should use dist-install not dist · 7b67724b
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      This is the following find and replace:
      
       - `rts/dist` -> `rts/dist-install` # for paths
       - `rts_dist` -> `rts_dist-install` # for make rules and vars
       - `,dist` -> `,dist-install` # for make, just in rts/ghc.mk`
      
      Why do this? Does it matter when the RTS is just built once? The answer
      is, yes, I think it does, because I want the distdir--stage
      correspondence to be consistent.
      
      In particular, for #17191 and continuing from
      d5de970d I am going to make the headers
      (`rts/includes`) increasingly the responsibility of the RTS (hence their
      new location). However, those headers are current made for multiple
      stages. This will probably become unnecessary as work on #17191
      progresses and the compiler proper becomes more of a freestanding cabal
      package (e.g. a library that can be downloaded from Hackage and built
      without any autoconf). However, until that is finished, we have will
      transitional period where the RTS and headers need to agree on dirs for
      multiple stages.
      
      I know the make build system is going away, but it's not going yet, so I
      need to change it to unblock things :).
      7b67724b
    • Sebastian Graf's avatar
      WorkWrap: Update Unfolding with WW'd body prior to `tryWW` (#20510) · 925c47b4
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      We have a function in #20510 that is small enough to get a stable unfolding in WW:
      ```hs
      small :: Int -> Int
      small x = go 0 x
        where
          go z 0 = z * x
          go z y = go (z+y) (y-1)
      ```
      But it appears we failed to use the WW'd RHS as the stable unfolding. As a result,
      inlining `small` would expose the non-WW'd version of `go`. That appears to regress
      badly in #19727 which is a bit too large to extract a reproducer from that is
      guaranteed to reproduce across GHC versions.
      
      The solution is to simply update the unfolding in `certainlyWillInline` with the
      WW'd RHS.
      
      Fixes #20510.
      925c47b4
    • Sebastian Graf's avatar
      Add more INLINABLE and INLINE pragmas to `Enum Int*` instances · 71700526
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      Otherwise the instances aren't good list producers.
      See Note [Stable Unfolding for list producers].
      71700526
    • Ziyang Liu's avatar
      Show family TyCons in mk_dict_error in the case of a single match · 522eab3f
      Ziyang Liu authored and Marge Bot's avatar Marge Bot committed
      522eab3f
  6. Oct 27, 2021
  7. Oct 26, 2021
  8. Oct 25, 2021
  9. Oct 24, 2021
    • John Ericson's avatar
      Fix dangling reference to RtsConfig.h · 98aa29d3
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      It hasn't existed since a2a67cd5 -- in
      2009!
      98aa29d3
    • Joachim Breitner's avatar
      undefined: Neater CallStack in error message · 3417a81a
      Joachim Breitner authored and Marge Bot's avatar Marge Bot committed
      Users of `undefined` don’t want to see
      ```
      files.hs: Prelude.undefined:
      CallStack (from HasCallStack):
        error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
        undefined, called at file.hs:151:19 in main:Main
      ```
      but want to see
      ```
      files.hs: Prelude.undefined:
      CallStack (from HasCallStack):
        undefined, called at file.hs:151:19 in main:Main
      ```
      so let’s make that so.
      
      The function for that is `withFrozenCallStack`, but that is not usable
      here (module dependencies, and also not representation-polymorphic). And
      even if it were, it could confuse GHC’s strictness analyzer, leading to
      big regressions in some perf tests (T10421 in particular).
      
      So after shuffling modules and definitions around, I eventually noticed
      that the easiest way is to just not call `error` here.
      
      Fixes #19886
      3417a81a
    • Alan Zimmerman's avatar
      EPA: Use LocatedA for ModuleName · 691c450f
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      This allows us to use an Anchor with a DeltaPos in it when exact
      printing.
      691c450f
    • Sebastian Graf's avatar
      DmdAnal: Implement Boxity Analysis (#19871) · 3bab222c
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      This patch fixes some abundant reboxing of `DynFlags` in
      `GHC.HsToCore.Match.Literal.warnAboutOverflowedLit` (which was the topic
      of #19407) by introducing a Boxity analysis to GHC, done as part of demand
      analysis. This allows to accurately capture ad-hoc unboxing decisions previously
      made in worker/wrapper in demand analysis now, where the boxity info can
      propagate through demand signatures.
      
      See the new `Note [Boxity analysis]`. The actual fix for #19407 is described in
      `Note [No lazy, Unboxed demand in demand signature]`, but
      `Note [Finalising boxity for demand signature]` is probably a better entry-point.
      
      To support the fix for #19407, I had to change (what was)
      `Note [Add demands for strict constructors]` a bit
      (now `Note [Unboxing evaluated arguments]`). In particular, we now take care of
      it in `finaliseBoxity` (which is only called from demand analaysis) instead of
      `wantToUnboxArg`.
      
      I also had to resurrect `Note [Product demands for function body]` and rename
      it to `Note [Unboxed demand on function bodies returning small products]` to
      avoid huge regressions in `join004` and `join007`, thereby fixing #4267 again.
      See the updated Note for details.
      
      A nice side-effect is that the worker/wrapper transformation no longer needs to
      look at strictness info and other bits such as `InsideInlineableFun` flags
      (needed for `Note [Do not unbox class dictionaries]`) at all. It simply collects
      boxity info from argument demands and interprets them with a severely simplified
      `wantToUnboxArg`. All the smartness is in `finaliseBoxity`, which could be moved
      to DmdAnal completely, if it wasn't for the call to `dubiousDataConInstArgTys`
      which would be awkward to export.
      
      I spent some time figuring out the reason for why `T16197` failed prior to my
      amendments to `Note [Unboxing evaluated arguments]`. After having it figured
      out, I minimised it a bit and added `T16197b`, which simply compares computed
      strictness signatures and thus should be far simpler to eyeball.
      
      The 12% ghc/alloc regression in T11545 is because of the additional `Boxity`
      field in `Poly` and `Prod` that results in more allocation during `lubSubDmd`
      and `plusSubDmd`. I made sure in the ticky profiles that the number of calls
      to those functions stayed the same. We can bear such an increase here, as we
      recently improved it by -68% (in b760c1f7).
      T18698* regress slightly because there is more unboxing of dictionaries
      happening and that causes Lint (mostly) to allocate more.
      
      Fixes #19871, #19407, #4267, #16859, #18907 and #13331.
      
      Metric Increase:
          T11545
          T18698a
          T18698b
      
      Metric Decrease:
          T12425
          T16577
          T18223
          T18282
          T4267
          T9961
      3bab222c
    • Ben Gamari's avatar
      driver: Export wWarningFlagMap · 8300ca2e
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      A new feature requires Ghcide to be able to convert warnings to CLI
      flags (WarningFlag -> String). This is most easily implemented in terms
      of the internal function flagSpecOf, which uses an inefficient
      implementation based on linear search through a linked list. This PR
      derives Ord for WarningFlag, and replaces that list with a Map.
      
      Closes #19087.
      8300ca2e
  10. Oct 22, 2021
    • Sebastian Graf's avatar
      WorkWrap: `isRecDataCon` should not eta-reduce NewTyCon field tys (#20539) · dd2dba80
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      In #20539 we had a type
      ```hs
      newtype Measured a = Measured { unmeasure :: () -> a }
      ```
      and `isRecDataCon Measured` recursed into `go_arg_ty` for `(->) ()`, because
      `unwrapNewTyConEtad_maybe` eta-reduced it. That triggered an assertion error a
      bit later. Eta reducing the field type is completely wrong to do here! Just call
      `unwrapNewTyCon_maybe` instead.
      
      Fixes #20539 and adds a regression test T20539.
      dd2dba80
    • Matthew Pickering's avatar
      driver: Don't use the log queue abstraction when j = 1 · 621608c9
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      This simplifies the code path for -j1 by not using the log queue queue
      abstraction. The result is that trace output isn't interleaved with
      other dump output like it can be with -j<N>.
      621608c9
    • hexchain's avatar
      Fix compilerConfig stages · 47ba842b
      hexchain authored and Marge Bot's avatar Marge Bot committed
      Fix the call to compilerConfig because it accepts 1-indexed stage
      numbers. Also fixes `make stage=3`.
      47ba842b
    • Sylvain Henry's avatar
      Refactor package imports · 806e49ae
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      Use an (Raw)PkgQual datatype instead of `Maybe FastString` to represent
      package imports. Factorize the code that renames RawPkgQual into PkgQual
      in function `rnPkgQual`. Renaming consists in checking if the FastString
      is the magic "this" keyword, the home-unit unit-id or something else.
      
      Bump haddock submodule
      806e49ae
    • Sylvain Henry's avatar
      Remove Indefinite · 6fd7da74
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      We no longer need it after previous IndefUnitId refactoring.
      6fd7da74
    • Sylvain Henry's avatar
      Add test for #19641 · fa5870d3
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      Now that Bignum predicates are inlined (!6696), we only need to add a
      test.
      
      Fix #19641
      fa5870d3
    • sheaf's avatar
      Use tcEqType in GHC.Core.Unify.uVar · 77c6f3e6
      sheaf authored and Marge Bot's avatar Marge Bot committed
        Because uVar used eqType instead of tcEqType, it was possible
        to accumulate a substitution that unified Type and Constraint.
      
        For example, a call to `tc_unify_tys` with arguments
      
          tys1 = [ k, k ]
          tys2 = [ Type, Constraint ]
      
        would first add `k = Type` to the substitution. That's fine, but then
        the second call to `uVar` would claim that the substitution also
        unifies `k` with `Constraint`. This could then be used to cause
        trouble, as per #20521.
      
        Fixes #20521
      77c6f3e6
Loading