Skip to content
Snippets Groups Projects
  1. May 28, 2024
    • Teo Camarasu's avatar
      template-haskell: Move wired-ins to ghc-internal · 228dcae6
      Teo Camarasu authored and Teo Camarasu's avatar Teo Camarasu committed
      Thus we make `template-haskell` reinstallable and keep it as the public
      API for Template Haskell.
      All of the wired-in identifiers are moved to `ghc-internal`.
      This necessitates also moving much of `ghc-boot-th` into `ghc-internal`.
      These modules are then re-exported from `ghc-boot-th` and
      `template-haskell`.
      To avoid a dependency on `template-haskell` from `lib:ghc`, we instead
      depend on the TH ASTs via `ghc-boot-th`.
      
      As `template-haskell` no longer has special status, we can drop the
      logic adding an implicit dependency on `template-haskell` when using TH.
      We can also drop the `template-haskell-next` package, which was
      previously used when bootstrapping.
      
      When bootstrapping, we need to vendor the TH AST modules from
      `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap`
      cabal flag as before. See Note [Bootstrapping Template Haskell].
      
      We split out a GHC.Internal.TH.Lift module resolving #24752.
      This module is only built when not bootstrapping.
      
      Resolves #24703
      
      -------------------------
      Metric Increase:
          ghc_boot_th_dir
          ghc_boot_th_so
      -------------------------
      228dcae6
  2. May 24, 2024
  3. May 23, 2024
  4. May 22, 2024
  5. May 20, 2024
  6. May 19, 2024
    • Serge S. Gulin's avatar
      Unicode: General Category size test (related #24789) · 7d3d9bbf
      Serge S. Gulin authored
      Added trivial size performance test which involves unicode general category usage via `read`.
      The `read` itself uses general category to detect spaces.
      
      The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789.
      7d3d9bbf
  7. May 17, 2024
    • Hécate Moonlight's avatar
      Add haddock to the whitespace lint ignore list · 527bfbfb
      Hécate Moonlight authored and Ben Gamari's avatar Ben Gamari committed
      527bfbfb
    • Hécate Moonlight's avatar
      Add exceptions to the dangling notes list · aba1d304
      Hécate Moonlight authored and Ben Gamari's avatar Ben Gamari committed
      aba1d304
    • Andreas Klebinger's avatar
      TagAnalysis: Treat all bottom ids as tagged during analysis. · 0962b50d
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      Ticket #24806 showed that we also need to treat dead end thunks as
      tagged during the analysis.
      0962b50d
    • jeffrey young's avatar
      testsuite: make find_so regex less general · 04179044
      jeffrey young authored and Marge Bot's avatar Marge Bot committed
      Closes #24759
      
      Background. In MR !12372 we began tracking shared object files and
      directories sizes for dependencies. However, this broke  release builds
      because release builds alter the filenames swapping "in-place" for a
      hash. This was not considered in the MR and thus broke release
      pipelines. Furthermore, the rts_so test was found to be wildly varying
      and was therefore disabled in !12561.
      
      This commit fixes both of these issues:
      
      - fix the rts_so test by making the regex less general, now the rts_so
      test and all other foo.so tests must match
      "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the
      rts_so test from accidentally matching different rts variants such as
      rts_threaded, which was the cause of the wild swings after !12372.
      
      - add logic to match either a hash or the string in-place. This should
      make the find_so function build agnostic.
      04179044
    • Teo Camarasu's avatar
      rts: Allocate non-moving segments with megablocks · b38dcf39
      Teo Camarasu authored and Marge Bot's avatar Marge Bot committed
      Non-moving segments are 8 blocks long and need to be aligned.
      Previously we serviced allocations by grabbing 15 blocks, finding
      an aligned 8 block group in it and returning the rest.
      This proved to lead to high levels of fragmentation as a de-allocating a segment
      caused an 8 block gap to form, and this could not be reused for allocation.
      
      This patch introduces a segment allocator based around using entire
      megablocks to service segment allocations in bulk.
      
      When there are no free segments, we grab an entire megablock and fill it
      with aligned segments. As the megablock is free, we can easily guarantee
      alignment. Any unused segments are placed on a free list.
      
      It only makes sense to free segments in bulk when all of the segments in
      a megablock are freeable. After sweeping, we grab the free list, sort it,
      and find all groups of segments where they cover the megablock and free
      them.
      This introduces a period of time when free segments are not available to
      the mutator, but the risk that this would lead to excessive allocation
      is low. Right after sweep, we should have an abundance of partially full
      segments, and this pruning step is relatively quick.
      
      In implementing this we drop the logic that kept NONMOVING_MAX_FREE
      segments on the free list.
      
      We also introduce an eventlog event to log the amount of pruned/retained
      free segments.
      
      See Note [Segment allocation strategy]
      
      Resolves #24150
      
      -------------------------
      Metric Decrease:
          T13253
          T19695
      -------------------------
      b38dcf39
  8. May 16, 2024
  9. May 15, 2024
  10. May 14, 2024
  11. May 12, 2024
  12. May 11, 2024
    • Jade's avatar
      Improve performance of Data.List.sort(By) · fc2d6de1
      Jade authored and Marge Bot's avatar Marge Bot committed
      This patch improves the algorithm to sort lists in base.
      It does so using two strategies:
      
      1) Use a four-way-merge instead of the 'default' two-way-merge.
      This is able to save comparisons and allocations.
      
      2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization.
      This mainly benefits types with a fast (>).
      
      Note that this *may* break instances with a *malformed* Ord instance
      where `a > b` is *not* equal to `compare a b == GT`.
      
      CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236
      
      Fixes #24280
      
      -------------------------
      Metric Decrease:
          MultiLayerModulesTH_Make
          T10421
          T13719
          T15164
          T18698a
          T18698b
          T1969
          T9872a
          T9961
          T18730
          WWRec
          T12425
          T15703
      -------------------------
      fc2d6de1
  13. May 10, 2024
    • Cheng Shao's avatar
      testsuite: fix testwsdeque with recent clang · a9979f55
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This patch fixes compilation of testwsdeque.c with recent versions of
      clang, which will fail with the error below:
      
      ```
      testwsdeque.c:95:33: error:
           warning: format specifies type 'long' but the argument has type 'void *' [-Wformat]
             95 |         barf("FAIL: %ld %d %d", p, n, val);
                |                     ~~~         ^
      
      testwsdeque.c:95:39: error:
           warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat]
             95 |         barf("FAIL: %ld %d %d", p, n, val);
                |                            ~~         ^~~
                |                            %lu
      
      testwsdeque.c:133:42: error:
           error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types]
            133 |         createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n);
                |                                          ^~~~~
      
      /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error:
           note: passing argument to parameter 'startProc' here
            193 |                                     OSThreadProc *startProc, void *param);
                |                                                   ^
      
      2 warnings and 1 error generated.
      ```
      a9979f55
    • Ben Gamari's avatar
      IPE: Eliminate dependency on Read · ab840ce6
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Instead of encoding the closure type as decimal string we now simply
      represent it as an integer, eliminating the need for `Read` in
      `GHC.Internal.InfoProv.Types.peekInfoProv`.
      
      Closes #24504.
      
      -------------------------
      Metric Decrease:
          T24602_perf_size
          size_hello_artifact
      -------------------------
      ab840ce6
    • Zejun Wu's avatar
      Make renamer to be more flexible with parens in the LHS of the rules · 4d3acbcf
      Zejun Wu authored and Marge Bot's avatar Marge Bot committed
      We used to reject LHS like `(f a) b` in RULES and requires it to be written as
      `f a b`. It will be handy to allow both as the expression may be more
      readable with extra parens in some cases when infix operator is involved.
      Espceially when TemplateHaskell is used, extra parens may be added out of
      user's control and result in "valid" rules being rejected and there
      are not always ways to workaround it.
      
      Fixes #24621
      4d3acbcf
  14. May 08, 2024
  15. May 07, 2024
    • Arsen Arsenović's avatar
      Split out the C-- preprocessor, and make it pass -g0 · 25b0b404
      Arsen Arsenović authored and Marge Bot's avatar Marge Bot committed
      Previously, C-- was processed with the C preprocessor program.  This
      means that it inherited flags passed via -optc.  A flag that is somewhat
      often passed through -optc is -g.  At certain -g levels (>=2), GCC
      starts emitting defines *after* preprocessing, for the purposes of
      debug info generation.  This is not useful for the C-- compiler, and, in
      fact, causes lexer errors.  We can suppress this effect (safely, if
      supported) via -g0.
      
      As a workaround, in older versions of GCC (<=10), GCC only emitted
      defines if a certain set of -g*3 flags was passed.  Newer versions check
      the debug level.  For the former, we filter out those -g*3 flags and,
      for the latter, we specify -g0 on top of that.
      
      As a compatible and effective solution, this change adds a C--
      preprocessor distinct from the C compiler and preprocessor, but that
      keeps its flags.  The command line produced for C-- preprocessing now
      looks like:
      
        $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP
      
      Closes: #24474
      25b0b404
    • Andrei Borzenkov's avatar
      Rename Solo# data constructor to MkSolo# (#24673) · 3b51995c
      Andrei Borzenkov authored and Marge Bot's avatar Marge Bot committed
      - data Solo# a = (# a #)
      + data Solo# a = MkSolo# a
      
      And `(# foo #)` syntax now becomes just a syntactic
      sugar for `MkSolo# a`.
      3b51995c
  16. May 06, 2024
  17. May 05, 2024
Loading