Skip to content
Snippets Groups Projects
  1. Mar 05, 2024
    • Andreas Klebinger's avatar
      x86-ncg: Fix fma codegen when arguments are globals · 82ccb801
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      Fix a bug in the x86 ncg where results would be wrong when the desired output
      register and one of the input registers were the same global.
      
      Also adds a tiny optimization to make use of the memory addressing
      support when convenient.
      
      Fixes #24496
      82ccb801
  2. Mar 04, 2024
    • Finley McIlwaine's avatar
      add -fprof-late-overloaded and -fprof-late-overloaded-calls · 61bb5ff6
      Finley McIlwaine authored
      * Refactor late cost centre insertion for extensibility
      * Add two more late cost centre insertion methods that add SCCs to overloaded
        top level bindings and call sites with dictionary arguments.
      * Some tests for the basic functionality of the new insertion methods
      
      Resolves: #24500
      61bb5ff6
  3. Mar 02, 2024
  4. Mar 01, 2024
    • Arnaud Spiwack's avatar
      Improve error messages coming from non-linear patterns · dec6d8d3
      Arnaud Spiwack authored and Marge Bot's avatar Marge Bot committed
      This enriched the `CtOrigin` for non-linear patterns to include data
      of the pattern that created the constraint (which can be quite useful
      if it occurs nested in a pattern) as well as an explanation why the
      pattern is non-restricted in (at least in some cases).
      dec6d8d3
    • Sylvain Henry's avatar
      JS linker: filter unboxed tuples · bbdb6286
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      bbdb6286
    • Torsten Schmits's avatar
      Introduce ListTuplePuns extension · d91d00fc
      Torsten Schmits authored and Marge Bot's avatar Marge Bot committed
      This implements Proposal 0475, introducing the `ListTuplePuns` extension
      which is enabled by default.
      
      Disabling this extension makes it invalid to refer to list, tuple and
      sum type constructors by using built-in syntax like `[Int]`,
      `(Int, Int)`, `(# Int#, Int# #)` or `(# Int | Int #)`.
      Instead, this syntax exclusively denotes data constructors for use with
      `DataKinds`.
      The conventional way of referring to these data constructors by
      prefixing them with a single quote (`'(Int, Int)`) is now a parser
      error.
      
      Tuple declarations have been moved to `GHC.Tuple.Prim` and the `Solo`
      data constructor has been renamed to `MkSolo` (in a previous commit).
      Unboxed tuples and sums now have real source declarations in `GHC.Types`.
      Unit and solo types for tuples are now called `Unit`, `Unit#`, `Solo`
      and `Solo#`.
      Constraint tuples now have the unambiguous type constructors `CTuple<n>`
      as well as `CUnit` and `CSolo`, defined in `GHC.Classes` like before.
      
      A new parser construct has been added for the unboxed sum data
      constructor declarations.
      
      The type families `Tuple`, `Sum#` etc. that were intended to provide
      nicer syntax have been omitted from this change set due to inference
      problems, to be implemented at a later time.
      See the MR discussion for more info.
      
      Updates the submodule utils/haddock.
      Updates the cabal submodule due to new language extension.
      
          Metric Increase:
              haddock.base
      
          Metric Decrease:
              MultiLayerModulesTH_OneShot
              size_hello_artifact
      
      Proposal document: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst
      
      Merge request: !8820
      
      Tracking ticket: #21294
      d91d00fc
    • Cheng Shao's avatar
      testsuite: fix T23540 fragility on 32-bit platforms · 3836a110
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      T23540 is fragile on 32-bit platforms. The root cause is usage of
      `getEvidenceTreesAtPoint`, which internally relies on `Name`'s `Ord`
      instance, which is indeterministic. The solution is adding a
      deterministic `Ord` instance for `EvidenceInfo` and sorting the
      evidence trees before pretty printing. Fixes #24449.
      3836a110
  5. Feb 29, 2024
  6. Feb 27, 2024
    • jeffrey young's avatar
      cg: Remove GHC.Cmm.DataFlow.Collections · dd29d3b2
      jeffrey young authored and Marge Bot's avatar Marge Bot committed
      In pursuit of #15560 and #17957 and generally removing redundancy.
      dd29d3b2
    • Matthew Craven's avatar
      StgToJS: Simplify ExprInline constructor of ExprResult · 3da0a551
      Matthew Craven authored and Marge Bot's avatar Marge Bot committed
      Its payload was used only for a small optimization in genAlts,
      avoiding a few assignments for programs of this form:
      
        case NormalDataCon arg1 arg2 of x { NormalDataCon x1 x2 -> ... ; }
      
      But when compiling with optimizations, this sort of code is
      generally eliminated by case-of-known-constructor in Core-to-Core.
      So it doesn't seem worth tracking and cleaning up again in StgToJS.
      3da0a551
  7. Feb 25, 2024
  8. Feb 24, 2024
  9. Feb 23, 2024
    • Ben Gamari's avatar
      Allow docstrings after exports · 5121a4ed
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Here we extend the parser and AST to preserve docstrings following
      export items. We then extend Haddock to parse `@since` annotations in
      such docstrings, allowing changes in export structure to be properly
      documented.
      
      Bumps haddock submodule.
      5121a4ed
  10. Feb 21, 2024
    • Adam Gundry's avatar
      Define GHC2024 language edition (#24320) · 09941666
      Adam Gundry authored
      See https://github.com/ghc-proposals/ghc-proposals/pull/613
      
      . Also
      fixes #24343 and improves the documentation of language editions.
      
      Co-authored-by: Joachim Breitner's avatarJoachim Breitner <mail@joachim-breitner.de>
      09941666
    • Cheng Shao's avatar
      rts: remove unused HAVE_C11_ATOMICS macro · 1387966a
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This commit removes the unused HAVE_C11_ATOMICS macro. We used to have
      a few places that have fallback paths when HAVE_C11_ATOMICS is not
      defined, but that is completely redundant, since the
      FP_CC_SUPPORTS__ATOMICS configure check will fail when the C compiler
      doesn't support C11 style atomics. There are also many places (e.g. in
      unreg backend, SMP.h, library cbits, etc) where we unconditionally use
      C11 style atomics anyway which work in even CentOS 7 (gcc 4.8), the
      oldest distro we test in our CI, so there's no value in keeping
      HAVE_C11_ATOMICS.
      1387966a
    • Andrei Borzenkov's avatar
      Namespacing for fixity signatures (#14032) · 77629e76
      Andrei Borzenkov authored and Marge Bot's avatar Marge Bot committed
      Namespace specifiers were added to syntax of fixity signatures:
        - sigdecl ::= infix prec ops | ...
        + sigdecl ::= infix prec namespace_spec ops | ...
      
      To preserve namespace during renaming MiniFixityEnv type
      now has separate FastStringEnv fields for names that should be
      on the term level and for name that should be on the type level.
      
      makeMiniFixityEnv function was changed to fill MiniFixityEnv in the right way:
       - signatures without namespace specifiers fill both fields
       - signatures with 'data' specifier fill data field only
       - signatures with 'type' specifier fill type field only
      
      Was added helper function lookupMiniFixityEnv that takes care about
      looking for a name in an appropriate namespace.
      
      Updates haddock submodule.
      
      Metric Decrease:
          MultiLayerModulesTH_OneShot
      77629e76
  11. Feb 19, 2024
    • Andrei Borzenkov's avatar
      Parser, renamer, type checker for @a-binders (#17594) · 0dbd729e
      Andrei Borzenkov authored and Marge Bot's avatar Marge Bot committed
      GHC Proposal 448 introduces binders for invisible type arguments
      (@a-binders) in various contexts. This patch implements @-binders
      in lambda patterns and function equations:
      
        {-# LANGUAGE TypeAbstractions #-}
      
        id1 :: a -> a
        id1 @t x = x :: t      -- @t-binder on the LHS of a function equation
      
        higherRank :: (forall a. (Num a, Bounded a) => a -> a) -> (Int8, Int16)
        higherRank f = (f 42, f 42)
      
        ex :: (Int8, Int16)
        ex = higherRank (\ @a x -> maxBound @a - x )
                               -- @a-binder in a lambda pattern in an argument
                               -- to a higher-order function
      
      Syntax
      ------
      
      To represent those @-binders in the AST, the list of patterns in Match
      now uses ArgPat instead of Pat:
      
        data Match p body
           = Match {
               ...
      -        m_pats  :: [LPat p],
      +        m_pats  :: [LArgPat p],
               ...
         }
      
      + data ArgPat pass
      +   = VisPat (XVisPat pass) (LPat pass)
      +   | InvisPat (XInvisPat pass) (HsTyPat (NoGhcTc pass))
      +   | XArgPat !(XXArgPat pass)
      
      The VisPat constructor represents patterns for visible arguments,
      which include ordinary value-level arguments and required type arguments
      (neither is prefixed with a @), while InvisPat represents invisible type
      arguments (prefixed with a @).
      
      Parser
      ------
      
      In the grammar (Parser.y), the lambda and lambda-cases productions of
      aexp non-terminal were updated to accept argpats instead of apats:
      
        aexp : ...
      -        | '\\' apats '->' exp
      +        | '\\' argpats '->' exp
               ...
      -        | '\\' 'lcases' altslist(apats)
      +        | '\\' 'lcases' altslist(argpats)
               ...
      
      + argpat : apat
      +        | PREFIX_AT atype
      
      Function left-hand sides did not require any changes to the grammar, as
      they were already parsed with productions capable of parsing @-binders.
      Those binders were being rejected in post-processing (isFunLhs), and now
      we accept them.
      
      In Parser.PostProcess, patterns are constructed with the help of
      PatBuilder, which is used as an intermediate data structure when
      disambiguating between FunBind and PatBind. In this patch we define
      ArgPatBuilder to accompany PatBuilder. ArgPatBuilder is a short-lived
      data structure produced in isFunLhs and consumed in checkFunBind.
      
      Renamer
      -------
      
      Renaming of @-binders builds upon prior work on type patterns,
      implemented in 2afbddb0, which guarantees proper scoping and
      shadowing behavior of bound type variables.
      
      This patch merely defines rnLArgPatsAndThen to process a mix of visible
      and invisible patterns:
      
      + rnLArgPatsAndThen :: NameMaker -> [LArgPat GhcPs] -> CpsRn [LArgPat GhcRn]
      + rnLArgPatsAndThen mk = mapM (wrapSrcSpanCps rnArgPatAndThen) where
      +   rnArgPatAndThen (VisPat x p)    = ... rnLPatAndThen ...
      +   rnArgPatAndThen (InvisPat _ tp) = ... rnHsTyPat ...
      
      Common logic between rnArgPats and rnPats is factored out into the
      rn_pats_general helper.
      
      Type checker
      ------------
      
      Type-checking of @-binders builds upon prior work on lazy skolemisation,
      implemented in f5d3e03c.
      
      This patch extends tcMatchPats to handle @-binders. Now it takes and
      returns a list of LArgPat rather than LPat:
      
        tcMatchPats ::
                    ...
      -             -> [LPat GhcRn]
      +             -> [LArgPat GhcRn]
                    ...
      -             -> TcM ([LPat GhcTc], a)
      +             -> TcM ([LArgPat GhcTc], a)
      
      Invisible binders in the Match are matched up with invisible (Specified)
      foralls in the type. This is done with a new clause in the `loop` worker
      of tcMatchPats:
      
        loop :: [LArgPat GhcRn] -> [ExpPatType] -> TcM ([LArgPat GhcTc], a)
        loop (L l apat : pats) (ExpForAllPatTy (Bndr tv vis) : pat_tys)
          ...
          -- NEW CLAUSE:
          | InvisPat _ tp <- apat, isSpecifiedForAllTyFlag vis
          = ...
      
      In addition to that, tcMatchPats no longer discards type patterns. This
      is done by filterOutErasedPats in the desugarer instead.
      
      x86_64-linux-deb10-validate+debug_info
      Metric Increase:
          MultiLayerModulesTH_OneShot
      0dbd729e
    • Ben Gamari's avatar
      Drop dependence on `touch` · 7a0293cc
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This drops GHC's dependence on the `touch` program, instead implementing
      it within GHC. This eliminates an external dependency and means that we
      have one fewer program to keep track of in the `configure` script
      7a0293cc
  12. Feb 17, 2024
  13. Feb 16, 2024
  14. Feb 15, 2024
  15. Feb 14, 2024
    • Cheng Shao's avatar
      compiler/rts: fix wasm unreg regression · d8d1333a
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This commit fixes two wasm unreg regressions caught by a nightly
      pipeline:
      
      - Unknown stg_scheduler_loopzh symbol when compiling scheduler.cmm
      - Invalid _hs_constructor(101) function name when handling ctor
      d8d1333a
    • Andreas Klebinger's avatar
      Fix ffi callbacks with >6 args and non-64bit args. · de589554
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      Check for ptr/int arguments rather than 64-bit width arguments when counting
      integer register arguments.
      The old approach broke when we stopped using exclusively W64-sized types to represent
      sub-word sized integers.
      
      Fixes #24314
      de589554
    • Alan Zimmerman's avatar
      EPA: Move EpAnn out of extension points · 0e01e1db
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Leaving a few that are too tricky, maybe some other time.
      
      Also
       - remove some unneeded helpers from Parser.y
       - reduce allocations with strictness annotations
      
      Updates haddock submodule
      
      Metric Decrease:
          parsing001
      0e01e1db
  16. Feb 13, 2024
  17. Feb 12, 2024
    • Simon Peyton Jones's avatar
      Remove a dead comment · ff2c0cc9
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      Just remove an out of date block of commented-out code, and tidy up
      the relevant Notes.  See #8317.
      ff2c0cc9
    • Sylvain Henry's avatar
      JS: add support for linking C sources · aef587f6
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      Support linking C sources with JS output of the JavaScript backend.
      See the added documentation in the users guide.
      
      The implementation simply extends the JS linker to use the objects (.o)
      that were already produced by the emcc compiler and which were filtered
      out previously. I've also added some options to control the link with C
      functions (see the documentation about pragmas).
      
      With this change I've successfully compiled the direct-sqlite package
      which embeds the sqlite.c database code. Some wrappers are still
      required (see the documentation about wrappers) but everything generic
      enough to be reused for other libraries have been integrated into
      rts/js/mem.js.
      aef587f6
Loading