GHC.StgToCmm.Utils

ghc-9.2.1: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.StgToCmm.Utils

Contents

- Update remembered set operations

Synopsis

- cgLit :: Literal -> FCode CmmLit
- mkSimpleLit :: Platform -> Literal -> CmmLit
- emitDataLits :: CLabel -> [CmmLit] -> FCode ()
- emitRODataLits :: CLabel -> [CmmLit] -> FCode ()
- emitDataCon :: CLabel -> CmmInfoTable -> CostCentreStack -> [CmmLit] -> FCode ()
- emitRtsCall :: UnitId -> FastString -> [(CmmExpr, ForeignHint)] -> Bool -> FCode ()
- emitRtsCallWithResult :: LocalReg -> ForeignHint -> UnitId -> FastString -> [(CmmExpr, ForeignHint)] -> Bool -> FCode ()
- emitRtsCallGen :: [(LocalReg, ForeignHint)] -> CLabel -> [(CmmExpr, ForeignHint)] -> Bool -> FCode ()
- assignTemp :: CmmExpr -> FCode LocalReg
- newTemp :: MonadUnique m => CmmType -> m LocalReg
- newUnboxedTupleRegs :: Type -> FCode ([LocalReg], [ForeignHint])
- emitMultiAssign :: [LocalReg] -> [CmmExpr] -> FCode ()
- emitCmmLitSwitch :: CmmExpr -> [(Literal, CmmAGraphScoped)] -> CmmAGraphScoped -> FCode ()
- emitSwitch :: CmmExpr -> [(ConTagZ, CmmAGraphScoped)] -> Maybe CmmAGraphScoped -> ConTagZ -> ConTagZ -> FCode ()
- tagToClosure :: Platform -> TyCon -> CmmExpr -> CmmExpr
- mkTaggedObjectLoad :: Platform -> LocalReg -> LocalReg -> ByteOff -> DynTag -> CmmAGraph
- callerSaves :: Platform -> GlobalReg -> Bool
- callerSaveVolatileRegs :: Platform -> (CmmAGraph, CmmAGraph)
- get_GlobalReg_addr :: Platform -> GlobalReg -> CmmExpr
- callerSaveGlobalReg :: Platform -> GlobalReg -> CmmAGraph
- callerRestoreGlobalReg :: Platform -> GlobalReg -> CmmAGraph
- cmmAndWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmOrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmNegate :: Platform -> CmmExpr -> CmmExpr
- cmmEqWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmNeWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmUGtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmSubWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmMulWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmAddWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmUShrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmOffsetExprW :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmOffsetExprB :: Platform -> CmmExpr -> CmmExpr -> CmmExpr
- cmmRegOffW :: Platform -> CmmReg -> WordOff -> CmmExpr
- cmmRegOffB :: CmmReg -> ByteOff -> CmmExpr
- cmmLabelOffW :: Platform -> CLabel -> WordOff -> CmmLit
- cmmLabelOffB :: CLabel -> ByteOff -> CmmLit
- cmmOffsetW :: Platform -> CmmExpr -> WordOff -> CmmExpr
- cmmOffsetB :: Platform -> CmmExpr -> ByteOff -> CmmExpr
- cmmOffsetLitW :: Platform -> CmmLit -> WordOff -> CmmLit
- cmmOffsetLitB :: CmmLit -> ByteOff -> CmmLit
- cmmLoadIndexW :: Platform -> CmmExpr -> Int -> CmmType -> CmmExpr
- cmmConstrTag1 :: Platform -> CmmExpr -> CmmExpr
- cmmUntag :: Platform -> CmmExpr -> CmmExpr
- cmmIsTagged :: Platform -> CmmExpr -> CmmExpr
- addToMem :: CmmType -> CmmExpr -> Int -> CmmAGraph
- addToMemE :: CmmType -> CmmExpr -> CmmExpr -> CmmAGraph
- addToMemLblE :: CmmType -> CLabel -> CmmExpr -> CmmAGraph
- addToMemLbl :: CmmType -> CLabel -> Int -> CmmAGraph
- newStringCLit :: String -> FCode CmmLit
- newByteStringCLit :: ByteString -> FCode CmmLit
- whenUpdRemSetEnabled :: FCode a -> FCode ()
- emitUpdRemSetPush :: CmmExpr -> FCode ()
- emitUpdRemSetPushThunk :: CmmExpr -> FCode ()
- convertInfoProvMap :: DynFlags -> [CmmInfoTable] -> Module -> InfoTableProvMap -> [InfoProvEnt]
- cmmInfoTableToInfoProvEnt :: Module -> CmmInfoTable -> InfoProvEnt

# Documentation

cgLit :: Literal -> FCode CmmLit Source #

mkSimpleLit :: Platform -> Literal -> CmmLit Source #

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

Emit a data-segment data block

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

Emit a read-only data block

emitDataCon :: CLabel -> CmmInfoTable -> CostCentreStack -> [CmmLit] -> FCode () Source #

emitRtsCall :: UnitId -> FastString -> [(CmmExpr, ForeignHint)] -> Bool -> FCode () Source #

emitRtsCallWithResult :: LocalReg -> ForeignHint -> UnitId -> FastString -> [(CmmExpr, ForeignHint)] -> Bool -> FCode () Source #

emitRtsCallGen :: [(LocalReg, ForeignHint)] -> CLabel -> [(CmmExpr, ForeignHint)] -> Bool -> FCode () Source #

assignTemp :: CmmExpr -> FCode LocalReg Source #

newTemp :: MonadUnique m => CmmType -> m LocalReg Source #

newUnboxedTupleRegs :: Type -> FCode ([LocalReg], [ForeignHint]) Source #

emitMultiAssign :: [LocalReg] -> [CmmExpr] -> FCode () Source #

emitCmmLitSwitch :: CmmExpr -> [(Literal, CmmAGraphScoped)] -> CmmAGraphScoped -> FCode () Source #

emitSwitch :: CmmExpr -> [(ConTagZ, CmmAGraphScoped)] -> Maybe CmmAGraphScoped -> ConTagZ -> ConTagZ -> FCode () Source #

tagToClosure :: Platform -> TyCon -> CmmExpr -> CmmExpr Source #

mkTaggedObjectLoad :: Platform -> LocalReg -> LocalReg -> ByteOff -> DynTag -> CmmAGraph Source #

callerSaves :: Platform -> GlobalReg -> Bool Source #

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

callerSaveVolatileRegs :: Platform -> (CmmAGraph, CmmAGraph) Source #

get_GlobalReg_addr :: Platform -> GlobalReg -> CmmExpr Source #

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.

callerSaveGlobalReg :: Platform -> GlobalReg -> CmmAGraph Source #

callerRestoreGlobalReg :: Platform -> GlobalReg -> CmmAGraph Source #

cmmAndWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmOrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmNegate :: Platform -> CmmExpr -> CmmExpr Source #

cmmEqWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmNeWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmUGtWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmSubWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmMulWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmAddWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmUShrWord :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmOffsetExprW :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmOffsetExprB :: Platform -> CmmExpr -> CmmExpr -> CmmExpr Source #

cmmRegOffW :: Platform -> CmmReg -> WordOff -> CmmExpr Source #

cmmRegOffB :: CmmReg -> ByteOff -> CmmExpr Source #

cmmLabelOffW :: Platform -> CLabel -> WordOff -> CmmLit Source #

cmmLabelOffB :: CLabel -> ByteOff -> CmmLit Source #

cmmOffsetW :: Platform -> CmmExpr -> WordOff -> CmmExpr Source #

cmmOffsetB :: Platform -> CmmExpr -> ByteOff -> CmmExpr Source #

cmmOffsetLitW :: Platform -> CmmLit -> WordOff -> CmmLit Source #

cmmOffsetLitB :: CmmLit -> ByteOff -> CmmLit Source #

cmmLoadIndexW :: Platform -> CmmExpr -> Int -> CmmType -> CmmExpr Source #

cmmConstrTag1 :: Platform -> CmmExpr -> CmmExpr Source #

cmmUntag :: Platform -> CmmExpr -> CmmExpr Source #

cmmIsTagged :: Platform -> CmmExpr -> CmmExpr Source #

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

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

addToMemLblE :: CmmType -> CLabel -> CmmExpr -> CmmAGraph Source #

addToMemLbl :: CmmType -> CLabel -> Int -> CmmAGraph Source #

newStringCLit :: String -> FCode CmmLit Source #

newByteStringCLit :: ByteString -> FCode CmmLit Source #

# Update remembered set operations

whenUpdRemSetEnabled :: FCode a -> FCode () Source #

emitUpdRemSetPush Source #

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 Source #

Arguments

:: CmmExpr | the thunk
-> FCode () |

convertInfoProvMap :: DynFlags -> [CmmInfoTable] -> Module -> InfoTableProvMap -> [InfoProvEnt] Source #

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

cmmInfoTableToInfoProvEnt :: Module -> CmmInfoTable -> InfoProvEnt Source #

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