ghc-9.14.0.20251128: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.StgToCmm.Utils

Synopsis

Documentation

emitDataLits :: CLabel -> [CmmLit] -> FCode () #

Emit a data-segment data block

emitRODataLits :: CLabel -> [CmmLit] -> FCode () #

Emit a read-only data block

callerSaves :: Platform -> GlobalReg -> Bool #

Returns True if this global register is stored in a caller-saves machine register.

get_GlobalReg_addr :: Platform -> GlobalReg -> CmmExpr #

We map STG registers onto appropriate CmmExprs. Either they map to real machine registers or stored as offsets from BaseReg. Given a GlobalReg, get_GlobalReg_addr always produces the register table address for it.

addToMem :: CmmType -> CmmExpr -> Int -> CmmAGraph #

addToMem rep ptr n adds n to the integer pointed-to by ptr.

addToMemE :: CmmType -> CmmExpr -> CmmExpr -> CmmAGraph #

addToMemE rep ptr n adds n to the integer pointed-to by ptr.

emitAtomicRead #

Arguments

:: MemoryOrdering 
-> LocalReg

result register

-> CmmExpr

address

-> FCode () 

emitAtomicWrite #

Arguments

:: MemoryOrdering 
-> CmmExpr

address

-> CmmExpr

value

-> FCode () 

Update remembered set operations

emitUpdRemSetPush #

Arguments

:: CmmExpr

value of pointer which was overwritten

-> FCode () 

Emit code to add an entry to a now-overwritten pointer to the update remembered set.

emitUpdRemSetPushThunk #

Arguments

:: CmmExpr

the thunk

-> FCode () 

convertInfoProvMap :: StgToCmmConfig -> Module -> InfoTableProvMap -> IPEStats -> [CmmInfoTable] -> (IPEStats, [InfoProvEnt]) #

Convert source information collected about identifiers in Debug to entries suitable for placing into the info table provenance table.

The initial stats given to this function will (or should) only contain stats for stack info tables skipped during generateCgIPEStub. As the fold progresses, counts of tables per closure type will be accumulated.

cmmInfoTableToInfoProvEnt :: Module -> CmmInfoTable -> InfoProvEnt #

A bare bones InfoProvEnt for things which don't have a good source location

data IPEStats #

Constructors

IPEStats 

Instances

Instances details
Outputable IPEStats # 
Instance details

Defined in GHC.StgToCmm.Utils

Methods

ppr :: IPEStats -> SDoc #

Monoid IPEStats # 
Instance details

Defined in GHC.StgToCmm.Utils

Semigroup IPEStats # 
Instance details

Defined in GHC.StgToCmm.Utils