Skip to content
Snippets Groups Projects
  1. Aug 23, 2023
    • Ben Gamari's avatar
      base: Introduce Data.Enum · 4908d798
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      4908d798
    • sheaf's avatar
      Don't attempt pattern synonym error recovery · e7db36c1
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This commit gets rid of the pattern synonym error recovery mechanism
      (recoverPSB). The rationale is that the fake pattern synonym binding
      that the recovery mechanism introduced could lead to undesirable
      knock-on errors, and it isn't really feasible to conjure up a
      satisfactory binding as pattern synonyms can be used both in expressions
      and patterns.
      See Note [Pattern synonym error recovery] in GHC.Tc.TyCl.PatSyn.
      
      It isn't such a big deal to eagerly fail compilation on a pattern synonym
      that doesn't typecheck anyway.
      
      Fixes #23467
      e7db36c1
  2. Aug 22, 2023
    • Alan Zimmerman's avatar
      EPA: Use Introduce [DeclTag] in AnnSortKey · ab40aa52
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      The AnnSortKey is used to keep track of the order of declarations for
      printing when the container has split them apart.
      
      This applies to HsValBinds and ClassDecl, ClsInstDecl.
      
      When making modifications to the list of declarations, the new order
      must be captured for when it must be printed. For each list of
      declarations (binds and sigs for a HsValBind) we can just store the
      list in order.
      
      To recreate the list when printing, we must merge them, and this is
      what the AnnSortKey records. It used to be indexed by SrcSpan, we now
      simply index by a marker as to which list to take the next item from.
      ab40aa52
    • Krzysztof Gogolewski's avatar
      Testsuite cleanup · 52a6d868
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      - Remove misleading help text in perf_notes, ways are not metrics
      - Remove no_print_summary - this was used for Phabricator
      - In linters tests, run 'git ls-files' just once.
        Previously, it was called on each has_ls_files()
      - Add ghc-prim.cabal to gitignore, noticed in #23726
      - Remove ghc-prim.cabal, it was accidentally committed in 524c60c8
      52a6d868
    • ARATA Mizuki's avatar
      Support 128-bit SIMD on AArch64 via LLVM backend · 015886ec
      ARATA Mizuki authored and Marge Bot's avatar Marge Bot committed
      015886ec
    • Krzysztof Gogolewski's avatar
      Fix MultiWayIf linearity checking (#23814) · edd8bc43
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      
      Co-authored-by: default avatarThomas BAGREL <thomas.bagrel@tweag.io>
      edd8bc43
  3. Aug 21, 2023
  4. Aug 17, 2023
  5. Aug 16, 2023
  6. Aug 14, 2023
  7. Aug 10, 2023
    • Finley McIlwaine's avatar
      Add -finfo-table-map-with-fallback -finfo-table-map-with-stack · 261c4acb
      Finley McIlwaine authored and Marge Bot's avatar Marge Bot committed
      The -fno-info-table-map-with-stack flag omits STACK info tables from the info
      table map, and the -fno-info-table-map-with-fallback flag omits info tables
      with defaulted source locations from the map. In a test on the Agda codebase
      the build results were about 7% smaller when both of those types of tables
      were omitted.
      
      Adds a test that verifies that passing each combination of these flags
      results in the correct output for -dipe-stats, which is disabled for the js
      backend since profiling is not implemented.
      
      This commit also refactors a lot of the logic around extracting info tables
      from the Cmm results and building the info table map.
      
      This commit also fixes some issues in the users guide rst source to fix
      warnings that were noticed while debugging the documentation for these flags.
      
      Fixes #23702
      261c4acb
  8. Aug 09, 2023
    • Matthew Craven's avatar
      Bump bytestring submodule to 0.11.5, again · bf885d7a
      Matthew Craven authored and Marge Bot's avatar Marge Bot committed
      Fixes #23789.
      
      The bytestring commit used here is unreleased;
      a release can be made when necessary.
      bf885d7a
    • Sebastian Graf's avatar
      CorePrep: Eta expand arguments (#23083) · 00d31188
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      Previously, we'd only eta expand let bindings and lambdas,
      now we'll also eta expand arguments such as in T23083:
      ```hs
      g f h = f (h `seq` (h $))
      ```
      Unless `-fpedantic-bottoms` is set, we'll now transform to
      ```hs
      g f h = f (\eta -> h eta)
      ```
      in CorePrep.
      
      See the new `Note [Eta expansion of arguments in CorePrep]` for the details.
      
      We only do this optimisation with -O2 because we saw 2-3% ghc/alloc regressions
      in T4801 and T5321FD.
      
      Fixes #23083.
      00d31188
    • Sebastian Graf's avatar
      ANFise string literal arguments (#23270) · 7e0c8b3b
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      This instates the invariant that a trivial CoreExpr translates to an atomic
      StgExpr. Nice.
      
      Annoyingly, in -O0 we sometimes generate
      ```
      foo = case "blah"# of sat { __DEFAULT -> unpackCString# sat }
      ```
      which makes it a bit harder to spot that we can emit a standard
      `stg_unpack_cstring` thunk.
      
      Fixes #23270.
      7e0c8b3b
    • Sebastian Graf's avatar
      Disable tests RepPolyWrappedVar2 and RepPolyUnsafeCoerce1 in JS backend · d8d993f1
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      ... because those coerce between incompatible/unknown PrimReps.
      d8d993f1
    • Sebastian Graf's avatar
      Core.Ppr: Omit case binder for empty case alternatives · 8c73505e
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      A minor improvement to pretty-printing
      8c73505e
    • sheaf's avatar
      Compute all emitted diagnostic codes · 0ef1d8ae
      sheaf authored and Marge Bot's avatar Marge Bot committed
      This commit introduces in GHC.Types.Error.Codes the function
      
        constructorCodes :: forall diag. (...) => Map DiagnosticCode String
      
      which computes a collection of all the diagnostic codes that correspond
      to a particular type. In particular, we can compute the collection of
      all diagnostic codes emitted by GHC using the invocation
      
        constructorCodes @GhcMessage
      
      We then make use of this functionality in the new "codes" test which
      checks consistency and coverage of GHC diagnostic codes.
      It performs three checks:
      
        - check 1: all non-outdated GhcDiagnosticCode equations
          are statically used.
        - check 2: all outdated GhcDiagnosticCode equations
          are statically unused.
        - check 3: all statically used diagnostic codes are covered by
          the testsuite (modulo accepted exceptions).
      0ef1d8ae
  9. Aug 08, 2023
    • Ryan Scott's avatar
      tcExpr: Push expected types for untyped TH splices inwards · 3b373838
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      In !10911, I deleted a `tcExpr` case for `HsUntypedSplice` in favor of a much
      simpler case that simply delegates to `tcApp`. Although this passed the test
      suite at the time, this was actually an error, as the previous `tcExpr` case
      was critically pushing the expected type inwards. This actually matters for
      programs like the one in #23796, which GHC would not accept with type inference
      alone—we need full-blown type _checking_ to accept these.
      
      I have added back the previous `tcExpr` case for `HsUntypedSplice` and now
      explain why we have two different `HsUntypedSplice` cases (one in `tcExpr` and
      another in `splitHsApps`) in `Note [Looking through Template Haskell splices in
      splitHsApps]` in `GHC.Tc.Gen.Head`.
      
      Fixes #23796.
      3b373838
  10. Aug 07, 2023
  11. Aug 05, 2023
  12. Aug 04, 2023
    • sheaf's avatar
      Update inert_solved_dicts for ImplicitParams · 41bf2c09
      sheaf authored and Marge Bot's avatar Marge Bot committed
      When adding an implicit parameter dictionary to the inert set, we must
      make sure that it replaces any previous implicit parameter dictionaries
      that overlap, in order to get the appropriate shadowing behaviour, as in
      
        let ?x = 1 in let ?x = 2 in ?x
      
      We were already doing this for inert_cans, but we weren't doing the same
      thing for inert_solved_dicts, which lead to the bug reported in #23761.
      
      The fix is thus to make sure that, when handling an implicit parameter
      dictionary in updInertDicts, we update **both** inert_cans and
      inert_solved_dicts to ensure a new implicit parameter dictionary
      correctly shadows old ones.
      
      Fixes #23761
      41bf2c09
    • Matthew Craven's avatar
      Adjust and clarify handling of primop effects · 8ba20b21
      Matthew Craven authored and Marge Bot's avatar Marge Bot committed
      Fixes #17900; fixes #20195.
      
      The existing "can_fail" and "has_side_effects" primop attributes
      that previously governed this were used in inconsistent and
      confusingly-documented ways, especially with regard to raising
      exceptions.  This patch replaces them with a single "effect"
      attribute, which has four possible values: NoEffect, CanFail,
      ThrowsException, and ReadWriteEffect.  These are described in
      Note [Classifying primop effects].
      
      A substantial amount of related documentation has been re-drafted
      for clarity and accuracy.
      
      In the process of making this attribute format change for literally
      every primop, several existing mis-classifications were detected and
      corrected.  One of these mis-classifications was tagToEnum#, which
      is now considered CanFail; this particular fix is known to cause a
      regression in performance for derived Enum instances.  (See #23782.)
      Fixing this is left as future work.
      
      New primop attributes "cheap" and "work_free" were also added,
      and used in the corresponding parts of GHC.Core.Utils.
      
      In view of their actual meaning and uses, `primOpOkForSideEffects`
      and `exprOkForSideEffects` have been renamed to `primOpOkToDiscard`
      and `exprOkToDiscard`, respectively.
      
      Metric Increase:
          T21839c
      8ba20b21
    • Aaron Allen's avatar
      [#23663] Show Flag Suggestions in GHCi · a1899d8f
      Aaron Allen authored and Marge Bot's avatar Marge Bot committed
      Makes suggestions when using `:set` in GHCi with a misspelled flag. This
      mirrors how invalid flags are handled when passed to GHC directly. Logic
      for producing flag suggestions was moved to GHC.Driver.Sesssion so it
      can be shared.
      
      resolves #23663
      a1899d8f
    • Vladislav Zavialov's avatar
      Fix (~) and (@) infix operators in TH splices (#23748) · 46fd8ced
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      8168b42a "Whitespace-sensitive bang patterns" allows GHC to accept
      the following infix operators:
      
      	a ~ b = ()
      	a @ b = ()
      
      But not if TH is used to generate those declarations:
      
      	$([d| a ~ b = ()
      	      a @ b = ()
      	    |])
      
      	-- Test.hs:5:2: error: [GHC-55017]
      	--    Illegal variable name: ‘~’
      	--    When splicing a TH declaration: (~_0) a_1 b_2 = GHC.Tuple.Prim.()
      
      This is easily fixed by modifying `reservedOps` in GHC.Utils.Lexeme
      46fd8ced
    • Ben Gamari's avatar
      nativeGen/AArch64: Fix sign extension in MulMayOflo · 824092f2
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously the 32-bit implementations of MulMayOflo would use the
      a non-sensical sign-extension mode. Rewrite these to reflect what gcc 11
      produces. Also similarly rework the 16- and 8-bit cases.
      
      This now passes the MulMayOflo tests in ghc/test-primops> in all four
      widths, including the precision tests.
      
      Fixes #23721.
      824092f2
    • Ben Gamari's avatar
      testsuite: Mark MulMayOflo_full as broken rather than skipping · fd7ce39c
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      To ensure that we don't accidentally fix it.
      
      See #23742.
      fd7ce39c
    • Ben Gamari's avatar
      testsuite/interface-stability: normalise versions · 4b647936
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This eliminates spurious changes from version bumps.
      4b647936
    • Ben Gamari's avatar
      testsuite: Update base-exports · 8b176514
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      8b176514
    • Ben Gamari's avatar
      testsuite: Declare bkpcabal08 as fragile · d52be957
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Due to spurious output changes described in #23648.
      
      (cherry picked from commit c046a238)
      d52be957
    • Ben Gamari's avatar
      base: Bump version to 4.19 · 1211112a
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Updates all boot library submodules.
      
      (cherry picked from commit 433d99a3)
      1211112a
    • Ben Gamari's avatar
      template-haskell: Bump version to 2.21.0.0 · 83766dbf
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Bumps exceptions submodule.
      
      (cherry picked from commit bf57fc9a)
      83766dbf
    • Ryan Scott's avatar
      Look through TH splices in splitHsApps · fdef003a
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      This modifies `splitHsApps` (a key function used in typechecking function
      applications) to look through untyped TH splices and quasiquotes. Not doing so
      was the cause of #21077. This builds on !7821 by making `splitHsApps` match on
      `HsUntypedSpliceTop`, which contains the `ThModFinalizers` that must be run as
      part of invoking the TH splice. See the new `Note [Looking through Template
      Haskell splices in splitHsApps]` in `GHC.Tc.Gen.Head`.
      
      Along the way, I needed to make the type of `splitHsApps.set` slightly more
      general to accommodate the fact that the location attached to a quasiquote is
      a `SrcAnn NoEpAnns` rather than a `SrcSpanAnnA`.
      
      Fixes #21077.
      fdef003a
  13. Aug 03, 2023
  14. Aug 02, 2023
    • Arnaud Spiwack's avatar
      Desugar non-recursive lets to non-recursive lets (take 2) · 6a2f4a20
      Arnaud Spiwack authored and Marge Bot's avatar Marge Bot committed
      This reverts commit 522bd584. And
      takes care of the case that I missed in my previous attempt. Namely
      the case of an AbsBinds with no type variables and no dictionary
      variable.
      
      Ironically, the comment explaining why non-recursive lets were
      desugared to recursive lets were pointing specifically at this case
      as the reason. I just failed to understand that it was until Simon PJ
      pointed it out to me.
      
      See #23550 for more discussion.
      6a2f4a20
Loading