[Git][ghc/ghc][wip/romes/27461] 2 commits: Fixup: fix note name
Hannes Siebenhandl pushed to branch wip/romes/27461 at Glasgow Haskell Compiler / GHC Commits: 2e6aaeec by fendor at 2026-07-24T13:19:49+02:00 Fixup: fix note name - - - - - 88c8b946 by fendor at 2026-07-24T13:32:12+02:00 Fixup: changelog - - - - - 4 changed files: - + changelog.d/T27461 - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Unit/Env.hs Changes: ===================================== changelog.d/T27461 ===================================== @@ -0,0 +1,17 @@ +section: compiler +issues: #27461 +mrs: !16330 +synopsis: + downsweep: make control flow simpler and cache correct +description: { + Extracts the control flow of downsweep into a single + function `dfsBuild`, which takes care of iteratively expanding and + traversing all nodes of the in-construction module graph necessary to + build a full `ModuleGraph`. + + This avoids recomputing expensive operations, such summarising `Module`s into `ModuleSummary`s. + We greatly reduce the number of allocations for module graphs with lots of imports, especially + when multiple home units are involved. +} + + ===================================== compiler/GHC/Driver/Downsweep.hs ===================================== @@ -6,7 +6,7 @@ {-# LANGUAGE BlockArguments #-} {-# LANGUAGE ViewPatterns #-} --- | See Note [Downsweep and the ModuleGraph] +-- | See Note [The ModuleGraph] module GHC.Driver.Downsweep ( downsweep , downsweepThunk @@ -234,7 +234,7 @@ See also Note [Downsweep Control Flow and Caching] -- It will also turn on code generation for any modules that need it by calling -- 'enableCodeGenForTH'. -- --- See also Note [Downsweep and the ModuleGraph] +-- See also Note [The ModuleGraph] downsweep :: HscEnv -> (GhcMessage -> AnyGhcDiagnostic) -> Maybe Messager @@ -1858,5 +1858,5 @@ twice). Note that (2) can't guarantee this alone: Two ModuleName imports in separate units can (and likely do) map to the same `Module`. -See also Note [Downsweep and the ModuleGraph] +See also Note [The ModuleGraph] -} ===================================== compiler/GHC/Driver/Env.hs ===================================== @@ -270,7 +270,7 @@ hugSomeThingsBelowUs :: (HomeModInfo -> [a]) -> Bool -> HscEnv -> UnitId -> Modu -- These things are currently stored in the EPS for home packages. (See #25795 for -- progress in removing these kind of checks; and making these functions of -- `UnitEnv` rather than `HscEnv`) --- See Note [Downsweep and the ModuleGraph] +-- See Note [The ModuleGraph] hugSomeThingsBelowUs _ _ hsc_env _ _ | isOneShot (ghcMode (hsc_dflags hsc_env)) = return [] hugSomeThingsBelowUs extract include_hi_boot hsc_env uid mn = let hug = hsc_HUG hsc_env ===================================== compiler/GHC/Unit/Env.hs ===================================== @@ -164,7 +164,7 @@ data UnitEnv = UnitEnv , ue_module_graph :: ModuleGraph -- ^ The module graph of the current session - -- See Note [Downsweep and the ModuleGraph] for when this is constructed. + -- See Note [The ModuleGraph] for when this is constructed. , ue_home_unit_graph :: !HomeUnitGraph -- See Note [Multiple Home Units] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9a28992cfb92b380766a9848b558889... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9a28992cfb92b380766a9848b558889... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Hannes Siebenhandl (@fendor)