ghc-7.4.2: 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
- class DefinerOfSlots a where
  - foldSlotsDefd :: (b -> SubArea -> b) -> b -> a -> b
- class UserOfSlots a where
  - foldSlotsUsed :: (b -> SubArea -> b) -> b -> a -> b
- type RegSet = UniqSet 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
- regUsedIn :: CmmReg -> CmmExpr -> Bool
- regSlot :: LocalReg -> CmmExpr
- data Area
  - = RegSlot LocalReg
  - | CallArea AreaId
- data AreaId
  - = Old
  - | Young BlockId
- type SubArea = (Area, Int, Int)
- type SubAreaSet = Map Area [SubArea]
- type AreaMap = Map Area Int
- isStackSlotOf :: CmmExpr -> LocalReg -> Bool
- 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 |
PlatformOutputable CmmExpr |
UserOfSlots 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 |
PlatformOutputable CmmLit |

cmmLitType :: CmmLit -> CmmType

data LocalReg

Constructors

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

Instances

Eq LocalReg |
Ord LocalReg |
PlatformOutputable 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) |
DefinerOfLocalRegs (n e x) => DefinerOfLocalRegs (WithRegUsage n 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 (CmmHinted a) |
UserOfLocalRegs i => UserOfLocalRegs (GenBasicBlock i) |
UserOfLocalRegs (CmmNode e x) |
UserOfLocalRegs (n e x) => UserOfLocalRegs (WithRegUsage n e x) |

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

class DefinerOfSlots a where

Methods

foldSlotsDefd :: (b -> SubArea -> b) -> b -> a -> b

Instances

DefinerOfSlots SubArea |
DefinerOfSlots a => DefinerOfSlots [a] |
DefinerOfSlots (CmmNode e x) |

class UserOfSlots a where

Methods

foldSlotsUsed :: (b -> SubArea -> b) -> b -> a -> b

Instances

UserOfSlots CmmExpr |
UserOfSlots ForeignTarget |
UserOfSlots CmmCallTarget |
UserOfSlots a => UserOfSlots [a] |
UserOfSlots a => UserOfSlots (CmmHinted a) |
UserOfSlots (CmmNode e x) |

type RegSet = UniqSet 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

regUsedIn :: CmmReg -> CmmExpr -> Bool

regSlot :: LocalReg -> CmmExpr

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

RegSlot LocalReg |
CallArea AreaId |

Instances

Eq Area |
Ord Area |
Outputable Area |
DefinerOfSlots SubArea |

data AreaId

Constructors

Old |
Young BlockId |

Instances

Eq AreaId |
Ord AreaId |

type SubArea = (Area, Int, Int)

type SubAreaSet = Map Area [SubArea]

type AreaMap = Map Area Int

isStackSlotOf :: CmmExpr -> LocalReg -> Bool

module CmmMachOp

module CmmType