Skip to content
Snippets Groups Projects
  1. Oct 30, 2024
  2. Oct 28, 2024
    • Alan Zimmerman's avatar
      EPA: Remove AnnKeywordId. · d5e7990c
      Alan Zimmerman authored
      This was used as part of AddEpAnn, and is no longer needed.
      
      Also remove all the haddock comments about which of are attached to
      the various parts of the AST.  This is now clearly captured in the
      appropriate TTG extension points, and the `ExactPrint.hs` file.
      d5e7990c
  3. Oct 27, 2024
  4. Oct 26, 2024
    • Simon Peyton Jones's avatar
      Fix optimisation of InstCo · 23ddcc01
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      It turned out (#25387) that the fix to #15725 was not quite right:
      
        commit 48efbc04
        Date:   Mon Oct 15 10:25:02 2018 +0200
      
          Fix #15725 with an extra Sym
      
      Optimising InstCo is quite subtle, and the invariants surrounding
      the LiftingContext in the coercion optimiser were not stated explicitly.
      
      This patch refactors the InstCo optimisation, and documents these
      invariants.  See
        * Note [Optimising InstCo]
        * Note [The LiftingContext in optCoercion]
      
      I also did some refactoring of course:
      
      * Instead of a Bool swap-flag, I am not using GHC.Types.Basic.SwapFlag
      
      * I added some invariant-checking the coercion-construction functions
        in GHC.Core.Coercion.Opt.  (Sadly these invariants don't hold during
        typechecking, becuase the types are un-zonked, so I can't put these
        checks in GHC.Core.Coercion.)
      23ddcc01
  5. Oct 25, 2024
    • Alan Zimmerman's avatar
      EPA: Remove AddEpann commit 7 · dbc77ce8
      Alan Zimmerman authored
      EPA: Remove [AddEpAnn] from HYPHEN in Parser.y
      
      The return value is never used, as it is part of the backpack
      configuration parsing.
      
      EPA: Remove last [AddEpAnn] usages
      
      Remove residual usage in GHC. It is still used
      - In haddock TTG extension point definitions (to be removed)
      - Some check-exact residual, to be removed
      - Comments around DisambECP in PostProcess
      
      EPA: Clean up [AddEpAnn] from check-exact
      
      There is one left, to be cleaned up when we remove AddEpann itself
      
      EPA: Remove [AddEpAnn] from haddock
      
      The TTG extension points need a value, it is not critical what that
      value is, in most cases.
      
      EPA: Remove AddEpAnn from HsRuleAnn
      
      EPA: Remove AddEpAnn from HsCmdArrApp
      dbc77ce8
    • Ryan Hendrickson's avatar
      compiler: Fix deriving with method constraints · 15a3456b
      Ryan Hendrickson authored and Marge Bot's avatar Marge Bot committed
      
      See Note [Inferred contexts from method constraints]
      
      Co-authored-by: default avatarSimon Peyton Jones <simon.peytonjones@gmail.com>
      15a3456b
    • Simon Peyton Jones's avatar
      Some renaming · 0225249a
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      This is a pure refactor, tidying up some inconsistent naming:
      
         isEqPred          -->  isEqClassPred
         isEqPrimPred      -->  isEqPred
         isReprEqPrimPred  -->  isReprEqPred
         mkPrimEqPred      -->  mkNomEqPred
         mkReprPrimEqPred  -->  mkReprEqPred
         mkPrimEqPredRold  -->  mkEqPredRole
      
      Plus I moved mkNomEqPred, mkReprEqPred, mkEqPredRolek
        from GHC.Core.Coercion to GHC.Core.Predicate
      where they belong.  That means that Coercion imports Predicate
      rather than vice versa -- better.
      0225249a
    • Sebastian Graf's avatar
      Make DataCon workers strict in strict fields (#20749) · 9f57c96d
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      
      This patch tweaks `exprIsConApp_maybe`, `exprIsHNF` and friends, and Demand
      Analysis so that they exploit and maintain strictness of DataCon workers. See
      `Note [Strict fields in Core]` for details.
      
      Very little needed to change, and it puts field seq insertion done by Tag
      Inference into a new perspective: That of *implementing* strict field semantics.
      Before Tag Inference, DataCon workers are strict. Afterwards they are
      effectively lazy and field seqs happen around use sites. History has shown
      that there is no other way to guarantee taggedness and thus the STG Strict Field
      Invariant.
      
      Knock-on changes:
      
        * I reworked the whole narrative around "Tag inference".
          It's now called "EPT enforcement" and I recycyled the different overview
          Notes into `Note [EPT enforcement]`.
      
        * `exprIsHNF` previously used `exprOkForSpeculation` on unlifted arguments
          instead of recursing into `exprIsHNF`. That regressed the termination
          analysis in CPR analysis (which simply calls out to `exprIsHNF`), so I made
          it call `exprOkForSpeculation`, too.
      
        * There's a small regression in Demand Analysis, visible in the changed test
          output of T16859: Previously, a field seq on a variable would give that
          variable a "used exactly once" demand, now it's "used at least once",
          because `dmdTransformDataConSig` accounts for future uses of the field
          that actually all go through the case binder (and hence won't re-enter the
          potential thunk). The difference should hardly be observable.
      
        * The Simplifier's fast path for data constructors only applies to lazy
          data constructors now. I observed regressions involving Data.Binary.Put's
          `Pair` data type.
      
        * Unfortunately, T21392 does no longer reproduce after this patch, so I marked
          it as "not broken" in order to track whether we regress again in the future.
      
      Fixes #20749, the satisfying conclusion of an annoying saga (cf. the ideas
      in #21497 and #22475).
      
      Compiler perf generally improves, sometimes drastically:
      
                                                           Baseline
                                       Test    Metric          value      New value Change
      --------------------------------------------------------------------------------
                   ManyConstructors(normal) ghc/alloc  3,629,760,116  3,711,852,800  +2.3%  BAD
        MultiLayerModulesTH_OneShot(normal) ghc/alloc  2,502,735,440  2,565,282,888  +2.5%  BAD
                             T12707(normal) ghc/alloc    804,399,798    791,807,320  -1.6% GOOD
                             T17516(normal) ghc/alloc    964,987,744  1,008,383,520  +4.5%
                             T18140(normal) ghc/alloc     75,381,152     49,860,560 -33.9% GOOD
                            T18698b(normal) ghc/alloc    232,614,457    184,262,736 -20.8% GOOD
                             T18923(normal) ghc/alloc     62,002,368     58,301,408  -6.0% GOOD
                             T20049(normal) ghc/alloc     75,719,168     70,494,368  -6.9% GOOD
                              T3294(normal) ghc/alloc  1,237,925,833  1,157,638,992  -6.5% GOOD
                              T9233(normal) ghc/alloc    686,490,105    635,166,688  -7.5% GOOD
      
                                  geo. mean                                          -0.7%
                                  minimum                                           -33.9%
                                  maximum                                            +4.5%
      
      I looked at T17516. It seems we do a few more simplifier iterations and end up
      with a larger program. It seems that some things inline more, while other things
      inline less. I don't see low-hanging fruit.
      
      I also looked at MultiLayerModulesTH_OneShot. It appears we generate a strange
      join point in the `getUnique` method of `Uniquable GHC.Unit.Types.Module` that
      should better call-site inline, but does not. Perhaps with !11492.
      
      NoFib does not seem affected much either:
      
      +-------------------------------++--+------------+-----------+---------------+-----------+
      |                               ||  |      base/ | std. err. | T20749/ (rel) | std. err. |
      +===============================++==+============+===========+===============+===========+
      |           spectral/last-piece ||  |    7.263e8 |      0.0% |        +0.62% |      0.0% |
      +===============================++==+============+===========+===============+===========+
      |                     geom mean ||  |     +0.00% |           |               |           |
      +-------------------------------++--+------------+-----------+---------------+-----------+
      
      I had a look at last-piece. Nothing changes in stg-final, but there is a bit
      of ... movement around Data.Map.insert's use of GHC.Exts.lazy that is gone in
      stg-final.
      
      Co-Authored-By: default avatarJaro Reinders <jaro.reinders@gmail.com>
      
      Metric Decrease:
          T12707
          T18140
          T18698b
          T18923
          T19695
          T20049
          T3294
          T9233
          T21839c
      Metric Increase:
          ManyConstructors
          MultiLayerModulesTH_OneShot
      9f57c96d
    • Sebastian Graf's avatar
      CorePrep: Attach evaldUnfolding to floats to detect more values · 55e4b9f2
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      See `Note [Pin evaluatedness on floats]`.
      55e4b9f2
  6. Oct 24, 2024
    • Rodrigo Mesquita's avatar
      Fix -fobject-determinism flag definition · 4a00731e
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      The flag should be defined as an fflag to make sure the
      -fno-object-determinism flag is also an available option.
      
      Fixes #25397
      4a00731e
    • Alan Zimmerman's avatar
      EPA: reduce [AddEpann] in AnnList · 7b1b0c6d
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      Remove it from the `al_rest` field, and make `AnnList` parameterized
      on a type to be used in `al_rest`, for the various use cases.
      7b1b0c6d
    • Rodrigo Mesquita's avatar
      Revert "ci: Allow abi-test to fail." · e39c8c99
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      After #25304, the abi-test with interface and object determinism
      succeeds.
      
      This reverts commit 7b37afc9.
      e39c8c99
    • Rodrigo Mesquita's avatar
      determinism: Interface re-export list det · b3f7fb80
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      In 'DocStructureItem' we want to make sure the 'Avails' are sorted, for
      interface file determinism. This commit introduces 'DetOrdAvails', a
      newtype that should only be constructed by sorting Avails with
      'sortAvails' unless the avails are known to be deterministically
      ordered. This newtype is used by 'DocStructureItem' where 'Avails' was
      previously used to ensure the list of avails is deterministically sorted
      by construction.
      
      Note: Even though we order the constructors and avails in the interface
      file, the order of constructors in the haddock output is still
      determined from the order of declaration in the source. This was also
      true before, when the list of constructors in the interface file <docs>
      section was non-deterministic. Some haddock tests such as
      "ConstructorArgs" observe this (check the order of constructors in
      out/ConstructorArgs.html vs src/ConstructorArgs.hs vs its interface file)
      
      The updated tests are caused by haddock corners where the order in the
      source is not preserved (and was non-deterministic before this PR):
          * Module header in the latex backend
          * Re-export of pattern synonyms associated to a datatype (#25342)
      
      Fixes #25304
      b3f7fb80
    • Ignatius Menzies's avatar
      Improve heap overflow exception message (#25198) · 6ab8d751
      Ignatius Menzies authored and Marge Bot's avatar Marge Bot committed
      Catch heap overflow exceptions and suggest using `+RTS -M<size>`.
      
      Fix #25198
      6ab8d751
  7. Oct 22, 2024
  8. Oct 21, 2024
    • Luite Stegeman's avatar
      Add requestTickyCounterSamples to GHC.Internal.Profiling · d328d173
      Luite Stegeman authored
      This allows the user to request ticky counters to be written to
      the eventlog at specific times.
      
      See #24645
      d328d173
    • Cheng Shao's avatar
      wasm: bump dyld v8 heap size limit · f8694fe7
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      This patch adds `--max-old-space-size=8192` to wasm dyld shebang
      arguments to bump V8 heap size limit. The default limit
      (`heap_size_limit` returned by `v8.getHeapStatistics()`) is
      dynamically determined and a bit too low under certain workloads, and
      V8 would waste too much CPU time to garbage collect old generation
      heap more aggressively. Bumping the limit to 8G doesn't imply dyld
      would really take that much memory at run-time, but it lessens V8 heap
      stress significantly.
      f8694fe7
    • Alan Zimmerman's avatar
      EPA: Remove [AddEpAnn] Commit 5 · 7f61ed4e
      Alan Zimmerman authored and Marge Bot's avatar Marge Bot committed
      EPA: Remove [AddEpAnn] from AnnPragma
      
      EPA: Remove [AddEpAnn] From ForeignDecl
      
      EPA: Remove [AddEpAnn] from RoleAnnotDecl
      
      EPA: Remove [AddEpAnn] from StandaloneKindSig
      
      EPA: Remove [AddEpAnn] From HsDeriving
      
      EPA: Remove [AddEpAnn] from ConDeclField
      
      EPA: Remove [AddEpAnn] from ConDeclGADT
      
      EPA: Remove [AddEpAnn] from ConDeclH98
      
      EPA: Remove [AddEpAnn] from ClsInstDecl
      7f61ed4e
  9. Oct 20, 2024
  10. Oct 19, 2024
Loading