1. 29 Jul, 2021 8 commits
  2. 28 Jul, 2021 24 commits
    • Alfredo Di Napoli's avatar
      Port more DriverUnknownMessage into richer DriverMessage constructors · 4a2ef3dd
      Alfredo Di Napoli authored
      In order:
      
      * Introduce the `PsErrUnknownOptionsPragma` diagnostic message
      
        This commit changes the diagnostic emitted inside
        `GHC.Parser.Header.checkProcessArgsResult` from an (erroneous) and
        unstructured `DriverUnknownMessage` to a `PsErrUnknownOPtionsPragma`,
        i.e. a new data constructor of a `PsHeaderMessage`.
      
      * Add the `DriverUserDefinedRuleIgnored` diagnostic message
      
      * Add `DriverUserDefinedRuleIgnored` data constructor
      
        This commit adds (and use) a new data constructor to the `DriverMessage`
        type, replacing a `DriverUnknownMessage` with it.
      
      * Add and use `DriverCannotLoadInterfaceFile` constructor
      
        This commit introduces the DriverCannotLoadInterfaceFile constructor for
        the `DriverMessage` type and it uses it to replace and occurrence of
        `DriverUnknownMessage`.
      
      * Add and use the `DriverInferredSafeImport` constructor
      
        This commit adds a new `DriverInferredSafeImport` constructor to the
        `DriverMessage` type...
      4a2ef3dd
    • CarrieMY's avatar
    • CarrieMY's avatar
      Fix type check error message grammar (fixes #20122) · 7dc0dc99
      CarrieMY authored
      Remove trailing spaces
      7dc0dc99
    • Simon Peyton Jones's avatar
      Fix a subtle scoping error in simplLazyBind · 91eb1857
      Simon Peyton Jones authored
      In the call to prepareBinding (in simplLazyBind), I had failed to
      extend the in-scope set with the binders from body_floats1. As as
      result, when eta-expanding deep inside prepareBinding we made up
      an eta-binder that shadowed a variable free in body1.  Yikes.
      
      It's hard to trigger this bug.  It showed up when I was working
      on !5658, and I started using the in-scope set for eta-expansion,
      rather than taking free variables afresh.  But even then it only
      showed up when compiling a module in Haddock
         utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
      
      Sadly Haddock is compiled without Core Lint, so we ultimately got
      a seg-fault.  Lint nailed it fast once I realised that it was off.
      
      There is some other tiny refactoring in this patch.
      91eb1857
    • Simon Peyton Jones's avatar
      Improve performance of eta expansion · 299b7436
      Simon Peyton Jones authored
      Eta expansion was taking ages on T18223.  This patch
      
      * Aggressively squash reflexive casts in etaInfoApp.
        See Note [Check for reflexive casts in eta expansion]
        These changes decreased compile-time allocation by 80%!
      
      * Passes the Simplifier's in-scope set to etaExpandAT, so we
        don't need to recompute it.  (This alone saved 10% of compile
        time.)
      
        Annoyingly several functions in the Simplifier (namely
        makeTrivialBinding and friends) need to get SimplEnv, rather
        than SimplMode, but that is no big deal.
      
      Lots of small changes in compile-time allocation, less than 1%
      and in both directions.  A couple of bigger changes, including
      the rather delicate T18223
      
      T12425(optasm) ghc/alloc    98448216.0    97121224.0  -1.3% GOOD
      T18223(normal) ghc/alloc  5454689676.0  1138238008.0 -79.1% GOOD
      
      Metric Decrease:
          T12425
          T18223
      299b7436
    • Simon Peyton Jones's avatar
      Simplify and improve the eta expansion mechanism · a199d653
      Simon Peyton Jones authored
      Previously the eta-expansion would return lambdas interspersed with
      casts; now the cast is just pushed to the outside: #20153.
      
      This actually simplifies the code.
      
      I also improved mkNthCo to account for SymCo, so that
         mkNthCo n (SymCo (TyConAppCo tc cos))
      would work well.
      a199d653
    • Simon Peyton Jones's avatar
      Inline less logging code · 2567d13b
      Simon Peyton Jones authored
      When eyeballing calls of GHC.Core.Opt.Simplify.Monad.traceSmpl,
      I saw that lots of cold-path logging code was getting inlined
      into the main Simplifier module.
      
      So in GHC.Utils.Logger I added a NOINLINE on logDumpFile'.
      
      For logging, the "hot" path, up to and including the conditional,
      should be inlined, but after that we should inline as little as
      possible, to reduce code size in the caller.
      2567d13b
    • Simon Peyton Jones's avatar
      Make the occurrence analyser a bit stricter · 05f54bb4
      Simon Peyton Jones authored
      occAnalArgs and occAnalApp are very heavily used functions, so it pays
      to make them rather strict: fewer thunks constructed.  All these
      thunks are ultimately evaluated anyway.
      
      This patch gives a welcome reduction compile time allocation of around
      0.5% across the board. For T9961 it's a 2.2% reduction.
      
      Metric Decrease:
          T9961
      05f54bb4
    • Simon Peyton Jones's avatar
      White space, spelling, and a tiny refactor · a67e6814
      Simon Peyton Jones authored
      No change in behaviour
      a67e6814
    • Simon Peyton Jones's avatar
      Extend the in-scope set to silence substExpr warnings · 25ca0b5a
      Simon Peyton Jones authored
      substExpr warns if it finds a LocalId that isn't in the in-scope set.
      This patch extends the in-scope set to silence the warnings.  (It has
      no effect on behaviour.)
      25ca0b5a
    • Simon Peyton Jones's avatar
      Improve postInlineUnconditionally · 9dbab4fd
      Simon Peyton Jones authored
      See Note [Use occ-anald RHS in postInlineUnconditionally].
      This explains how to eliminate an extra round of simplification,
      which can happen if postInlineUnconditionally uses a RHS
      that is no occurrence-analysed.
      
      This opportunity has been there for ages; I discovered it
      when looking at a compile-time perf regression that happened
      because the opportunity wasn't exploited.
      9dbab4fd
    • Simon Peyton Jones's avatar
      4e4ca28c
    • Simon Peyton Jones's avatar
      Fix smallEnoughToInline · d43a9029
      Simon Peyton Jones authored
      I noticed that smallEnoughToInline said "no" to UnfWhen guidance,
      which seems quite wrong -- those functions are particularly small.
      d43a9029
    • Krzysztof Gogolewski's avatar
    • Krzysztof Gogolewski's avatar
      2625d48e
    • Krzysztof Gogolewski's avatar
      dabe6113
    • Krzysztof Gogolewski's avatar
      f3256769
    • Ben Gamari's avatar
      rts: Don't rely on configuration when CLEANING=YES · 10678945
      Ben Gamari authored
      The make build system doesn't source config.mk when CLEANING=YES,
      consequently we previously failed to identify an appropriate
      adjustor implementation to use during cleaning.
      
      Fixes #20166.
      10678945
    • Sylvain Henry's avatar
      Hadrian: disable profiled RTS with no_profiled_libs flavour transformer · 323473e8
      Sylvain Henry authored
      Hadrian uses the RTS ways to determine which iserv programs to embed
      into bindist. But profiled iserv program (and any other code) can't be
      built without profiling libs and Hadrian fails. So we disable the
      profiling RTS way with the no_profiled_libs flavour transformer.
      323473e8
    • Sylvain Henry's avatar
      PIC: test for cross-module references · cddafcf6
      Sylvain Henry authored
      cddafcf6
    • Krzysztof Gogolewski's avatar
      Don't abort on representation polymorphism check · 9da20e3d
      Krzysztof Gogolewski authored
      This is reverting a change introduced in linear types commit 40fa237e.
      Previously, we had to abort early, but thanks to later changes,
      this is no longer needed.
      
      There's no test, but the behavior should be better.
      The plan is to remove levity polymorphism checking in the desugarer anyway.
      9da20e3d
    • Krzysztof Gogolewski's avatar
      Add a regression test for #17697 · cab890f7
      Krzysztof Gogolewski authored
      cab890f7
    • Krzysztof Gogolewski's avatar
      Remove some unused names · 97e0837d
      Krzysztof Gogolewski authored
      The comment about 'parError' was obsolete.
      97e0837d
    • Krzysztof Gogolewski's avatar
      Simplify FFI code · c7c0964c
      Krzysztof Gogolewski authored
      Remains of the dotnet FFI, see a7d8f437 and 1fede4bc
      c7c0964c
  3. 27 Jul, 2021 8 commits
    • andreas.abel's avatar
      f27dba8b
    • andreas.abel's avatar
      Issue #18087: :since: for warnings of ghc 6/7/8 · 0b403319
      andreas.abel authored
      Added :since: fields to users_guide on warning, for warnings
      introduced starting GHC 6.0.
      
      The data was extracted from the HTML docs on warnings, see
      
        #18087
      
      and partially verified by consulting the change logs.
      0b403319
    • andreas.abel's avatar
      Doc: warnings: since: remove minor version number for uniformity · ebcdf3fa
      andreas.abel authored
      New warnings are only released in major versions, it seems.
      One way or the other, a .1 minor version can always be dropped.
      ebcdf3fa
    • andreas.abel's avatar
      Doc: tabs to spaces · 20b352eb
      andreas.abel authored
      20b352eb
    • Krzysztof Gogolewski's avatar
    • Simon Peyton Jones's avatar
      Eliminate unnecessary unsafeEqualityProof · 9bf8d530
      Simon Peyton Jones authored
      This patch addresses #20143, which wants to discard unused calls to
      unsafeEqualityProof.
      
      There are two parts:
      
      * In exprOkForSideEffects, we want to know that unsafeEqualityProof
        indeed terminates, without any exceptions etc
      
      * But we can only discard the case if we know that the coercion
        variable is not used, which means we have to gather accurate
        occurrence info for CoVars.  Previously OccurAnal only did a half
        hearted job of doing so; this patch finishes the job.
      
        See Note [Gather occurrences of coercion variables] in OccurAnal.
      
      Because the occurrence analyser does more work, there is a small
      compile-time cost but it's pretty small.  The compiler perf tests
      are usually 0.0% but occasionally up to 0.3% increase.  I'm just
      going to accept this -- gathering accurate occurrence information
      really seems like the Right Thing to do.
      
      There is an increase in `compile_time/peak_megabytes_allocated`, for
      T11545, or around 14%; but I can't reproduce it on my machine (it's
      the same before and after), and the peak-usage stats are vulnerable to
      when exactly the GC takes place, so I'm just going to accept it.
      
      Metric Increase:
          T11545
      9bf8d530
    • Simon Peyton Jones's avatar
      Eta expand through CallStacks · 6d2846f7
      Simon Peyton Jones authored
      This patch fixes #20103, by treating HasCallStack constraints as
      cheap when eta-expanding.
      
      See Note [Eta expanding through CallStacks] in GHC.Core.Opt.Arity
      6d2846f7
    • Simon Peyton Jones's avatar
      Make CallStacks work better with RebindableSyntax · 0c4a0c3b
      Simon Peyton Jones authored
      As #19918 pointed out, the CallStack mechanism didn't work well with
      RebindableSyntax.
      
      This patch improves matters.  See GHC.Tc.Types.Evidence
           Note [Overview of implicit CallStacks]
      
      * New predicate isPushCallStackOrigin distinguishes when a CallStack
        constraint should be solved "directly" or by pushing an item on the
        stack.
      
      * The constructor EvCsPushCall now has a FastString, which can
        describe not only a function call site, but also things like
        "the literal 42" or "an if-then-else expression".
      
      * I also fixed #20126 thus:
           exprCtOrigin (HsIf {}) = IfThenElseOrigin
        (Previously it was "can't happen".)
      0c4a0c3b