CmmUtils

ghc-7.6.3: The GHC API

Safe Haskell | None

CmmUtils

Contents

- Operations that probably don't belong here

Synopsis

- primRepCmmType :: PrimRep -> CmmType
- primRepForeignHint :: PrimRep -> ForeignHint
- typeCmmType :: UnaryType -> CmmType
- typeForeignHint :: UnaryType -> 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
- cmmQuotWord :: 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 :: Block n x C -> n O C
- replaceLastNode :: Block n x C -> n O C -> Block n x C
- ofBlockMap :: BlockId -> BlockEnv CmmBlock -> CmmGraph
- toBlockMap :: CmmGraph -> BlockEnv CmmBlock
- insertBlock :: CmmBlock -> BlockEnv CmmBlock -> BlockEnv 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 :: DataflowLattice f -> FwdTransfer n f -> FwdPass UniqSM n f
- analBwd :: DataflowLattice f -> BwdTransfer n f -> BwdPass UniqSM n f
- analRewFwd :: DataflowLattice f -> FwdTransfer n f -> FwdRewrite UniqSM n f -> FwdPass UniqSM n f
- analRewBwd :: DataflowLattice f -> BwdTransfer n f -> BwdRewrite UniqSM n f -> BwdPass UniqSM n f
- dataflowPassFwd :: NonLocal n => GenCmmGraph n -> [(BlockId, f)] -> FwdPass UniqSM n f -> UniqSM (GenCmmGraph n, BlockEnv f)
- dataflowPassBwd :: NonLocal n => GenCmmGraph n -> [(BlockId, f)] -> BwdPass UniqSM n f -> UniqSM (GenCmmGraph n, BlockEnv f)
- dataflowAnalFwd :: NonLocal n => GenCmmGraph n -> [(BlockId, f)] -> FwdPass UniqSM n f -> BlockEnv f
- dataflowAnalBwd :: NonLocal n => GenCmmGraph n -> [(BlockId, f)] -> BwdPass UniqSM n f -> BlockEnv f
- dataflowAnalFwdBlocks :: NonLocal n => GenCmmGraph n -> [(BlockId, f)] -> FwdPass UniqSM n f -> UniqSM (BlockEnv f)

# Documentation

primRepCmmType :: PrimRep -> CmmType

primRepForeignHint :: PrimRep -> ForeignHint

typeCmmType :: UnaryType -> CmmType

typeForeignHint :: UnaryType -> 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

cmmQuotWord :: 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 :: Block n x C -> n O C Source

replaceLastNode :: Block n x C -> n O C -> Block n x C Source

ofBlockMap :: BlockId -> BlockEnv CmmBlock -> CmmGraph

toBlockMap :: CmmGraph -> BlockEnv CmmBlock

insertBlock :: CmmBlock -> BlockEnv CmmBlock -> BlockEnv 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 :: DataflowLattice f -> FwdTransfer n f -> FwdPass UniqSM n f

analBwd :: DataflowLattice f -> BwdTransfer n f -> BwdPass UniqSM n f

analRewFwd :: DataflowLattice f -> FwdTransfer n f -> FwdRewrite UniqSM n f -> FwdPass UniqSM n f

analRewBwd :: DataflowLattice f -> BwdTransfer n f -> BwdRewrite UniqSM n f -> BwdPass UniqSM n f

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

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

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

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

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