Commits on Source (4)
-
7bd407a6
-
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 -------------------------
7575709b -
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.
bcbcdaaf -
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.
d186f6aa
Showing
- .gitattributes 1 addition, 0 deletions.gitattributes
- compiler/GHC/Data/Graph/Directed.hs 12 additions, 150 deletionscompiler/GHC/Data/Graph/Directed.hs
- compiler/GHC/Data/Graph/Directed/Internal.hs 79 additions, 0 deletionscompiler/GHC/Data/Graph/Directed/Internal.hs
- compiler/GHC/Data/Graph/Directed/Reachability.hs 168 additions, 0 deletionscompiler/GHC/Data/Graph/Directed/Reachability.hs
- compiler/GHC/Driver/Config/StgToCmm.hs 0 additions, 1 deletioncompiler/GHC/Driver/Config/StgToCmm.hs
- compiler/GHC/Driver/Hooks.hs 1 addition, 2 deletionscompiler/GHC/Driver/Hooks.hs
- compiler/GHC/Driver/Main.hs 6 additions, 9 deletionscompiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs 15 additions, 18 deletionscompiler/GHC/Driver/Make.hs
- compiler/GHC/HsToCore/Coverage.hs 1 addition, 1 deletioncompiler/GHC/HsToCore/Coverage.hs
- compiler/GHC/Iface/Tidy.hs 0 additions, 3 deletionscompiler/GHC/Iface/Tidy.hs
- compiler/GHC/Linker/Deps.hs 8 additions, 9 deletionscompiler/GHC/Linker/Deps.hs
- compiler/GHC/Parser/String.hs 14 additions, 0 deletionscompiler/GHC/Parser/String.hs
- compiler/GHC/StgToCmm.hs 4 additions, 11 deletionscompiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/Config.hs 0 additions, 1 deletioncompiler/GHC/StgToCmm/Config.hs
- compiler/GHC/StgToCmm/Hpc.hs 1 addition, 18 deletionscompiler/GHC/StgToCmm/Hpc.hs
- compiler/GHC/Unit/Module/Graph.hs 31 additions, 18 deletionscompiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/ModGuts.hs 0 additions, 1 deletioncompiler/GHC/Unit/Module/ModGuts.hs
- compiler/ghc.cabal.in 2 additions, 0 deletionscompiler/ghc.cabal.in
- docs/users_guide/exts/multiline_strings.rst 6 additions, 2 deletionsdocs/users_guide/exts/multiline_strings.rst
- libraries/ghc-internal/src/GHC/Internal/Exception.hs 7 additions, 2 deletionslibraries/ghc-internal/src/GHC/Internal/Exception.hs
compiler/GHC/Data/Graph/Directed/Internal.hs
0 → 100644