- data BrokenBlock = BrokenBlock {}
- data BlockEntryInfo
- data FinalStmt
- breakBlock :: [BlockId] -> [Unique] -> CmmBasicBlock -> BlockEntryInfo -> ([(BlockId, ContFormat)], [BrokenBlock])
- cmmBlockFromBrokenBlock :: BrokenBlock -> CmmBasicBlock
- blocksToBlockEnv :: [BrokenBlock] -> BlockEnv BrokenBlock
- adaptBlockToFormat :: [(BlockId, ContFormat)] -> Unique -> BrokenBlock -> [BrokenBlock]
- selectContinuations :: [(BlockId, ContFormat)] -> [(BlockId, ContFormat)]
- data ContFormat
- makeContinuationEntries :: [(BlockId, ContFormat)] -> BrokenBlock -> BrokenBlock
Documentation
data BrokenBlock Source
Similar to a CmmBlock
with a little extra information
to help the CPS analysis.
BrokenBlock | |
|
data BlockEntryInfo Source
How a block could be entered See Note [An example of CPS conversion]
FunctionEntry CmmInfo CLabel CmmFormals | Block is the beginning of a function, parameters are: 1. Function header info 2. The function name 3. Aguments to function Only the formal parameters are live |
ContinuationEntry CmmFormals C_SRT Bool | Return point of a function call, parameters are: 1. return values (argument to continuation) 2. SRT for the continuation's info table 3. True = GC block so ignore stack size Live variables, other than the return values, are on the stack |
ControlEntry | Any other kind of block. Only entered due to control flow. |
Final statement in a BlokenBlock
.
Constructors and arguments match those in Cmm
,
but are restricted to branches, returns, jumps, calls and switches
FinalBranch BlockId | Same as |
FinalReturn HintedCmmActuals | Same as |
FinalJump CmmExpr HintedCmmActuals | Same as |
FinalCall BlockId CmmCallTarget HintedCmmFormals HintedCmmActuals C_SRT CmmReturnInfo Bool | Same as |
FinalSwitch CmmExpr [Maybe BlockId] | Same as a |
:: [BlockId] | Any GC blocks that should be special |
-> [Unique] | An infinite list of uniques to create names of the new blocks with |
-> CmmBasicBlock | Input block to break apart |
-> BlockEntryInfo | Info for the first created |
-> ([(BlockId, ContFormat)], [BrokenBlock]) |
Takes a CmmBasicBlock
and breaks it up into a list of BrokenBlock
by splitting on each CmmCall
in the CmmBasicBlock
.
cmmBlockFromBrokenBlock :: BrokenBlock -> CmmBasicBlockSource
Convert from a BrokenBlock back to an equivalent CmmBasicBlock Needed by liveness analysis
blocksToBlockEnv :: [BrokenBlock] -> BlockEnv BrokenBlockSource
Build a mapping so we can lookup a BrokenBlock
by its BlockId
adaptBlockToFormat :: [(BlockId, ContFormat)] -> Unique -> BrokenBlock -> [BrokenBlock]Source
selectContinuations :: [(BlockId, ContFormat)] -> [(BlockId, ContFormat)]Source
data ContFormat Source
makeContinuationEntries :: [(BlockId, ContFormat)] -> BrokenBlock -> BrokenBlockSource