ghc-7.4.2: The GHC API

Safe Haskell | None

CmmUtils

Contents

- Operations that probably don't belong here

Synopsis

- primRepCmmType :: PrimRep -> CmmType
- primRepForeignHint :: PrimRep -> ForeignHint
- typeCmmType :: Type -> CmmType
- typeForeignHint :: Type -> ForeignHint
- zeroCLit :: CmmLit
- mkIntCLit :: Int -> CmmLit
- mkWordCLit :: StgWord -> CmmLit
- packHalfWordsCLit :: (Integral a, Integral b) => a -> b -> CmmLit
- mkByteStringCLit :: Unique -> [Word8] -> (CmmLit, GenCmmDecl CmmStatics info stmt)
- mkDataLits :: Section -> CLabel -> [CmmLit] -> GenCmmDecl CmmStatics info stmt
- mkRODataLits :: CLabel -> [CmmLit] -> GenCmmDecl CmmStatics info stmt
- mkLblExpr :: CLabel -> CmmExpr
- cmmRegOff :: CmmReg -> Int -> CmmExpr
- cmmOffset :: CmmExpr -> Int -> CmmExpr
- cmmLabelOff :: CLabel -> Int -> CmmLit
- cmmOffsetLit :: CmmLit -> Int -> CmmLit
- cmmOffsetExpr :: CmmExpr -> CmmExpr -> CmmExpr
- cmmRegOffB :: CmmReg -> ByteOff -> CmmExpr
- cmmOffsetB :: CmmExpr -> ByteOff -> CmmExpr
- cmmLabelOffB :: CLabel -> ByteOff -> CmmLit
- cmmOffsetLitB :: CmmLit -> ByteOff -> CmmLit
- cmmOffsetExprB :: CmmExpr -> CmmExpr -> CmmExpr
- cmmRegOffW :: CmmReg -> WordOff -> CmmExpr
- cmmOffsetW :: CmmExpr -> WordOff -> CmmExpr
- cmmLabelOffW :: CLabel -> WordOff -> CmmLit
- cmmOffsetLitW :: CmmLit -> WordOff -> CmmLit
- cmmOffsetExprW :: CmmExpr -> CmmExpr -> CmmExpr
- cmmIndex :: Width -> CmmExpr -> Int -> CmmExpr
- cmmIndexExpr :: Width -> CmmExpr -> CmmExpr -> CmmExpr
- cmmLoadIndex :: CmmType -> CmmExpr -> Int -> CmmExpr
- cmmLoadIndexW :: CmmExpr -> Int -> CmmType -> CmmExpr
- cmmNegate :: CmmExpr -> CmmExpr
- cmmULtWord :: CmmExpr -> CmmExpr -> CmmExpr
- cmmUGeWord :: CmmExpr -> CmmExpr -> CmmExpr
- cmmUGtWord :: CmmExpr -> CmmExpr -> CmmExpr
- cmmSubWord :: CmmExpr -> CmmExpr -> CmmExpr
- cmmNeWord :: CmmExpr -> CmmExpr -> CmmExpr
- cmmEqWord :: CmmExpr -> CmmExpr -> CmmExpr
- cmmOrWord :: CmmExpr -> CmmExpr -> CmmExpr
- cmmAndWord :: CmmExpr -> CmmExpr -> CmmExpr
- cmmUShrWord :: CmmExpr -> CmmExpr -> CmmExpr
- cmmAddWord :: CmmExpr -> CmmExpr -> CmmExpr
- cmmMulWord :: CmmExpr -> CmmExpr -> CmmExpr
- isTrivialCmmExpr :: CmmExpr -> Bool
- hasNoGlobalRegs :: CmmExpr -> Bool
- blankWord :: CmmStatic
- cmmTagMask :: CmmExpr
- cmmPointerMask :: CmmExpr
- cmmUntag :: CmmExpr -> CmmExpr
- cmmGetTag :: CmmExpr -> CmmExpr
- cmmIsTagged :: CmmExpr -> CmmExpr
- cmmConstrTag :: CmmExpr -> CmmExpr
- cmmConstrTag1 :: CmmExpr -> CmmExpr
- mkLiveness :: [Maybe LocalReg] -> Liveness
- modifyGraph :: (Graph n C C -> Graph n' C C) -> GenCmmGraph n -> GenCmmGraph n'
- lastNode :: CmmBlock -> CmmNode O C
- replaceLastNode :: Block CmmNode e C -> CmmNode O C -> Block CmmNode e C
- insertBetween :: MonadUnique m => CmmBlock -> [CmmNode O O] -> BlockId -> m (CmmBlock, [CmmBlock])
- ofBlockMap :: BlockId -> LabelMap CmmBlock -> CmmGraph
- toBlockMap :: CmmGraph -> LabelMap CmmBlock
- insertBlock :: CmmBlock -> LabelMap CmmBlock -> LabelMap CmmBlock
- ofBlockList :: BlockId -> [CmmBlock] -> CmmGraph
- toBlockList :: CmmGraph -> [CmmBlock]
- bodyToBlockList :: Body CmmNode -> [CmmBlock]
- foldGraphBlocks :: (CmmBlock -> a -> a) -> a -> CmmGraph -> a
- mapGraphNodes :: (CmmNode C O -> CmmNode C O, CmmNode O O -> CmmNode O O, CmmNode O C -> CmmNode O C) -> CmmGraph -> CmmGraph
- postorderDfs :: CmmGraph -> [CmmBlock]
- mapGraphNodes1 :: (forall e x. CmmNode e x -> CmmNode e x) -> CmmGraph -> CmmGraph
- analFwd :: Monad m => DataflowLattice f -> FwdTransfer n f -> FwdPass m n f
- analBwd :: Monad m => DataflowLattice f -> BwdTransfer n f -> BwdPass m n f
- analRewFwd :: Monad m => DataflowLattice f -> FwdTransfer n f -> FwdRewrite m n f -> FwdPass m n f
- analRewBwd :: Monad m => DataflowLattice f -> BwdTransfer n f -> BwdRewrite m n f -> BwdPass m n f
- dataflowPassFwd :: NonLocal n => GenCmmGraph n -> [(BlockId, f)] -> FwdPass FuelUniqSM n f -> FuelUniqSM (GenCmmGraph n, BlockEnv f)
- dataflowPassBwd :: NonLocal n => GenCmmGraph n -> [(BlockId, f)] -> BwdPass FuelUniqSM n f -> FuelUniqSM (GenCmmGraph n, BlockEnv f)

# Documentation

primRepCmmType :: PrimRep -> CmmType

primRepForeignHint :: PrimRep -> ForeignHint

typeCmmType :: Type -> CmmType

typeForeignHint :: Type -> ForeignHint

zeroCLit :: CmmLit

mkIntCLit :: Int -> CmmLit

mkWordCLit :: StgWord -> CmmLit

packHalfWordsCLit :: (Integral a, Integral b) => a -> b -> CmmLit

mkByteStringCLit :: Unique -> [Word8] -> (CmmLit, GenCmmDecl CmmStatics info stmt)

mkDataLits :: Section -> CLabel -> [CmmLit] -> GenCmmDecl CmmStatics info stmt

mkRODataLits :: CLabel -> [CmmLit] -> GenCmmDecl CmmStatics info stmt

mkLblExpr :: CLabel -> CmmExpr

cmmRegOff :: CmmReg -> Int -> CmmExpr

cmmOffset :: CmmExpr -> Int -> CmmExpr

cmmLabelOff :: CLabel -> Int -> CmmLit

cmmOffsetLit :: CmmLit -> Int -> CmmLit

cmmOffsetExpr :: CmmExpr -> CmmExpr -> CmmExpr

cmmRegOffB :: CmmReg -> ByteOff -> CmmExpr

cmmOffsetB :: CmmExpr -> ByteOff -> CmmExpr

cmmLabelOffB :: CLabel -> ByteOff -> CmmLit

cmmOffsetLitB :: CmmLit -> ByteOff -> CmmLit

cmmOffsetExprB :: CmmExpr -> CmmExpr -> CmmExpr

cmmRegOffW :: CmmReg -> WordOff -> CmmExpr

cmmOffsetW :: CmmExpr -> WordOff -> CmmExpr

cmmLabelOffW :: CLabel -> WordOff -> CmmLit

cmmOffsetLitW :: CmmLit -> WordOff -> CmmLit

cmmOffsetExprW :: CmmExpr -> CmmExpr -> CmmExpr

cmmIndex :: Width -> CmmExpr -> Int -> CmmExpr

Useful for creating an index into an array, with a staticaly known offset. The type is the element type; used for making the multiplier

cmmIndexExpr :: Width -> CmmExpr -> CmmExpr -> CmmExpr

Useful for creating an index into an array, with an unknown offset.

cmmLoadIndex :: CmmType -> CmmExpr -> Int -> CmmExpr

cmmLoadIndexW :: CmmExpr -> Int -> CmmType -> CmmExpr

cmmNegate :: CmmExpr -> CmmExpr

cmmULtWord :: CmmExpr -> CmmExpr -> CmmExpr

cmmUGeWord :: CmmExpr -> CmmExpr -> CmmExpr

cmmUGtWord :: CmmExpr -> CmmExpr -> CmmExpr

cmmSubWord :: CmmExpr -> CmmExpr -> CmmExpr

cmmNeWord :: CmmExpr -> CmmExpr -> CmmExpr

cmmEqWord :: CmmExpr -> CmmExpr -> CmmExpr

cmmOrWord :: CmmExpr -> CmmExpr -> CmmExpr

cmmAndWord :: CmmExpr -> CmmExpr -> CmmExpr

cmmUShrWord :: CmmExpr -> CmmExpr -> CmmExpr

cmmAddWord :: CmmExpr -> CmmExpr -> CmmExpr

cmmMulWord :: CmmExpr -> CmmExpr -> CmmExpr

isTrivialCmmExpr :: CmmExpr -> Bool

hasNoGlobalRegs :: CmmExpr -> Bool

blankWord :: CmmStatic

cmmTagMask :: CmmExpr

cmmPointerMask :: CmmExpr

cmmUntag :: CmmExpr -> CmmExpr

cmmGetTag :: CmmExpr -> CmmExpr

cmmIsTagged :: CmmExpr -> CmmExpr

cmmConstrTag :: CmmExpr -> CmmExpr

cmmConstrTag1 :: CmmExpr -> CmmExpr

mkLiveness :: [Maybe LocalReg] -> Liveness

# Operations that probably don't belong here

modifyGraph :: (Graph n C C -> Graph n' C C) -> GenCmmGraph n -> GenCmmGraph n'

lastNode :: CmmBlock -> CmmNode O C

replaceLastNode :: Block CmmNode e C -> CmmNode O C -> Block CmmNode e C

insertBetween :: MonadUnique m => CmmBlock -> [CmmNode O O] -> BlockId -> m (CmmBlock, [CmmBlock])

ofBlockMap :: BlockId -> LabelMap CmmBlock -> CmmGraph

toBlockMap :: CmmGraph -> LabelMap CmmBlock

insertBlock :: CmmBlock -> LabelMap CmmBlock -> LabelMap CmmBlock

ofBlockList :: BlockId -> [CmmBlock] -> CmmGraph

toBlockList :: CmmGraph -> [CmmBlock]

bodyToBlockList :: Body CmmNode -> [CmmBlock]

foldGraphBlocks :: (CmmBlock -> a -> a) -> a -> CmmGraph -> a

mapGraphNodes :: (CmmNode C O -> CmmNode C O, CmmNode O O -> CmmNode O O, CmmNode O C -> CmmNode O C) -> CmmGraph -> CmmGraph

postorderDfs :: CmmGraph -> [CmmBlock]

mapGraphNodes1 :: (forall e x. CmmNode e x -> CmmNode e x) -> CmmGraph -> CmmGraph

analFwd :: Monad m => DataflowLattice f -> FwdTransfer n f -> FwdPass m n f

analBwd :: Monad m => DataflowLattice f -> BwdTransfer n f -> BwdPass m n f

analRewFwd :: Monad m => DataflowLattice f -> FwdTransfer n f -> FwdRewrite m n f -> FwdPass m n f

analRewBwd :: Monad m => DataflowLattice f -> BwdTransfer n f -> BwdRewrite m n f -> BwdPass m n f

dataflowPassFwd :: NonLocal n => GenCmmGraph n -> [(BlockId, f)] -> FwdPass FuelUniqSM n f -> FuelUniqSM (GenCmmGraph n, BlockEnv f)

dataflowPassBwd :: NonLocal n => GenCmmGraph n -> [(BlockId, f)] -> BwdPass FuelUniqSM n f -> FuelUniqSM (GenCmmGraph n, BlockEnv f)