Skip to content
Snippets Groups Projects
  1. Dec 09, 2022
    • John Ericson's avatar
      Delete `rts/package.conf.in` · 36093407
      John Ericson authored and Marge Bot's avatar Marge Bot committed
      It is a relic of the Make build system. The RTS now uses a
      `package.conf` file generated the usual way by Cabal.
      36093407
    • Sebastian Graf's avatar
      Do not strictify a DFun's parameter dictionaries (#22549) · 26e71562
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      ... thus fixing #22549.
      
      The details are in the refurbished and no longer dead
      `Note [Do not strictify a DFun's parameter dictionaries]`.
      
      There's a regression test in T22549.
      26e71562
    • Sebastian Graf's avatar
      Make `drop` and `dropWhile` fuse (#18964) · 0f7588b5
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      I copied the fusion framework we have in place for `take`.
      T18964 asserts that we regress neither when fusion fires nor when it doesn't.
      
      Fixes #18964.
      0f7588b5
    • Matthew Pickering's avatar
      Typeable: Fix module locations of some definitions in GHC.Types · 1d3a8b8e
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      There was some confusion in Data.Typeable about which module certain
      wired-in things were defined in. Just because something is wired-in
      doesn't mean it comes from GHC.Prim, in particular things like LiftedRep
      and RuntimeRep are defined in GHC.Types and that's the end of the story.
      
      Things like Int#, Float# etc are defined in GHC.Prim as they have no
      Haskell definition site at all so we need to generate type
      representations for them (which live in GHC.Types).
      
      Fixes #22510
      1d3a8b8e
    • Sebastian Graf's avatar
      Make (^) INLINE (#22324) · 3144e8ff
      Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
      So that we get to cancel away the allocation for the lazily used base.
      
      We can move `powImpl` (which *is* strict in the base) to the top-level
      so that we don't duplicate too much code and move the SPECIALISATION
      pragmas onto `powImpl`.
      
      The net effect of this change is that `(^)` plays along much better with
      inlining thresholds and loopification (#22227), for example in `x2n1`.
      
      Fixes #22324.
      3144e8ff
    • Bodigrim's avatar
      Fix tests · ef702a18
      Bodigrim authored and Marge Bot's avatar Marge Bot committed
      ef702a18
    • Bodigrim's avatar
      Support mtl-2.3 in check-exact · 3807a46c
      Bodigrim authored and Marge Bot's avatar Marge Bot committed
      3807a46c
    • Bodigrim's avatar
      Allow mtl-2.3 in hadrian · 08d8fe2a
      Bodigrim authored and Marge Bot's avatar Marge Bot committed
      08d8fe2a
    • Bodigrim's avatar
      Update submodule mtl to 2.3.1, parsec to 3.1.15.1, haddock and Cabal to HEAD · 9eb9d2f4
      Bodigrim authored and Marge Bot's avatar Marge Bot committed
      9eb9d2f4
    • lrzlin's avatar
      Add initial support for LoongArch Architecture. · ea25088d
      lrzlin authored and Marge Bot's avatar Marge Bot committed
      ea25088d
    • Matthew Pickering's avatar
      Fix mk_mod_usage_info if the interface file is not already loaded · d122e022
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      In #22217 it was observed that the order modules are compiled in affects
      the contents of an interface file. This was because a module dependended
      on another module indirectly, via a re-export but the interface file for
      this module was never loaded because the symbol was never used in the
      file.
      
      If we decide that we depend on a module then we jolly well ought to
      record this fact in the interface file! Otherwise it could lead to very
      subtle recompilation bugs if the dependency is not tracked and the
      module is updated.
      
      Therefore the best thing to do is just to make sure the file is loaded
      by calling the `loadSysInterface` function.  This first checks the
      caches (like we did before) but then actually goes to find the interface
      on disk if it wasn't loaded.
      
      Fixes #22217
      d122e022
    • Matthew Pickering's avatar
      backpack: Be more careful when adding together ImportAvails · 74c9bf91
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      There was some code in the signature merging logic which added together
      the ImportAvails of the signature and the signature which was merged
      into it. This had the side-effect of making the merged signature depend
      on the signature (via a normal module dependency). The intention was to
      propagate orphan instances through the merge but this also messed up
      recompilation logic because we shouldn't be attempting to load B.hi when
      mergeing it.
      
      The fix is to just combine the part of ImportAvails that we intended to
      (transitive info, orphan instances and type family instances) rather
      than the whole thing.
      74c9bf91
    • Matthew Pickering's avatar
      ci: Add job for testing interface stability across builds · 0a76d7d4
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The idea is that both the bindists should product libraries with the
      same ABI and interface hash.
      So the job checks with ghc-pkg to make sure the computed ABI
      is the same.
      
      In future this job can be extended to check for the other facets of
      interface determinism.
      
      Fixes #22180
      0a76d7d4
    • Matthew Pickering's avatar
      ci: Add job to test interface file determinism guarantees · 5d0a311f
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      In this job we can run on every commit we add a test which builds the
      Cabal library twice and checks that the ABI hash and interface hash is
      stable across the two builds.
      
      * We run the test 20 times to try to weed out any race conditions due to
        `-j`
      * We run the builds in different temporary directories to try to weed
        out anything related to build directory affecting ABI or interface
        file hash.
      
      Fixes #22180
      5d0a311f
    • Matthew Pickering's avatar
      Add test for #22162 · 216deefd
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      216deefd
  2. Dec 08, 2022
    • Krzysztof Gogolewski's avatar
      Restore show (typeRep @[]) == "[]" · 7658cdd4
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      The Show instance for TypeRep [] has changed in 9.5 to output "List"
      because the name of the type constructor changed.
      This seems to be accidental and is inconsistent with TypeReps of saturated
      lists, which are printed as e.g. "[Int]".
      For now, I'm restoring the old behavior; in the future,
      maybe we should show TypeReps without puns (List, Tuple, Type).
      7658cdd4
    • Cheng Shao's avatar
      hadrian: don't add debug info to non-debug ways of rts · 9ec76f61
      Cheng Shao authored and Marge Bot's avatar Marge Bot committed
      Hadrian used to pass -g when building all ways of rts. It makes output
      binaries larger (especially so for wasm backend), and isn't needed by
      most users out there, so this patch removes that flag. In case the
      debug info is desired, we still pass -g3 when building the debug way,
      and there's also the debug_info flavour transformer which ensures -g3
      is passed for all rts ways.
      9ec76f61
    • Ian-Woo Kim's avatar
      Truncate eventlog event for large payload (#20221) · 2057c77d
      Ian-Woo Kim authored and Marge Bot's avatar Marge Bot committed
      RTS eventlog events for postCapsetVecEvent are truncated if payload
      is larger than EVENT_PAYLOAD_SIZE_MAX
      Previously, postCapsetVecEvent records eventlog event with payload
      of variable size larger than EVENT_PAYLOAD_SIZE_MAX (2^16) without
      any validation, resulting in corrupted data.
      For example, this happens when a Haskell binary is invoked with very
      long command line arguments exceeding 2^16 bytes (see #20221).
      Now we check the size of accumulated payload messages incrementally,
      and truncate the message just before the payload size exceeds
      EVENT_PAYLOAD_SIZE_MAX. RTS will warn the user with a message showing
      how many arguments are truncated.
      2057c77d
    • Krzysztof Gogolewski's avatar
      Mark Type.Reflection.Unsafe as Unsafe · 90cd5396
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      This module can be used to construct ill-formed TypeReps, so it should
      be Unsafe.
      90cd5396
    • Gergő Érdi's avatar
      Add version of `reachableGraph` that avoids loop for cyclic inputs · c5d8ed3a
      Gergő Érdi authored and Marge Bot's avatar Marge Bot committed
      by building its result connected component by component
      
      Fixes #22512
      c5d8ed3a
    • Gergő Érdi's avatar
      Remove copy-pasted definitions of `graphFromEdgedVertices*` · 8d36c0c6
      Gergő Érdi authored and Marge Bot's avatar Marge Bot committed
      8d36c0c6
    • Matthew Craven's avatar
      Fix bounds-checking buglet in Data.Array.Byte · e902d771
      Matthew Craven authored and Marge Bot's avatar Marge Bot committed
      ...another manifestation of #20851 which
      I unfortunately missed in my first pass.
      e902d771
  3. Dec 06, 2022
    • — —'s avatar
      Push DynFlags out of Linker.MacOS · a7422580
      — — authored and Marge Bot's avatar Marge Bot committed
      a7422580
    • — —'s avatar
      Push DynFlags out of runInjectRPaths · 4e28f49e
      — — authored and Marge Bot's avatar Marge Bot committed
      4e28f49e
    • — —'s avatar
      Push DynFlags out of askOtool · aaaaa79b
      — — authored and Marge Bot's avatar Marge Bot committed
      aaaaa79b
    • — —'s avatar
      Push DynFlags out of runInstallNameTool · 21d66db1
      — — authored and Marge Bot's avatar Marge Bot committed
      21d66db1
    • sheaf's avatar
      Hadrian: fix ghcDebugAssertions off-by-one error · cd31acad
      sheaf authored and Marge Bot's avatar Marge Bot committed
      Commit 6b2f7ffe changed the logic that decided whether to enable debug
      assertions. However, it had an off-by-one error, as the stage parameter
      to the function inconsistently referred to the stage of the compiler
      being used to build or the stage of the compiler we are building.
      
      This patch makes it consistent. Now the parameter always refers to the
      the compiler which is being built.
      
      In particular, this patch re-enables
      assertions in the stage 2 compiler when building with devel2 flavour,
      and disables assertions in the stage 2 compiler when building with
      validate flavour.
      
      Some extra performance tests are now run in the "validate" jobs because
      the stage2 compiler no longer contains assertions.
      
      -------------------------
      Metric Decrease:
          CoOpt_Singletons
          MultiComponentModules
          MultiComponentModulesRecomp
          MultiLayerModulesTH_OneShot
          T11374
          T12227
          T12234
          T13253-spj
          T13701
          T14683
          T14697
          T15703
          T17096
          T17516
          T18304
          T18478
          T18923
          T5030
          T9872b
          TcPlugin_RewritePerf
      Metric Increase:
          MultiComponentModules
          MultiComponentModulesRecomp
          MultiLayerModules
          MultiLayerModulesRecomp
          MultiLayerModulesTH_Make
          T13386
          T13719
          T3294
          T9233
          T9675
          parsing001
      -------------------------
      cd31acad
  4. Dec 05, 2022
    • Vladislav Zavialov's avatar
      Add BufSpan to EpaLocation (#22319, #22558) · 1a767fa3
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      The key part of this patch is the change to mkTokenLocation:
      
      	- mkTokenLocation (RealSrcSpan r _)  = TokenLoc (EpaSpan r)
      	+ mkTokenLocation (RealSrcSpan r mb) = TokenLoc (EpaSpan r mb)
      
      mkTokenLocation used to discard the BufSpan, but now it is saved and can
      be retrieved from LHsToken or LHsUniToken.
      
      This is made possible by the following change to EpaLocation:
      
      	- data EpaLocation = EpaSpan !RealSrcSpan
      	+ data EpaLocation = EpaSpan !RealSrcSpan !(Strict.Maybe BufSpan)
      	                   | ...
      
      The end goal is to make use of the BufSpan in Parser/PostProcess/Haddock.
      1a767fa3
  5. Dec 03, 2022
    • Ross Paterson's avatar
      Handle type data declarations in Template Haskell quotations and splices (fixes #22500) · 42512264
      Ross Paterson authored
      This adds a TypeDataD constructor to the Template Haskell Dec type,
      and ensures that the constructors it contains go in the TyCls namespace.
      42512264
    • Vladislav Zavialov's avatar
      addHsOuterFamEqnTyVarBinds: use FreshNamesOnly for explicit binders · c189b831
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      Consider this example:
      
      	[d| instance forall a. C [a] where
      	      type forall b. G [a] b = Proxy b |]
      
      When we process "forall b." in the associated type instance, it is
      unambiguously the binding site for "b" and we want a fresh name for it.
      Therefore, FreshNamesOnly is more fitting than ReuseBoundNames.
      This should not have any observable effect but it avoids pointless
      lookups in the MetaEnv.
      c189b831
    • Vladislav Zavialov's avatar
      Refactor: FreshOrReuse instead of addTyClTyVarBinds · 5d267d46
      Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
      This is a refactoring that should have no effect on observable behavior.
      
      Prior to this change, GHC.HsToCore.Quote contained a few closely related
      functions to process type variable bindings: addSimpleTyVarBinds,
      addHsTyVarBinds, addQTyVarBinds, and addTyClTyVarBinds.
      
      We can classify them by their input type and name generation strategy:
      
                                    Fresh names only    Reuse bound names
                                +---------------------+-------------------+
                         [Name] | addSimpleTyVarBinds |                   |
      [LHsTyVarBndr flag GhcRn] |     addHsTyVarBinds |                   |
              LHsQTyVars GhcRn  |      addQTyVarBinds | addTyClTyVarBinds |
                                +---------------------+-------------------+
      
      Note how two functions are missing. Because of this omission, there were
      two places where a LHsQTyVars value was constructed just to be able to pass it
      to addTyClTyVarBinds:
      
      1. mk_qtvs in addHsOuterFamEqnTyVarBinds    -- bad
      2. mkHsQTvs in repFamilyDecl                -- bad
      
      This prevented me from making other changes to LHsQTyVars, so the main
      goal of this refactoring is to get rid of those workarounds.
      
      The most direct solution would be to define the missing functions.
      But that would lead to a certain amount of code duplication. To avoid
      code duplication, I factored out the name generation strategy into a
      function parameter:
      
      	data FreshOrReuse
      	  = FreshNamesOnly
      	  | ReuseBoundNames
      
      	addSimpleTyVarBinds :: FreshOrReuse -> ...
      	addHsTyVarBinds     :: FreshOrReuse -> ...
      	addQTyVarBinds      :: FreshOrReuse -> ...
      5d267d46
    • Bryan R's avatar
      Mark T16916 fragile · bb674262
      Bryan R authored and Marge Bot's avatar Marge Bot committed
      See ghc/ghc#16966
      bb674262
    • Krzysztof Gogolewski's avatar
      Fix linearity checking in Lint · 108c319f
      Krzysztof Gogolewski authored and Marge Bot's avatar Marge Bot committed
      Lint was not able to see that x*y <= x*y, because this inequality
      was decomposed to x <= x*y && y <= x*y, but there was no rule
      to see that x <= x*y.
      
      Fixes #22546.
      108c319f
    • Matthew Pickering's avatar
      Add special case for :Main module in `GHC.IfaceToCore.mk_top_id` · 85ecc1a0
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      See Note [Root-main Id]
      
      The `:Main` special binding is actually defined in the current module
      (hence don't go looking for it externally) but the module name is rOOT_MAIN
      rather than the current module so we need this special case.
      
      There was already some similar logic in `GHC.Rename.Env` for
      External Core, but now the "External Core" is in interface files it
      needs to be moved here instead.
      
      Fixes #22405
      85ecc1a0
  6. Dec 02, 2022
    • Matthew Pickering's avatar
      ApplicativeDo: Set pattern location before running exhaustiveness checker · 74c767df
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      This improves the error messages of the exhaustiveness checker when
      checking statements which have been moved around with ApplicativeDo.
      
      Before:
      
      Test.hs:2:3: warning: [GHC-62161] [-Wincomplete-uni-patterns]
          Pattern match(es) are non-exhaustive
          In a pattern binding:
              Patterns of type ‘Maybe ()’ not matched: Nothing
        |
      2 |   let x = ()
        |   ^^^^^^^^^^
      
      After:
      
      Test.hs:4:3: warning: [GHC-62161] [-Wincomplete-uni-patterns]
          Pattern match(es) are non-exhaustive
          In a pattern binding:
              Patterns of type ‘Maybe ()’ not matched: Nothing
        |
      4 |   ~(Just res1) <- seq x (pure $ Nothing @())
        |
      
      Fixes #22483
      74c767df
    • Simon Peyton Jones's avatar
      Refactor TyCon to have a top-level product · ce126993
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      This patch changes the representation of TyCon so that it has
      a top-level product type, with a field that gives the details
      (newtype, type family etc), #22458.
      
      Not much change in allocation, but execution seems to be a bit
      faster.
      
      Includes a change to the haddock submodule to adjust for API changes.
      ce126993
  7. Dec 01, 2022
    • Bryan R's avatar
      CI: Fix CI lint · d82992fd
      Bryan R authored and Marge Bot's avatar Marge Bot committed
      Failure was introduced by conflicting changes to gen_ci.hs that did
      *not* trigger git conflicts.
      d82992fd
    • Bryan R's avatar
      CI: Remove ARMv7 jobs · c5d1bf29
      Bryan R authored and Marge Bot's avatar Marge Bot committed
      These jobs fail (and are allowed to fail) nearly every time.
      
      Soon they won't even be able to run at all, as we won't currently have
      runners that can run them.
      
      Fixing the latter problem is tracked in #22409.
      
      I went ahead and removed all settings and configurations.
      c5d1bf29
    • M Farkas-Dyck's avatar
      CI: Forbid the fully static build on Alpine to fail. · 81eeec7f
      M Farkas-Dyck authored and Marge Bot's avatar Marge Bot committed
      To do so, we mark some tests broken in this configuration.
      81eeec7f
    • Simon Peyton Jones's avatar
      Add a missing varToCoreExpr in etaBodyForJoinPoint · afc2540d
      Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
      This subtle bug showed up when compiling a library with 9.4.
      See #22491.  The bug is present in master, but it is hard to
      trigger; the new regression test T22491 fails in 9.4.
      
      The fix was easy: just add a missing varToCoreExpr in
      etaBodyForJoinPoint.
      
      The fix is definitely right though!
      
      I also did some other minor refatoring:
      * Moved the preInlineUnconditionally test in simplExprF1 to
        before the call to joinPointBinding_maybe, to avoid fruitless
        eta-expansion.
      * Added a boolean from_lam flag to simplNonRecE, to avoid two
        fruitless tests, and commented it a bit better.
      
      These refactorings seem to save 0.1% on compile-time allocation in
      perf/compiler; with a max saving of 1.4% in T9961
      
      Metric Decrease:
          T9961
      afc2540d
Loading