| ghc-6.10.4: The GHC API | Contents | Index

MkZipCfgCmm

Synopsis

mkNop :: CmmAGraph
mkAssign :: CmmReg -> CmmExpr -> CmmAGraph
mkStore :: CmmExpr -> CmmExpr -> CmmAGraph
mkCall :: CmmExpr -> CCallConv -> CmmFormals -> CmmActuals -> C_SRT -> CmmAGraph
mkCmmCall :: CmmExpr -> CmmFormals -> CmmActuals -> C_SRT -> CmmAGraph
mkUnsafeCall :: CmmCallTarget -> CmmFormals -> CmmActuals -> CmmAGraph
mkFinalCall :: CmmExpr -> CCallConv -> CmmActuals -> CmmAGraph
mkJump :: Area -> CmmExpr -> CmmActuals -> CmmAGraph
mkCbranch :: CmmExpr -> BlockId -> BlockId -> CmmAGraph
mkSwitch :: CmmExpr -> [Maybe BlockId] -> CmmAGraph
mkReturn :: Area -> CmmActuals -> CmmAGraph
mkComment :: FastString -> CmmAGraph
copyIn :: Convention -> Area -> CmmFormals -> [Middle]
copyOut :: Convention -> Area -> CmmActuals -> [Middle]
mkEntry :: Area -> Convention -> CmmFormalsWithoutKinds -> [Middle]
mkCmmIfThenElse :: CmmExpr -> CmmAGraph -> CmmAGraph -> CmmAGraph
mkCmmIfThen :: CmmExpr -> CmmAGraph -> CmmAGraph
mkCmmWhileDo :: CmmExpr -> CmmAGraph -> CmmAGraph
mkAddToContext :: CmmExpr -> [CmmExpr] -> CmmAGraph
(<*>) :: AGraph m l -> AGraph m l -> AGraph m l
catAGraphs :: [AGraph m l] -> AGraph m l
mkLabel :: LastNode l => BlockId -> AGraph m l
mkBranch :: (Outputable m, Outputable l, LastNode l) => BlockId -> AGraph m l
emptyAGraph :: AGraph m l
withFreshLabel :: String -> (BlockId -> AGraph m l) -> AGraph m l
withUnique :: (Unique -> AGraph m l) -> AGraph m l
outOfLine :: (LastNode l, Outputable m, Outputable l) => AGraph m l -> AGraph m l
lgraphOfAGraph :: AGraph m l -> UniqSM (LGraph m l)
graphOfAGraph :: AGraph m l -> UniqSM (Graph m l)
labelAGraph :: BlockId -> AGraph m l -> UniqSM (LGraph m l)
type CmmZ = GenCmm CmmStatic CmmInfo CmmGraph
type CmmTopZ = GenCmmTop CmmStatic CmmInfo CmmGraph
type CmmGraph = LGraph Middle Last
type CmmBlock = Block Middle Last
type CmmAGraph = AGraph Middle Last
data Middle
data Last

data Convention

= ConventionStandard CCallConv ValueDirection
| ConventionPrivate

Documentation
mkNop :: CmmAGraph
mkAssign :: CmmReg -> CmmExpr -> CmmAGraph
mkStore :: CmmExpr -> CmmExpr -> CmmAGraph
mkCall :: CmmExpr -> CCallConv -> CmmFormals -> CmmActuals -> C_SRT -> CmmAGraph
mkCmmCall :: CmmExpr -> CmmFormals -> CmmActuals -> C_SRT -> CmmAGraph
mkUnsafeCall :: CmmCallTarget -> CmmFormals -> CmmActuals -> CmmAGraph
mkFinalCall :: CmmExpr -> CCallConv -> CmmActuals -> CmmAGraph
mkJump :: Area -> CmmExpr -> CmmActuals -> CmmAGraph
mkCbranch :: CmmExpr -> BlockId -> BlockId -> CmmAGraph
mkSwitch :: CmmExpr -> [Maybe BlockId] -> CmmAGraph
mkReturn :: Area -> CmmActuals -> CmmAGraph
mkComment :: FastString -> CmmAGraph
copyIn :: Convention -> Area -> CmmFormals -> [Middle]
copyOut :: Convention -> Area -> CmmActuals -> [Middle]
mkEntry :: Area -> Convention -> CmmFormalsWithoutKinds -> [Middle]
mkCmmIfThenElse :: CmmExpr -> CmmAGraph -> CmmAGraph -> CmmAGraph
mkCmmIfThen :: CmmExpr -> CmmAGraph -> CmmAGraph
mkCmmWhileDo :: CmmExpr -> CmmAGraph -> CmmAGraph
mkAddToContext :: CmmExpr -> [CmmExpr] -> CmmAGraph
(<*>) :: AGraph m l -> AGraph m l -> AGraph m l
catAGraphs :: [AGraph m l] -> AGraph m l
mkLabel :: LastNode l => BlockId -> AGraph m l
mkBranch :: (Outputable m, Outputable l, LastNode l) => BlockId -> AGraph m l
emptyAGraph :: AGraph m l
A graph is built up by splicing together graphs each containing a single node (where a label is considered a first node. The empty graph is a left and right unit for splicing. All of the AGraph constructors (even complex ones like `mkIfThenElse`, as well as the splicing operation *, are constant-time operations.
withFreshLabel :: String -> (BlockId -> AGraph m l) -> AGraph m l
This function provides access to fresh labels without requiring clients to be programmed monadically.
withUnique :: (Unique -> AGraph m l) -> AGraph m l
outOfLine :: (LastNode l, Outputable m, Outputable l) => AGraph m l -> AGraph m l

The argument is an AGraph that has an empty entry sequence and no exit sequence. The result is a new AGraph that has an empty entry sequence connected to an empty exit sequence, with the original graph sitting to the side out-of-line.

Example: mkMiddle (x = 3) *> outOfLine (mkLabel L <* ...stuff...) * mkMiddle (y = x) Control will flow directly from x=3 to y=x; the block starting with L is on the side.

N.B. algebraically forall g g' : g *> outOfLine g' == outOfLine g' <* g

lgraphOfAGraph

:: |
=> AGraph m l |
-> UniqSM (LGraph m l) | allocate a fresh label for the entry point

graphOfAGraph :: AGraph m l -> UniqSM (Graph m l)
Converting an abstract graph to a concrete form is expensive: the cost is linear in the number of nodes in the answer, plus N log N in the number of basic blocks. The conversion is also monadic because it may require the allocation of fresh, unique labels.
labelAGraph

:: |
=> BlockId |
-> AGraph m l |
-> UniqSM (LGraph m l) | use the given BlockId as the label of the entry point

type CmmZ = GenCmm CmmStatic CmmInfo CmmGraph
type CmmTopZ = GenCmmTop CmmStatic CmmInfo CmmGraph
type CmmGraph = LGraph Middle Last
type CmmBlock = Block Middle Last
type CmmAGraph = AGraph Middle Last
data Middle

Instances

Eq Middle
Outputable Middle
DefinerOfLocalRegs Middle
UserOfLocalRegs Middle
DebugNodes Middle Last

data Last

Instances

Outputable Last
DefinerOfLocalRegs Last
UserOfLocalRegs Last
LastNode Last
HavingSuccessors Last
DebugNodes Middle Last
Outputable m => DebugNodes (ExtendWithSpills m) Last

data Convention

Constructors

ConventionStandard CCallConv ValueDirection |
ConventionPrivate |

Instances

Eq Convention
Outputable Convention

Produced by Haddock version 2.4.2