Skip to content
Snippets Groups Projects
  1. May 16, 2024
  2. May 15, 2024
  3. May 14, 2024
  4. May 12, 2024
  5. 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
  6. 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
  7. May 08, 2024
  8. 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
    • Arsen Arsenović's avatar
      Add the cmm_cpp_is_gcc predicate to the testsuite · 4d59abf2
      Arsen Arsenović authored and Marge Bot's avatar Marge Bot committed
      A future C-- test called T24474-cmm-override-g0 relies on the
      GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it
      emitting #defines past the preprocessing stage.  Clang, at least, does
      not do this, so the test would fail if ran on Clang.
      
      As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of
      the workaround we apply as a fix for bug #24474, and the workaround was
      for GCC-specific behaviour, the test needs to be marked as fragile on
      other compilers.
      4d59abf2
    • 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
  9. May 06, 2024
  10. May 05, 2024
  11. May 04, 2024
  12. May 02, 2024
    • Sylvain Henry's avatar
      GHCi: support inlining breakpoints (#24712) · b85b1199
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      When a breakpoint is inlined, its context may change (e.g. tyvars in
      scope). We must take this into account and not used the breakpoint tick
      index as its sole identifier. Each instance of a breakpoint (even with
      the same tick index) now gets a different "info" index.
      
      We also need to distinguish modules:
      - tick module: module with the break array (tick counters, status, etc.)
      - info module: module having the CgBreakInfo (info at occurrence site)
      b85b1199
    • jeffrey young's avatar
      testsuite: expand size testing infrastructure · 9bae34d8
      jeffrey young authored and Marge Bot's avatar Marge Bot committed
      - closes #24191
      - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so
      - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite
      - adds on_windows and req_dynamic_ghc predicate to testsuite
      
      The design is to not make the testsuite too smart and simply offload to
      ghc-pkg for locations of object files and directories.
      9bae34d8
    • Alan Zimmerman's avatar
      EPA: fix span for empty \case(s) · 167a56a0
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      In
          instance SDecide Nat where
            SZero %~ (SSucc _) = Disproved (\case)
      
      Ensure the span for the HsLam covers the full construct.
      
      Closes #24748
      167a56a0
    • Andreas Klebinger's avatar
      STM: Be more optimistic when validating in-flight transactions. · 917ef81b
      Andreas Klebinger authored and Marge Bot's avatar Marge Bot committed
      * Don't lock tvars when performing non-committal validation.
      * If we encounter a locked tvar don't consider it a failure.
      
      This means in-flight validation will only fail if committing at the
      moment of validation is *guaranteed* to fail.
      
      This prevents in-flight validation from failing spuriously if it happens in
      parallel on multiple threads or parallel to thread comitting.
      917ef81b
    • Cheng Shao's avatar
      testsuite: fix req_target_smp predicate · a580722e
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      a580722e
    • Alan Zimmerman's avatar
      EPA: Preserve comments for PrefixCon · 40026ac3
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Preserve comments in
      
          fun (Con {- c1 -} a b)
              = undefined
      
      Closes #24736
      40026ac3
  13. May 01, 2024
Loading