GHC.StgToCmm.Prof

ghc-9.14.0.20251028: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.StgToCmm.Prof

Synopsis

- initCostCentres :: CollectedCCs -> FCode ()
- ccType :: Platform -> CmmType
- ccsType :: Platform -> CmmType
- mkCCostCentre :: CostCentre -> CmmLit
- mkCCostCentreStack :: CostCentreStack -> CmmLit
- initInfoTableProv :: IPEStats -> [CmmInfoTable] -> InfoTableProvMap -> DUniqSupply -> FCode (Maybe (IPEStats, CStub), DUniqSupply)
- dynProfHdr :: Profile -> CmmExpr -> [CmmExpr]
- profDynAlloc :: SMRep -> CmmExpr -> FCode ()
- profAlloc :: CmmExpr -> CmmExpr -> FCode ()
- staticProfHdr :: Profile -> CostCentreStack -> [CmmLit]
- initUpdFrameProf :: CmmExpr -> FCode ()
- enterCostCentreThunk :: CmmExpr -> FCode ()
- enterCostCentreFun :: CostCentreStack -> CmmExpr -> FCode ()
- costCentreFrom :: Platform -> CmmExpr -> CmmExpr
- storeCurCCS :: Platform -> CmmExpr -> CmmAGraph
- emitSetCCC :: CostCentre -> Bool -> Bool -> FCode ()
- saveCurrentCostCentre :: FCode (Maybe LocalReg)
- restoreCurrentCostCentre :: Platform -> Maybe LocalReg -> FCode ()
- ldvEnter :: CmmExpr -> FCode ()
- ldvEnterClosure :: ClosureInfo -> CmmReg -> FCode ()
- profHeaderCreate :: CmmExpr -> FCode ()

# Documentation

initCostCentres :: CollectedCCs -> FCode () Source #

ccType :: Platform -> CmmType Source #

ccsType :: Platform -> CmmType Source #

mkCCostCentre :: CostCentre -> CmmLit Source #

mkCCostCentreStack :: CostCentreStack -> CmmLit Source #

initInfoTableProv :: IPEStats -> [CmmInfoTable] -> InfoTableProvMap -> DUniqSupply -> FCode (Maybe (IPEStats, CStub), DUniqSupply) Source #

Emit info-table provenance declarations and track IPE stats.

Note that the stats passed to this function will (rather, should) only ever contain stats for skipped STACK info tables accumulated in `generateCgIPEStub`.

dynProfHdr :: Profile -> CmmExpr -> [CmmExpr] Source #

Profiling header words in a dynamic closure

profDynAlloc :: SMRep -> CmmExpr -> FCode () Source #

Record the allocation of a closure. The CmmExpr is the cost centre stack to which to attribute the allocation.

profAlloc :: CmmExpr -> CmmExpr -> FCode () Source #

Record the allocation of a closure (size is given by a CmmExpr) The size must be in words, because the allocation counter in a CCS counts in words.

staticProfHdr :: Profile -> CostCentreStack -> [CmmLit] Source #

The profiling header words in a static closure

initUpdFrameProf :: CmmExpr -> FCode () Source #

Initialise the profiling field of an update frame

enterCostCentreThunk :: CmmExpr -> FCode () Source #

enterCostCentreFun :: CostCentreStack -> CmmExpr -> FCode () Source #

costCentreFrom :: Platform -> CmmExpr -> CmmExpr Source #

storeCurCCS :: Platform -> CmmExpr -> CmmAGraph Source #

emitSetCCC :: CostCentre -> Bool -> Bool -> FCode () Source #

saveCurrentCostCentre :: FCode (Maybe LocalReg) Source #

restoreCurrentCostCentre :: Platform -> Maybe LocalReg -> FCode () Source #

ldvEnter :: CmmExpr -> FCode () Source #

ldvEnterClosure :: ClosureInfo -> CmmReg -> FCode () Source #

Called when a closure is entered, marks the closure as having been "used". The closure is not an "inherently used" one. The closure is not `IND` because that is not considered for LDV profiling.

profHeaderCreate :: CmmExpr -> FCode () Source #

Initialise the profiling word of a new dynamic closure * When LDV profiling is enabled (era > 0) - Initialise to the LDV word * When eras profiling is enabled (user_era > 0) - Initialise to current user_era