linearscan-hoopl-0.6.0.0: Makes it easy to use the linearscan register allocator with Hoopl

Safe HaskellNone
LanguageHaskell2010

LinearScan.Hoopl

Documentation

class HooplNode nv => NodeAlloc nv nr | nv -> nr, nr -> nv where Source

Methods

isCall :: nv O O -> Bool Source

isBranch :: nv O C -> Bool Source

retargetBranch :: nv O C -> Label -> Label -> nv O C Source

mkLabelOp :: Label -> nv C O Source

mkJumpOp :: Label -> nv O C Source

getReferences :: nv e x -> [VarInfo] Source

setRegisters :: [(Int, PhysReg)] -> nv e x -> Env (nr e x) Source

mkMoveOps :: PhysReg -> PhysReg -> Env [nr O O] Source

mkSwapOps :: PhysReg -> PhysReg -> Env [nr O O] Source

mkSaveOps :: PhysReg -> Maybe VarId -> Env [nr O O] Source

mkRestoreOps :: Maybe VarId -> PhysReg -> Env [nr O O] Source

op1ToString :: nv e x -> String Source

data NodeV n Source

Constructors

NodeCO 

Fields

getNodeCO :: n C O
 
NodeOO 

Fields

getNodeOO :: n O O
 
NodeOC 

Fields

getNodeOC :: n O C
 

blockInfo :: (NodeAlloc nv nr, NonLocal nv, NonLocal nr) => (Label -> Env Int) -> BlockInfo Env (Block nv C C) (Block nr C C) (NodeV nv) (NodeV nr) Source

opInfo :: NodeAlloc nv nr => OpInfo Env (NodeV nv) (NodeV nr) Source

allocateHoopl Source

Arguments

:: (NodeAlloc nv nr, NonLocal nv, NonLocal nr) 
=> Int

Number of machine registers

-> Int

Offset of the spill stack

-> Int

Size of spilled register in bytes

-> Label

Label of graph entry block

-> Graph nv C C

Program graph

-> Either [String] (Graph nr C C)