Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding.jeltsch-experiment at Glasgow Haskell Compiler / GHC Commits: da4c4d9f by Wolfgang Jeltsch at 2026-04-11T16:23:36+03:00 Consider also `ModuleNodeFixed` nodes for the cache - - - - - 261aa4e3 by Wolfgang Jeltsch at 2026-04-11T16:30:31+03:00 Experimentally exclude `dep_providers` from `excluded` - - - - - 2 changed files: - compiler/GHC/Unit/Finder.hs - compiler/GHC/Unit/Module/Graph.hs Changes: ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -256,7 +256,7 @@ findImportedModuleNoHsc fc fopts ue home_module_map mhome_unit mod_name mb_pkg = in Set.toList providers unknown_units = let candidates = Set.difference hpt_deps complete_units - excluded = maybe dep_providers (\u -> Set.insert u dep_providers) current_unit_id + excluded = maybe Set.empty Set.singleton {- maybe dep_providers (\u -> Set.insert u dep_providers) -} current_unit_id in Set.toList (Set.difference candidates excluded) other_home_uids = known_other_uids ++ unknown_units other_fopts_list = ===================================== compiler/GHC/Unit/Module/Graph.hs ===================================== @@ -219,22 +219,18 @@ mkHomeModuleMap nodes = ModuleNameHomeMap completeUnits providerMap where providerMap = Map.fromListWith Set.union $ [ - (ms_mod_name modSummary, Set.singleton (ms_unitid modSummary)) | - ModuleNode _ (ModuleNodeCompile modSummary) <- nodes + (moduleName, Set.singleton unitID) | + ModuleNode _ moduleNodeInfo <- nodes, + let moduleName = moduleNodeInfoModuleName moduleNodeInfo, + let unitID = moduleNodeInfoUnitId moduleNodeInfo ] completeUnits :: Set UnitId - completeUnits - = Set.fromList $ - [ - ms_unitid modSummary | - ModuleNode _ (ModuleNodeCompile modSummary) <- nodes - ] - - {-NOTE: - The matching with `ModuleNodeCompile` results in nodes with - `ModuleNodeFixed` in their info being dropped. - -} + completeUnits = Set.fromList $ + [ + moduleNodeInfoUnitId moduleNodeInfo | + ModuleNode _ moduleNodeInfo <- nodes + ] mgHomeModuleMap :: ModuleGraph -> ModuleNameHomeMap mgHomeModuleMap = mg_home_map View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/91489d4ad4e9c7c134eef9089e2931d... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/91489d4ad4e9c7c134eef9089e2931d... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Wolfgang Jeltsch (@jeltsch)