Moduleghc-10.0.0.20260917GHC2024
GHC.Cmm.Info.Build
- 4 types
- 5 values
- Packageghc-10.0.0.20260917
- Exports9
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceBuild.hs
cafAnal For each code block:
- collect the references reachable from this code block to FUN,
THUNK or RET labels for which hasCAF == True
This gives us a CAFEnv: a mapping from code block to sets of labels
Collect possible CAFfy references from a CmmData decl.
doSRTs :: CmmConfig-> ModuleSRTInfo-> DUniqSupply-> [(CAFEnv, [CmmDecl])]-> [(CAFSet, CmmDataDecl)]static data decls and their CAFSets
-> IO (ModuleSRTInfo, DUniqSupply, [CmmDeclSRTs])
Attach SRTs to all info tables in the CmmDecls, and add SRT declarations to the ModuleSRTInfo.
Constructors
ModuleSRTInfothisModule :: ModuleCurrent module being compiled. Required for calling labelDynamic.
dedupSRTs :: Map (Set SRTEntry) SRTEntryprevious SRTs we've emitted, so we can de-duplicate. Used to implement the [Common] optimisation.
flatSRTs :: Map SRTEntry (Set SRTEntry)The reverse mapping, so that we can remove redundant entries. e.g. if we have an SRT [a,b,c], and we know that b points to [c,d], we can omit c and emit [a,b]. Used to implement the [Filter] optimisation.
moduleSRTMap :: SRTMap
Instances1OutputableP
OutputableP env CLabel => OutputableP env ModuleSRTInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.Info.Build
Maps labels from cafAnal to the final CLabel that will appear in the SRT. - closures with singleton SRTs resolve to their single entry - closures with larger SRTs map to the label for that SRT - CAFs must not map to anything! - if a labels maps to Nothing, we found that this label's SRT is empty, so we don't need to refer to it from other SRTs.
Given SRTMap of a module, returns the set of non-CAFFY names in the
module. Any Names not in the set are CAFFY.