linearscan-hoopl-0.11: 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 :: [((VarId, VarKind), PhysReg)] -> nv e x -> Env (nr e x) Source

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

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

mkRestoreOps :: 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) => 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

-> UseVerifier

Whether to use allocation verifier

-> Label

Label of graph entry block

-> Graph nv C C

Program graph

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