CmmExpr

ghc-7.6.3: The GHC API

Safe Haskell | None

CmmExpr

Synopsis

- data CmmExpr
  - = CmmLit CmmLit
  - | CmmLoad !CmmExpr !CmmType
  - | CmmReg !CmmReg
  - | CmmMachOp MachOp [CmmExpr]
  - | CmmStackSlot Area !Int
  - | CmmRegOff !CmmReg Int
- cmmExprType :: CmmExpr -> CmmType
- cmmExprWidth :: CmmExpr -> Width
- maybeInvertCmmExpr :: CmmExpr -> Maybe CmmExpr
- data CmmReg
  - = CmmLocal !LocalReg
  - | CmmGlobal GlobalReg
- cmmRegType :: CmmReg -> CmmType
- data CmmLit
  - = CmmInt !Integer Width
  - | CmmFloat Rational Width
  - | CmmLabel CLabel
  - | CmmLabelOff CLabel Int
  - | CmmLabelDiffOff CLabel CLabel Int
  - | CmmBlock !BlockId
  - | CmmHighStackMark
- cmmLitType :: CmmLit -> CmmType
- data LocalReg = LocalReg !Unique CmmType
- localRegType :: LocalReg -> CmmType
- data GlobalReg
  - = VanillaReg !Int VGcPtr
  - | FloatReg !Int
  - | DoubleReg !Int
  - | LongReg !Int
  - | Sp
  - | SpLim
  - | Hp
  - | HpLim
  - | CCCS
  - | CurrentTSO
  - | CurrentNursery
  - | HpAlloc
  - | EagerBlackholeInfo
  - | GCEnter1
  - | GCFun
  - | BaseReg
  - | PicBaseReg
- globalRegType :: GlobalReg -> CmmType
- spReg :: CmmReg
- hpReg :: CmmReg
- spLimReg :: CmmReg
- nodeReg :: CmmReg
- node :: GlobalReg
- baseReg :: CmmReg
- data VGcPtr
  - = VGcPtr
  - | VNonGcPtr
- vgcFlag :: CmmType -> VGcPtr
- class DefinerOfLocalRegs a where
  - foldRegsDefd :: (b -> LocalReg -> b) -> b -> a -> b
- class UserOfLocalRegs a where
  - foldRegsUsed :: (b -> LocalReg -> b) -> b -> a -> b
- filterRegsUsed :: UserOfLocalRegs e => (LocalReg -> Bool) -> e -> RegSet
- type RegSet = Set LocalReg
- emptyRegSet :: RegSet
- elemRegSet :: LocalReg -> RegSet -> Bool
- extendRegSet :: RegSet -> LocalReg -> RegSet
- deleteFromRegSet :: RegSet -> LocalReg -> RegSet
- mkRegSet :: [LocalReg] -> RegSet
- plusRegSet :: RegSet -> RegSet -> RegSet
- minusRegSet :: RegSet -> RegSet -> RegSet
- timesRegSet :: RegSet -> RegSet -> RegSet
- sizeRegSet :: RegSet -> Int
- nullRegSet :: RegSet -> Bool
- regSetToList :: RegSet -> [LocalReg]
- regUsedIn :: CmmReg -> CmmExpr -> Bool
- data Area
  - = Old
  - | Young !BlockId
- module CmmMachOp
- module CmmType

# Documentation

data CmmExpr

Constructors

CmmLit CmmLit |
CmmLoad !CmmExpr !CmmType |
CmmReg !CmmReg |
CmmMachOp MachOp [CmmExpr] |
CmmStackSlot Area !Int |
CmmRegOff !CmmReg Int |

Instances

Eq CmmExpr |
Outputable CmmExpr |
UserOfLocalRegs CmmExpr |

cmmExprType :: CmmExpr -> CmmType

cmmExprWidth :: CmmExpr -> Width

maybeInvertCmmExpr :: CmmExpr -> Maybe CmmExpr

data CmmReg

Constructors

CmmLocal !LocalReg |
CmmGlobal GlobalReg |

Instances

Eq CmmReg |
Ord CmmReg |
Outputable CmmReg |
DefinerOfLocalRegs CmmReg |
UserOfLocalRegs CmmReg |

cmmRegType :: CmmReg -> CmmType

data CmmLit

Constructors

CmmInt !Integer Width |
CmmFloat Rational Width |
CmmLabel CLabel |
CmmLabelOff CLabel Int |
CmmLabelDiffOff CLabel CLabel Int |
CmmBlock !BlockId |
CmmHighStackMark |

Instances

Eq CmmLit |
Outputable CmmLit |

cmmLitType :: CmmLit -> CmmType

data LocalReg

Constructors

LocalReg !Unique CmmType | Parameters: 1. Identifier 2. Type

Instances

Eq LocalReg |
Ord LocalReg |
Outputable LocalReg |
Uniquable LocalReg |
DefinerOfLocalRegs LocalReg |
UserOfLocalRegs RegSet |
UserOfLocalRegs LocalReg |

localRegType :: LocalReg -> CmmType

data GlobalReg

Constructors

VanillaReg !Int VGcPtr |
FloatReg !Int |
DoubleReg !Int |
LongReg !Int |
Sp |
SpLim |
Hp |
HpLim |
CCCS |
CurrentTSO |
CurrentNursery |
HpAlloc |
EagerBlackholeInfo |
GCEnter1 |
GCFun |
BaseReg |
PicBaseReg |

Instances

Eq GlobalReg |
Ord GlobalReg |
Show GlobalReg |
Outputable GlobalReg |

globalRegType :: GlobalReg -> CmmType

spReg :: CmmReg

hpReg :: CmmReg

spLimReg :: CmmReg

nodeReg :: CmmReg

node :: GlobalReg

baseReg :: CmmReg

data VGcPtr

Constructors

VGcPtr |
VNonGcPtr |

Instances

Eq VGcPtr |
Show VGcPtr |

vgcFlag :: CmmType -> VGcPtr

class DefinerOfLocalRegs a where

Methods

foldRegsDefd :: (b -> LocalReg -> b) -> b -> a -> b

Instances

DefinerOfLocalRegs LocalReg |
DefinerOfLocalRegs CmmReg |
DefinerOfLocalRegs a => DefinerOfLocalRegs [a] |
DefinerOfLocalRegs a => DefinerOfLocalRegs (Maybe a) |
DefinerOfLocalRegs a => DefinerOfLocalRegs (CmmHinted a) |
DefinerOfLocalRegs (CmmNode e x) |

class UserOfLocalRegs a where

Methods

foldRegsUsed :: (b -> LocalReg -> b) -> b -> a -> b

Instances

UserOfLocalRegs RegSet |
UserOfLocalRegs LocalReg |
UserOfLocalRegs CmmReg |
UserOfLocalRegs CmmExpr |
UserOfLocalRegs ForeignTarget |
UserOfLocalRegs CmmCallTarget |
UserOfLocalRegs CmmStmt | enable us to fold used registers over '[CmmActual]' and '[CmmFormal]'
UserOfLocalRegs a => UserOfLocalRegs [a] |
UserOfLocalRegs a => UserOfLocalRegs (Maybe a) |
UserOfLocalRegs a => UserOfLocalRegs (CmmHinted a) |
UserOfLocalRegs i => UserOfLocalRegs (GenBasicBlock i) |
UserOfLocalRegs (CmmNode e x) |

filterRegsUsed :: UserOfLocalRegs e => (LocalReg -> Bool) -> e -> RegSet

type RegSet = Set LocalReg

Sets of local registers

emptyRegSet :: RegSet

elemRegSet :: LocalReg -> RegSet -> Bool

extendRegSet :: RegSet -> LocalReg -> RegSet

deleteFromRegSet :: RegSet -> LocalReg -> RegSet

mkRegSet :: [LocalReg] -> RegSet

plusRegSet :: RegSet -> RegSet -> RegSet

minusRegSet :: RegSet -> RegSet -> RegSet

timesRegSet :: RegSet -> RegSet -> RegSet

sizeRegSet :: RegSet -> Int

nullRegSet :: RegSet -> Bool

regSetToList :: RegSet -> [LocalReg]

regUsedIn :: CmmReg -> CmmExpr -> Bool

data Area

A stack area is either the stack slot where a variable is spilled or the stack space where function arguments and results are passed.

Constructors

Old |
Young !BlockId |

Instances

Eq Area |
Ord Area |
Outputable Area |

module CmmMachOp

module CmmType