845046b1
by sheaf at 2026-08-25T19:25:53+02:00
Rule-based deterministic concurrent downsweep
This commit rewrites downsweep as a single query-answering rule
(see 'DownsweepRule') that can be executed by concurrent worker threads.
The design allows every expensive operation (preprocessing files with CPP,
parsing headers, reading interfaces) to be performed concurrently
according to the -j<N>/-jsem flags.
See Note [Rules-based downsweep] in GHC.Driver.Downsweep.
To achieve this, the finder cache was slightly restructured in order to
account for modules whose source files are directly specified as targets;
see the new Note [Known home modules] in GHC.Unit.Finder.Types. This
allowed us to remove 'addModuleToFinder', 'addHomeModuleToFinder' and
a few brittle hacks (e.g. in Backpack).
Fixes #27514