Commit e699588
committed
perf: split GHC.Hs.Instances for parallel compilation (#18254)
Split the monolithic GHC.Hs.Instances module (344 Data instances, 14MB
object file) into 5 parallel-compilable sub-modules:
- GHC.Hs.Instances.Common - phase-independent instances
- GHC.Hs.Instances.Transitions - LR types spanning multiple phases
- GHC.Hs.Instances.Parsed - GhcPs instances only
- GHC.Hs.Instances.Renamed - GhcRn instances only
- GHC.Hs.Instances.Typechecked - GhcTc instances only
The wrapper module GHC.Hs.Instances re-exports all sub-modules for
backward compatibility.
Additionally, all Instance modules are now excluded from stage1 builds
(via -interpreter flag) since Data instances are only needed at runtime
for Template Haskell and GHCi, not for compilation.
Benefits:
- Stage1: Saves ~14MB object file + compile time
- Stage2: 5 modules can compile in parallel instead of 1 serial
See #9557 for why these use -O0, #18254 for the parallelism issue.1 parent c12adc1 commit e699588
File tree
8 files changed
+727
-609
lines changed- compiler
- GHC
- Hs
- Instances
8 files changed
+727
-609
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
0 commit comments