HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.Cmm.Info.Build

  • 4 types
  • 5 values
  • Packageghc-9.10.3
  • Exports9
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceBuild.hs
valuecafAnal
  1. :: Platform
  2. -> LabelSet

    The blocks representing continuations, ie. those that will get RET info tables. These labels will get their own SRTs, so we don't aggregate CAFs from references to these labels, we just use the label.

  3. -> CLabel

    The top label of the proc

  4. -> CmmGraph
  5. -> CAFEnv
#

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

datadata ModuleSRTInfo
#

Constructors

  • ModuleSRTInfo
    • thisModule :: Module

      Current module being compiled. Required for calling labelDynamic.

    • dedupSRTs :: Map (Set SRTEntry) SRTEntry

      previous 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
typetype SRTMap = Map CAFfyLabel (Maybe SRTEntry)
#

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.