Skip to content
Snippets Groups Projects
  1. Nov 30, 2022
  2. Nov 29, 2022
    • Sylvain Henry's avatar
      Add Javascript backend · cc25d52e
      Sylvain Henry authored
      
      Add JS backend adapted from the GHCJS project by Luite Stegeman.
      
      Some features haven't been ported or implemented yet. Tests for these
      features have been disabled with an associated gitlab ticket.
      
      Bump array submodule
      
      Work funded by IOG.
      
      Co-authored-by: default avatarJeffrey Young <jeffrey.young@iohk.io>
      Co-authored-by: default avatarLuite Stegeman <stegeman@gmail.com>
      Co-authored-by: default avatarJosh Meredith <joshmeredith2008@gmail.com>
      cc25d52e
    • Ben Gamari's avatar
      testsuite: Don't use grep -q in unpack_sums_7 · def47dd3
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      `grep -q` closes stdin as soon as it finds the pattern it is looking
      for, resulting in #22484.
      def47dd3
    • Ben Gamari's avatar
      testsuite: Mark unpack_sums_6 as fragile due to #22504 · ab23dc5e
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This test is explicitly dependent upon runtime, which is generally not
      appropriate given that the testsuite is run in parallel and generally
      saturates the CPU.
      ab23dc5e
    • Simon Peyton Jones's avatar
      Be a bit more selective about floating bottoming expressions · 02e282ec
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      This MR arranges to float a bottoming expression to the top
      only if it escapes a value lambda.
      
      See #22494 and Note [Floating to the top] in SetLevels.
      
      This has a generally beneficial effect in nofib
      
      +-------------------------------++----------+
      |                               ||tsv (rel) |
      +===============================++==========+
      |           imaginary/paraffins ||   -0.93% |
      |                imaginary/rfib ||   -0.05% |
      |                      real/fem ||   -0.03% |
      |                    real/fluid ||   -0.01% |
      |                   real/fulsom ||   +0.05% |
      |                   real/gamteb ||   -0.27% |
      |                       real/gg ||   -0.10% |
      |                   real/hidden ||   -0.01% |
      |                      real/hpg ||   -0.03% |
      |                      real/scs ||  -11.13% |
      |         shootout/k-nucleotide ||   -0.01% |
      |               shootout/n-body ||   -0.08% |
      |   shootout/reverse-complement ||   -0.00% |
      |        shootout/spectral-norm ||   -0.02% |
      |             spectral/fibheaps ||   -0.20% |
      |           spectral/hartel/fft ||   -1.04% |
      |         spectral/hartel/solid ||   +0.33% |
      |     spectral/hartel/wave4main ||   -0.35% |
      |                 spectral/mate ||   +0.76% |
      +===============================++==========+
      |                     geom mean ||   -0.12% |
      
      The effect on compile time is generally slightly beneficial
      
      Metrics: compile_time/bytes allocated
      ----------------------------------------------
      MultiLayerModulesTH_OneShot(normal)  +0.3%
                        PmSeriesG(normal)  -0.2%
                        PmSeriesT(normal)  -0.1%
                           T10421(normal)  -0.1%
                          T10421a(normal)  -0.1%
                           T10858(normal)  -0.1%
                           T11276(normal)  -0.1%
                          T11303b(normal)  -0.2%
                           T11545(normal)  -0.1%
                           T11822(normal)  -0.1%
                           T12150(optasm)  -0.1%
                           T12234(optasm)  -0.3%
                           T13035(normal)  -0.2%
                           T16190(normal)  -0.1%
                           T16875(normal)  -0.4%
                          T17836b(normal)  -0.2%
                           T17977(normal)  -0.2%
                          T17977b(normal)  -0.2%
                           T18140(normal)  -0.1%
                           T18282(normal)  -0.1%
                           T18304(normal)  -0.2%
                          T18698a(normal)  -0.1%
                           T18923(normal)  -0.1%
                           T20049(normal)  -0.1%
                          T21839r(normal)  -0.1%
                            T5837(normal)  -0.4%
                            T6048(optasm)  +3.2% BAD
                            T9198(normal)  -0.2%
                            T9630(normal)  -0.1%
             TcPlugin_RewritePerf(normal)  -0.4%
                   hard_hole_fits(normal)  -0.1%
      
                                geo. mean  -0.0%
                                minimum    -0.4%
                                maximum    +3.2%
      
      The T6048 outlier is hard to pin down, but it may be the effect of
      reading in more interface files definitions. It's a small program for
      which compile time is very short, so I'm not bothered about it.
      
      Metric Increase:
          T6048
      02e282ec
    • Krzysztof Gogolewski's avatar
      Change printing of sized literals to match the proposal · 646969d4
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      Literals in Core were printed as e.g. 0xFF#16 :: Int16#.
      The proposal 451 now specifies syntax 0xFF#Int16.
      This change affects the Core printer only - more to be done later.
      
      Part of #21422.
      646969d4
    • Apoorv Ingle's avatar
      Killing cc_fundeps, streamlining kind equality orientation, and type equality processing order · 8d15eadc
      Apoorv Ingle authored and Marge Bot's avatar Marge Bot committed
      Fixes: #217093
      Associated to #19415
      
      This change
      * Flips the orientation of the the generated kind equality coercion in canEqLHSHetero;
      * Removes `cc_fundeps` in CDictCan as the check was incomplete;
      * Changes `canDecomposableTyConAppOk` to ensure we process kind equalities before type equalities and avoiding a call to `canEqLHSHetero` while processing wanted TyConApp equalities
      * Adds 2 new tests for validating the change
         - testsuites/typecheck/should_compile/T21703.hs and
         - testsuites/typecheck/should_fail/T19415b.hs (a simpler version of T19415.hs)
      * Misc: Due to the change in the equality direction some error messages now have flipped type mismatch errors
      * Changes in Notes:
        - Note [Fundeps with instances, and equality orientation] supercedes Note [Fundeps with instances]
        - Added Note [Kind Equality Orientation] to visualize the kind flipping
        - Added Note [Decomposing Dependent TyCons and Processing Wanted Equalties]
      8d15eadc
    • Cheng Shao's avatar
      compiler: remove unused MO_U_MulMayOflo · d4134e92
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      We actually only emit MO_S_MulMayOflo and never emit MO_U_MulMayOflo anywhere.
      d4134e92
  3. Nov 28, 2022
  4. Nov 26, 2022
  5. Nov 25, 2022
    • Simon Peyton Jones's avatar
      Fix decomposition of TyConApps · d10dc6bd
      Simon Peyton Jones authored and Simon Peyton Jones's avatar Simon Peyton Jones committed
      Ticket #22331 showed that we were being too eager to decompose
      a Wanted TyConApp, leading to incompleteness in the solver.
      
      To understand all this I ended up doing a substantial rewrite
      of the old Note [Decomposing equalities], now reborn as
      Note [Decomposing TyConApp equalities]. Plus rewrites of other
      related Notes.
      
      The actual fix is very minor and actually simplifies the code: in
      `can_decompose` in `GHC.Tc.Solver.Canonical.canTyConApp`, we now call
      `noMatchableIrreds`.  A closely related refactor: we stop trying to
      use the same "no matchable givens" function here as in
      `matchClassInst`.  Instead split into two much simpler functions.
      d10dc6bd
    • Vladislav Zavialov's avatar
      Print unticked promoted data constructors (#20531) · 13d627bb
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      
      Before this patch, GHC unconditionally printed ticks before promoted
      data constructors:
      
      	ghci> type T = True  -- unticked (user-written)
      	ghci> :kind! T
      	T :: Bool
      	= 'True              -- ticked (compiler output)
      
      After this patch, GHC prints ticks only when necessary:
      
      	ghci> type F = False    -- unticked (user-written)
      	ghci> :kind! F
      	F :: Bool
      	= False                 -- unticked (compiler output)
      
      	ghci> data False        -- introduce ambiguity
      	ghci> :kind! F
      	F :: Bool
      	= 'False                -- ticked by necessity (compiler output)
      
      The old behavior can be enabled by -fprint-redundant-promotion-ticks.
      
      Summary of changes:
      * Rename PrintUnqualified to NamePprCtx
      * Add QueryPromotionTick to it
      * Consult the GlobalRdrEnv to decide whether to print a tick (see mkPromTick)
      * Introduce -fprint-redundant-promotion-ticks
      
      Co-authored-by: default avatarArtyom Kuznetsov <hi@wzrd.ht>
      13d627bb
    • sheaf's avatar
      Review suggestions for assorted fixes to avoid Data.List.{head,tail} · 1f1b99b8
      sheaf authored and Marge Bot's avatar Marge Bot committed
      1f1b99b8
    • Bodigrim's avatar
      Assorted fixes to avoid Data.List.{head,tail} · 5943e739
      Bodigrim authored and Marge Bot's avatar Marge Bot committed
      5943e739
  6. Nov 24, 2022
    • Cheng Shao's avatar
      rts: fix missing Arena.h symbols in RtsSymbols.c · d198a19a
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      It was an unfortunate oversight in !8961 and broke devel2 builds.
      d198a19a
    • Andrei Borzenkov's avatar
      Convert diagnostics in GHC.Rename.Expr to proper TcRnMessage (#20115) · 86ff1523
      Andrei Borzenkov authored and Marge Bot's avatar Marge Bot committed
      
      Problem: avoid usage of TcRnMessageUnknown
      
      Solution:
      The following `TcRnMessage` messages has been introduced:
        TcRnNoRebindableSyntaxRecordDot
        TcRnNoFieldPunsRecordDot
        TcRnIllegalStaticExpression
        TcRnIllegalStaticFormInSplice
        TcRnListComprehensionDuplicateBinding
        TcRnEmptyStmtsGroup
        TcRnLastStmtNotExpr
        TcRnUnexpectedStatementInContext
        TcRnIllegalTupleSection
        TcRnIllegalImplicitParameterBindings
        TcRnSectionWithoutParentheses
      
      Co-authored-by: sheaf's avatarsheaf <sam.derbyshire@gmail.com>
      86ff1523
    • Matthew Pickering's avatar
      notes: Fix references to HPT space leak note · 11627c42
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      Updating this note was missed when updating the HPT to the HUG.
      
      Fixes #22477
      11627c42
    • Vladislav Zavialov's avatar
      Check if the SDoc starts with a single quote (#22488) · 178c1fd8
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This patch fixes pretty-printing of character literals
      inside promoted lists and tuples.
      
      When we pretty-print a promoted list or tuple whose first element
      starts with a single quote, we want to add a space between the opening
      bracket and the element:
      
      	'[True]    -- ok
      	'[ 'True]  -- ok
      	'['True]   -- not ok
      
      If we don't add the space, we accidentally produce a character
      literal '['.
      
      Before this patch, pprSpaceIfPromotedTyCon inspected the type as an AST
      and tried to guess if it would be rendered with a single quote. However,
      it missed the case when the inner type was itself a character literal:
      
      	'[ 'x']  -- ok
      	'['x']   -- not ok
      
      Instead of adding this particular case, I opted for a more future-proof
      solution: check the SDoc directly. This way we can detect if the single
      quote is actually there instead of trying to predict it from the AST.
      The new function is called spaceIfSingleQuote.
      178c1fd8
    • M Farkas-Dyck's avatar
      Scrub some no-warning pragmas. · 040bfdc3
      M Farkas-Dyck authored and Marge Bot's avatar Marge Bot committed
      040bfdc3
  7. Nov 23, 2022
  8. Nov 22, 2022
    • Jonathan Dowland's avatar
      utils/unlit: adjust parser to match Report spec · e817c871
      Jonathan Dowland authored and Marge Bot's avatar Marge Bot committed
      The Haskell 2010 Report says that, for Latex-style Literate format,
      "Program code begins on the first line following a line that begins
      \begin{code}". (This is unchanged from the 98 Report)
      
      However the unlit.c implementation only matches a line that contains
      "\begin{code}" and nothing else. One consequence of this is that one
      cannot suffix Latex options to the code environment. I.e., this does
      not work:
      
      \begin{code}[label=foo,caption=Foo Code]
      
      Adjust the matcher to conform to the specification from the Report.
      
      The Haskell Wiki currently recommends suffixing a '%' to \begin{code}
      in order to deliberately hide a code block from Haskell. This is bad
      advice, as it's relying on an implementation quirk rather than specified
      behaviour. None-the-less, some people have tried to use it, c.f.
      <https://mail.haskell.org/pipermail/haskell-cafe/2009-September/066780.html>
      
      An alternative solution is to define a separate, equivalent Latex
      environment to "code", that is functionally identical in Latex but
      ignored by unlit. This should not be a burden: users are required to
      manually define the code environment anyway, as it is not provided
      by the Latex verbatim or lstlistings packages usually used for
      presenting code in documents.
      
      Fixes #3549.
      e817c871
    • Oleg Grenrus's avatar
      Add unsafePtrEquality# restricted to UnliftedTypes · 9d61c182
      Oleg Grenrus authored and Marge Bot's avatar Marge Bot committed
      9d61c182
    • Andreas Klebinger's avatar
      hadrian:Set TNTC when running testsuite. · de5fb348
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      de5fb348
    • Andreas Klebinger's avatar
      Optimize getLevity. · e5b68183
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      Avoid the intermediate data structures allocated by splitTyConApp.
      This avoids ~0.5% of allocations for a build using -O2.
      
      Fixes #22254
      e5b68183
    • Duncan Coutts's avatar
      Reveiew feedback: improve one of the TODO comments · 7181b074
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      The one about the nonsense (const False) test on WinIO for there being any IO
      or timers pending, leading to unnecessary complication later in the
      scheduler.
      7181b074
    • Duncan Coutts's avatar
      Pass the Capability *cap explicitly to appendToIOBlockedQueue · 667fe5a4
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      And to insertIntoSleepingQueue. Again, it's a bit cleaner and simpler
      though not strictly necessary given that these primops are currently
      only used in the non-threaded RTS.
      667fe5a4
    • Duncan Coutts's avatar
      Pass the Capability *cap explicitly to awaitEvent · 054dcc9d
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      It is currently only used in the non-threaded RTS so it works to use
      MainCapability, but it's a bit nicer to pass the cap anyway. It's
      certainly shorter.
      054dcc9d
    • Duncan Coutts's avatar
      Move the awaitEvent declaration into IOManager.h · 9943baf9
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      And add or adjust comments at the use sites of awaitEvent.
      9943baf9
    • Duncan Coutts's avatar
      Expand emptyThreadQueues inline for clarity · 32946220
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      It was not really adding anything. The name no longer meant anything
      since those I/O and timeout queues do not belong to the scheuler.
      
      In one of the two places it was used, the comments already had to
      explain what it did, whereas now the code matches the comment nicely.
      32946220
    • Duncan Coutts's avatar
      Replace EMPTY_{BLOCKED,SLEEPING}_QUEUE macros by function · 664b034b
      Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
      These are the macros originaly from Scheduler.h, previously moved to
      IOManager.h, and now replaced with a single inline function
      anyPendingTimeoutsOrIO(). We can use a single function since the two
      macros were always checked together.
      
      Note that since anyPendingTimeoutsOrIO is defined for all IO manager
      cases, including threaded, we do not need to guard its use by cpp
       #if !defined(THREADED_RTS)
      664b034b
Loading