[Git][ghc/ghc][wip/romes/restore-ecwl] 4 commits: Fix CRLF in multiline strings (#25375)

Zubin (@wz1000) gitlab at gitlab.haskell.org
Fri Nov 22 12:11:25 UTC 2024



Zubin pushed to branch wip/romes/restore-ecwl at Glasgow Haskell Compiler / GHC


Commits:
7bd407a6 by Brandon Chinn at 2024-11-21T14:08:15-05:00
Fix CRLF in multiline strings (#25375)

- - - - -
7575709b by Rodrigo Mesquita at 2024-11-21T14:08:52-05:00
Improve reachability queries on ModuleGraph

Introduces `ReachabilityIndex`, an index constructed from a
`GHC.Data.Graph.Directed` `Graph` that supports fast reachability
queries (in $O(1)$). This abstract data structure is exposed from
`GHC.Data.Graph.Directed.Reachability`.

This index is constructed from the module graph nodes and cached in
`ModuleGraph`, enabling efficient reachability queries on the module
graph. Previously, we'd construct a Map of Set of ModuleGraph nodes
which used a lot of memory (`O(n^2)` in the number of nodes) and cache
that in the `ModuleGraph`. By using the reachability index we get rid of
this space leak in the module graph -- even though the index is still
quadratic in the number of modules, it is much, much more space
efficient due to its representation using an IntMap of IntSet as opposed
to the transitive closure we previously cached.

In a memory profile of MultiLayerModules with 100x100 modules, memory
usage improved from 6GB residency to 2.8GB, out of which roughly 1.8GB
are caused by a second space leak related to ModuleGraph. On the same
program, it brings compile time from 7.5s to 5.5s.

Note how we simplify `checkHomeUnitsClosed` in terms of
`isReachableMany` and by avoiding constructing a second graph with the
full transitive closure -- it suffices to answer the reachability query
on the full graph without collapsing the transitive closure completely
into nodes.

Unfortunately, solving this leak means we have to do a little bit more
work since we can no longer cache the result of turning vertex indices
into nodes. This results in a slight regression in MultiLayerModulesTH_Make,
but results in large performance and memory wins when compiling large
amounts of modules.

-------------------------
Metric Decrease:
    mhu-perf
Metric Increase:
    MultiLayerModulesTH_Make
-------------------------

- - - - -
bcbcdaaf by Cheng Shao at 2024-11-21T14:09:28-05:00
driver: fix hpc undefined symbol issue in TH with -fprefer-byte-code

This commit fixes an undefined symbol error in RTS linker when
attempting to compile home modules with -fhpc and
-fbyte-code-and-object-code/-fprefer-byte-code, see #25510 for
detailed description and analysis of the bug.

Also adds T25510/T25510c regression tests to test make mode/oneshot
mode of the bug.

- - - - -
d186f6aa by Rodrigo Mesquita at 2024-11-22T12:11:22+00:00
Re-introduce ErrorCallWithLocation with a deprecation pragma

With the removal of the duplicate backtrace, part of CLC proposal #285,
the constructor `ErrorCallWithLocation` was removed from base.

This commit re-introduces it with a deprecation.

- - - - -


30 changed files:

- .gitattributes
- compiler/GHC/Data/Graph/Directed.hs
- + compiler/GHC/Data/Graph/Directed/Internal.hs
- + compiler/GHC/Data/Graph/Directed/Reachability.hs
- compiler/GHC/Driver/Config/StgToCmm.hs
- compiler/GHC/Driver/Hooks.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/HsToCore/Coverage.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Linker/Deps.hs
- compiler/GHC/Parser/String.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/Config.hs
- compiler/GHC/StgToCmm/Hpc.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/ModGuts.hs
- compiler/ghc.cabal.in
- docs/users_guide/exts/multiline_strings.rst
- libraries/ghc-internal/src/GHC/Internal/Exception.hs
- + testsuite/tests/bytecode/T25510/Makefile
- + testsuite/tests/bytecode/T25510/T25510A.hs
- + testsuite/tests/bytecode/T25510/T25510B.hs
- + testsuite/tests/bytecode/T25510/all.T
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/63edd2cdb6eee16e667f0413f2bd6b191e668bef...d186f6aa60d94430b82cdc26890761efc42b4145

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/63edd2cdb6eee16e667f0413f2bd6b191e668bef...d186f6aa60d94430b82cdc26890761efc42b4145
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241122/23e33a0d/attachment.html>


More information about the ghc-commits mailing list