Andreas Klebinger pushed to branch wip/andreask/build-opt at Glasgow Haskell Compiler / GHC Commits: 6aa2e67e by Andreas Klebinger at 2026-04-20T19:45:21+00:00 Clean up Instances.hs-boot a bit - - - - - 613871fd by Andreas Klebinger at 2026-04-20T19:48:08+00:00 Even better note - - - - - 1 changed file: - compiler/GHC/Hs/Instances.hs-boot Changes: ===================================== compiler/GHC/Hs/Instances.hs-boot ===================================== @@ -2,35 +2,8 @@ {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} --- This module contains exclusively Data instances, which are going to be slow --- no matter what we do. Furthermore, they are incredibly slow to compile with --- optimisation (see #9557). Consequently we compile this with -O0. --- See #18254. - module GHC.Hs.Instances where --- This module defines the Data instances for the hsSyn AST. - --- It happens here to avoid massive constraint types on the AST with concomitant --- slow GHC bootstrap times. - --- UndecidableInstances ? - -{- Note [Data.Data instances for GHC AST Types] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We give all of the frontend types and their instantiations (HsSyn) and -some other types Data.Data instances. There are two main motivations to -do so: - -* For users of the GHC API it allows to write Generic code over the GHC AST. -* GHC itself has a few uses of these as well: - * In the showAstData, showAstDataFull helpers to print a representation of - the actual AST using it's constructors rather than just user facing pretty printing. - * It's used to some degree for HIE file generation in the ToHIE instances. - * TH serialization uses it for serialization of Annotations (GHC.Serialized) - * Some of the dump flags use showAstData to produce the actual dump output. --} - {- Note [hs-boot files as "header" files] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We can use hs-boot files like C header files to unlock parallel @@ -64,8 +37,10 @@ inlining things from TakesForever.hs or needs to know the exact representation o types for unboxing or similar this trick will do more harm than good. For GHC itself we can figure out where it makes sense to insert such "header" boot -files by looking at a build profile and look for places where the build sequentializes -to one or two concurrent GHC invocations. +files by looking at a build profile generated by shake. +They can be generated via `--profile=report.trace` and looking for places where +the build sequentializes to one or two concurrent GHC invocations is visually +pretty obvious in those cases. -} import Data.Data hiding ( Fixity ) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c930572d0e0d369147ba23f99f8e3aa... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c930572d0e0d369147ba23f99f8e3aa... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Andreas Klebinger (@AndreasK)