CmmExpr

ghc-8.2.1.20170929: The GHC API

Safe Haskell | None
Language | Haskell2010

CmmExpr

Synopsis

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

# Documentation

data CmmExpr Source #

Constructors

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

Instances

Eq CmmExpr # |
Methods (==) :: CmmExpr -> CmmExpr -> Bool # (/=) :: CmmExpr -> CmmExpr -> Bool #
(Ord r, UserOfRegs r CmmReg) => UserOfRegs r CmmExpr # |
Methods foldRegsUsed :: DynFlags -> (b -> r -> b) -> b -> CmmExpr -> b Source #

cmmExprType :: DynFlags -> CmmExpr -> CmmType Source #

cmmExprWidth :: DynFlags -> CmmExpr -> Width Source #

maybeInvertCmmExpr :: CmmExpr -> Maybe CmmExpr Source #

data CmmReg Source #

Constructors

CmmLocal !LocalReg |
CmmGlobal GlobalReg |

Instances

Eq CmmReg # |
Methods (==) :: CmmReg -> CmmReg -> Bool # (/=) :: CmmReg -> CmmReg -> Bool #
Ord CmmReg # |
Methods compare :: CmmReg -> CmmReg -> Ordering # (<) :: CmmReg -> CmmReg -> Bool # (<=) :: CmmReg -> CmmReg -> Bool # (>) :: CmmReg -> CmmReg -> Bool # (>=) :: CmmReg -> CmmReg -> Bool # max :: CmmReg -> CmmReg -> CmmReg # min :: CmmReg -> CmmReg -> CmmReg #
DefinerOfRegs GlobalReg CmmReg # |
Methods foldRegsDefd :: DynFlags -> (b -> GlobalReg -> b) -> b -> CmmReg -> b Source #
DefinerOfRegs LocalReg CmmReg # |
Methods foldRegsDefd :: DynFlags -> (b -> LocalReg -> b) -> b -> CmmReg -> b Source #
UserOfRegs GlobalReg CmmReg # |
Methods foldRegsUsed :: DynFlags -> (b -> GlobalReg -> b) -> b -> CmmReg -> b Source #
UserOfRegs LocalReg CmmReg # |
Methods foldRegsUsed :: DynFlags -> (b -> LocalReg -> b) -> b -> CmmReg -> b Source #

cmmRegType :: DynFlags -> CmmReg -> CmmType Source #

data CmmLit Source #

Constructors

CmmInt !Integer Width |
CmmFloat Rational Width |
CmmVec [CmmLit] |
CmmLabel CLabel |
CmmLabelOff CLabel Int |
CmmLabelDiffOff CLabel CLabel Int |
CmmBlock !BlockId |
CmmHighStackMark |

Instances

Eq CmmLit # |
Methods (==) :: CmmLit -> CmmLit -> Bool # (/=) :: CmmLit -> CmmLit -> Bool #

cmmLitType :: DynFlags -> CmmLit -> CmmType Source #

data LocalReg Source #

Constructors

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

Instances

Eq LocalReg # |
Methods (==) :: LocalReg -> LocalReg -> Bool # (/=) :: LocalReg -> LocalReg -> Bool #
Ord LocalReg # |
Methods compare :: LocalReg -> LocalReg -> Ordering # (<) :: LocalReg -> LocalReg -> Bool # (<=) :: LocalReg -> LocalReg -> Bool # (>) :: LocalReg -> LocalReg -> Bool # (>=) :: LocalReg -> LocalReg -> Bool # max :: LocalReg -> LocalReg -> LocalReg # min :: LocalReg -> LocalReg -> LocalReg #
Uniquable LocalReg # |
Methods getUnique :: LocalReg -> Unique Source #
DefinerOfRegs LocalReg CmmReg # |
Methods foldRegsDefd :: DynFlags -> (b -> LocalReg -> b) -> b -> CmmReg -> b Source #
UserOfRegs LocalReg CmmReg # |
Methods foldRegsUsed :: DynFlags -> (b -> LocalReg -> b) -> b -> CmmReg -> b Source #
DefinerOfRegs LocalReg (CmmNode e x) # |
Methods foldRegsDefd :: DynFlags -> (b -> LocalReg -> b) -> b -> CmmNode e x -> b Source #
UserOfRegs LocalReg (CmmNode e x) # |
Methods foldRegsUsed :: DynFlags -> (b -> LocalReg -> b) -> b -> CmmNode e x -> b Source #

localRegType :: LocalReg -> CmmType Source #

data GlobalReg Source #

Constructors

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

Instances

Eq GlobalReg # |
Methods (==) :: GlobalReg -> GlobalReg -> Bool # (/=) :: GlobalReg -> GlobalReg -> Bool #
Ord GlobalReg # |
Methods compare :: GlobalReg -> GlobalReg -> Ordering # (<) :: GlobalReg -> GlobalReg -> Bool # (<=) :: GlobalReg -> GlobalReg -> Bool # (>) :: GlobalReg -> GlobalReg -> Bool # (>=) :: GlobalReg -> GlobalReg -> Bool # max :: GlobalReg -> GlobalReg -> GlobalReg # min :: GlobalReg -> GlobalReg -> GlobalReg #
Show GlobalReg # |
Methods showsPrec :: Int -> GlobalReg -> ShowS Source # show :: GlobalReg -> String Source # showList :: [GlobalReg] -> ShowS Source #
DefinerOfRegs GlobalReg CmmReg # |
Methods foldRegsDefd :: DynFlags -> (b -> GlobalReg -> b) -> b -> CmmReg -> b Source #
UserOfRegs GlobalReg CmmReg # |
Methods foldRegsUsed :: DynFlags -> (b -> GlobalReg -> b) -> b -> CmmReg -> b Source #
DefinerOfRegs GlobalReg (CmmNode e x) # |
Methods foldRegsDefd :: DynFlags -> (b -> GlobalReg -> b) -> b -> CmmNode e x -> b Source #
UserOfRegs GlobalReg (CmmNode e x) # |
Methods foldRegsUsed :: DynFlags -> (b -> GlobalReg -> b) -> b -> CmmNode e x -> b Source #

isArgReg :: GlobalReg -> Bool Source #

globalRegType :: DynFlags -> GlobalReg -> CmmType Source #

spReg :: CmmReg Source #

hpReg :: CmmReg Source #

spLimReg :: CmmReg Source #

nodeReg :: CmmReg Source #

node :: GlobalReg Source #

baseReg :: CmmReg Source #

data VGcPtr Source #

Constructors

VGcPtr |
VNonGcPtr |

Instances

Eq VGcPtr # |
Methods (==) :: VGcPtr -> VGcPtr -> Bool # (/=) :: VGcPtr -> VGcPtr -> Bool #
Show VGcPtr # |
Methods showsPrec :: Int -> VGcPtr -> ShowS Source # show :: VGcPtr -> String Source # showList :: [VGcPtr] -> ShowS Source #

class Ord r => DefinerOfRegs r a where Source #

Minimal complete definition

foldRegsDefd

Methods

foldRegsDefd :: DynFlags -> (b -> r -> b) -> b -> a -> b Source #

Instances

Ord r => DefinerOfRegs r r # |
Methods foldRegsDefd :: DynFlags -> (b -> r -> b) -> b -> r -> b Source #
DefinerOfRegs GlobalReg CmmReg # |
Methods foldRegsDefd :: DynFlags -> (b -> GlobalReg -> b) -> b -> CmmReg -> b Source #
DefinerOfRegs LocalReg CmmReg # |
Methods foldRegsDefd :: DynFlags -> (b -> LocalReg -> b) -> b -> CmmReg -> b Source #
DefinerOfRegs r a => DefinerOfRegs r [a] # |
Methods foldRegsDefd :: DynFlags -> (b -> r -> b) -> b -> [a] -> b Source #
DefinerOfRegs GlobalReg (CmmNode e x) # |
Methods foldRegsDefd :: DynFlags -> (b -> GlobalReg -> b) -> b -> CmmNode e x -> b Source #
DefinerOfRegs LocalReg (CmmNode e x) # |
Methods foldRegsDefd :: DynFlags -> (b -> LocalReg -> b) -> b -> CmmNode e x -> b Source #

class Ord r => UserOfRegs r a where Source #

Minimal complete definition

foldRegsUsed

Methods

foldRegsUsed :: DynFlags -> (b -> r -> b) -> b -> a -> b Source #

Instances

(Ord r, UserOfRegs r CmmReg) => UserOfRegs r CmmExpr # |
Methods foldRegsUsed :: DynFlags -> (b -> r -> b) -> b -> CmmExpr -> b Source #
Ord r => UserOfRegs r r # |
Methods foldRegsUsed :: DynFlags -> (b -> r -> b) -> b -> r -> b Source #
(Ord r, UserOfRegs r CmmReg) => UserOfRegs r ForeignTarget # |
Methods foldRegsUsed :: DynFlags -> (b -> r -> b) -> b -> ForeignTarget -> b Source #
UserOfRegs GlobalReg CmmReg # |
Methods foldRegsUsed :: DynFlags -> (b -> GlobalReg -> b) -> b -> CmmReg -> b Source #
UserOfRegs LocalReg CmmReg # |
Methods foldRegsUsed :: DynFlags -> (b -> LocalReg -> b) -> b -> CmmReg -> b Source #
UserOfRegs r a => UserOfRegs r [a] # |
Methods foldRegsUsed :: DynFlags -> (b -> r -> b) -> b -> [a] -> b Source #
UserOfRegs GlobalReg (CmmNode e x) # |
Methods foldRegsUsed :: DynFlags -> (b -> GlobalReg -> b) -> b -> CmmNode e x -> b Source #
UserOfRegs LocalReg (CmmNode e x) # |
Methods foldRegsUsed :: DynFlags -> (b -> LocalReg -> b) -> b -> CmmNode e x -> b Source #

foldRegsDefd :: DefinerOfRegs r a => DynFlags -> (b -> r -> b) -> b -> a -> b Source #

foldRegsUsed :: UserOfRegs r a => DynFlags -> (b -> r -> b) -> b -> a -> b Source #

foldLocalRegsDefd :: DefinerOfRegs LocalReg a => DynFlags -> (b -> LocalReg -> b) -> b -> a -> b Source #

foldLocalRegsUsed :: UserOfRegs LocalReg a => DynFlags -> (b -> LocalReg -> b) -> b -> a -> b Source #

type RegSet r = Set r Source #

Sets of registers

type LocalRegSet = RegSet LocalReg Source #

type GlobalRegSet = RegSet GlobalReg Source #

emptyRegSet :: RegSet r Source #

elemRegSet :: Ord r => r -> RegSet r -> Bool Source #

extendRegSet :: Ord r => RegSet r -> r -> RegSet r Source #

deleteFromRegSet :: Ord r => RegSet r -> r -> RegSet r Source #

mkRegSet :: Ord r => [r] -> RegSet r Source #

plusRegSet :: Ord r => RegSet r -> RegSet r -> RegSet r Source #

minusRegSet :: Ord r => RegSet r -> RegSet r -> RegSet r Source #

timesRegSet :: Ord r => RegSet r -> RegSet r -> RegSet r Source #

sizeRegSet :: RegSet r -> Int Source #

nullRegSet :: RegSet r -> Bool Source #

regSetToList :: RegSet r -> [r] Source #

data Area Source #

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 # |
Methods (==) :: Area -> Area -> Bool # (/=) :: Area -> Area -> Bool #
Ord Area # |
Methods compare :: Area -> Area -> Ordering # (<) :: Area -> Area -> Bool # (<=) :: Area -> Area -> Bool # (>) :: Area -> Area -> Bool # (>=) :: Area -> Area -> Bool # max :: Area -> Area -> Area # min :: Area -> Area -> Area #

module CmmMachOp

module CmmType