Wolfgang Jeltsch pushed to branch wip/jeltsch/more-efficient-home-unit-imports-finding at Glasgow Haskell Compiler / GHC Commits: cd32e98b by Wolfgang Jeltsch at 2026-04-28T22:21:02+03:00 Widen the condition for taking the `sorted_deps` shortcut - - - - - 1 changed file: - compiler/GHC/Unit/Finder.hs Changes: ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -252,10 +252,7 @@ findImportedModuleNoHsc fc fopts ue home_module_name_providers_map mb_home_unit hpt_deps :: Set.Set UnitId hpt_deps = homeUnitDepends units - -- TODO: this predicate is wrong, we need something more focused - sorted_deps = if finder_lookupHomeInterfaces fopts - then Set.toList hpt_deps - else sortHomeUnitsByLikelihoodFor home_module_name_providers_map mb_home_unit_id mod_name hpt_deps + sorted_deps = sortHomeUnitsByLikelihoodFor home_module_name_providers_map mb_home_unit_id mod_name hpt_deps other_fopts = [ (uid, initFinderOpts (homeUnitEnv_dflags (ue_findHomeUnitEnv uid ue))) @@ -263,6 +260,11 @@ findImportedModuleNoHsc fc fopts ue home_module_name_providers_map mb_home_unit ] sortHomeUnitsByLikelihoodFor :: HomeModuleNameProvidersMap -> Maybe UnitId -> ModuleName -> Set.Set UnitId -> [UnitId] +sortHomeUnitsByLikelihoodFor _ _ _ hpt_deps | Set.null hpt_deps = [] +{- + With the above shortcut, evaluation of the module graph will not be + triggered. +-} sortHomeUnitsByLikelihoodFor home_module_name_providers_map mb_home_unit_id mod_name hpt_deps = let cached_module_providers = lookupWithDefaultUniqMap home_module_name_providers_map Set.empty mod_name View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cd32e98b21c955544e1e5a73b7fcecf5... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cd32e98b21c955544e1e5a73b7fcecf5... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Wolfgang Jeltsch (@jeltsch)