Documentation ¶
Index ¶
- Variables
- type BasicBlock
- type BlockMerge
- type BranchElim
- type CFG
- type CSE
- type ConstProp
- type CopyElim
- type DominatorTree
- type Int65
- type IrAMD64_ADDQ
- type IrAMD64_ANDQ
- type IrAMD64_BSWAP
- type IrAMD64_BTSQ
- type IrAMD64_CMPQ_eq
- type IrAMD64_CMPQ_geu
- type IrAMD64_CMPQ_lt
- type IrAMD64_CMPQ_ltu
- type IrAMD64_CMPQ_ne
- type IrAMD64_IMULQ
- type IrAMD64_INT
- type IrAMD64_JE_imm
- type IrAMD64_JMP
- type IrAMD64_LEA
- type IrAMD64_MOVBE_load
- type IrAMD64_MOVBE_store
- type IrAMD64_MOVSLQ
- type IrAMD64_MOV_abs
- type IrAMD64_MOV_load
- type IrAMD64_MOV_ptr
- type IrAMD64_MOV_reg
- type IrAMD64_MOV_store
- type IrAMD64_NEG
- type IrAMD64_ORQ
- type IrAMD64_SHRQ
- type IrAMD64_SUBQ
- type IrAMD64_XORQ
- type IrBinaryExpr
- type IrBinaryOp
- type IrBitTestSet
- type IrBreakpoint
- type IrCall
- type IrConstInt
- type IrConstPtr
- type IrDefinations
- type IrLEA
- type IrLoad
- type IrLoadArg
- type IrNode
- type IrPhi
- type IrReceiver
- type IrReturn
- type IrStore
- type IrSuccessors
- type IrSwitch
- type IrTerminator
- type IrUnaryExpr
- type IrUnaryOp
- type IrUsages
- type IrWriteBarrier
- type Lowering
- type Mem
- type Pass
- type PassDescriptor
- type PhiElim
- type Reg
- type TDCE
- type WriteBarrier
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MinInt65 = Int65{0, 1} MaxInt65 = Int65{math.MaxUint64, 0} )
View Source
var ArchRegNames = map[x86_64.Register64]string{ x86_64.RAX: "rax", x86_64.RCX: "rcx", x86_64.RDX: "rdx", x86_64.RBX: "rbx", x86_64.RSP: "rsp", x86_64.RBP: "rbp", x86_64.RSI: "rsi", x86_64.RDI: "rdi", x86_64.R8: "r8", x86_64.R9: "r9", x86_64.R10: "r10", x86_64.R11: "r11", x86_64.R12: "r12", x86_64.R13: "r13", x86_64.R14: "r14", x86_64.R15: "r15", }
View Source
var ArchRegs = [...]x86_64.Register64{ x86_64.RAX, x86_64.RCX, x86_64.RDX, x86_64.RBX, x86_64.RSP, x86_64.RBP, x86_64.RSI, x86_64.RDI, x86_64.R8, x86_64.R9, x86_64.R10, x86_64.R11, x86_64.R12, x86_64.R13, x86_64.R14, x86_64.R15, }
View Source
var Passes = [...]PassDescriptor{ {Desc: "Constant Propagation", Pass: new(ConstProp)}, {Desc: "Common Sub-expression Elimination", Pass: new(CSE)}, {Desc: "Early Phi Elimination", Pass: new(PhiElim)}, {Desc: "Early Copy Elimination", Pass: new(CopyElim)}, {Desc: "Early Trivial Dead Code Elimination", Pass: new(TDCE)}, {Desc: "Branch Elimination", Pass: new(BranchElim)}, {Desc: "Late Phi Elimination", Pass: new(PhiElim)}, {Desc: "Late Copy Elimination", Pass: new(CopyElim)}, {Desc: "Late Trivial Dead Code Elimination", Pass: new(TDCE)}, {Desc: "Intermediate Block Merging", Pass: new(BlockMerge)}, }
Functions ¶
This section is empty.
Types ¶
type BasicBlock ¶
type BasicBlock struct { Id int Phi []*IrPhi Ins []IrNode Pred []*BasicBlock Term IrTerminator }
func Unreachable ¶
func Unreachable(bb *BasicBlock, id int) (ret *BasicBlock)
type BlockMerge ¶
type BlockMerge struct{}
BlockMerge merges redundant intermediate blocks (blocks with a single outgoing edge which goes to another block with a single incoming edge).
func (BlockMerge) Apply ¶
func (BlockMerge) Apply(cfg *CFG)
type BranchElim ¶
type BranchElim struct{}
BranchElim removes branches that can be proved unreachable.
func (BranchElim) Apply ¶
func (self BranchElim) Apply(cfg *CFG)
type CFG ¶
type CFG struct {
DominatorTree
}
func (*CFG) PostOrder ¶
func (self *CFG) PostOrder(action func(bb *BasicBlock))
func (*CFG) ReversePostOrder ¶
func (self *CFG) ReversePostOrder(action func(bb *BasicBlock))
type DominatorTree ¶
type DominatorTree struct { Root *BasicBlock DominatedBy map[int]*BasicBlock DominatorOf map[int][]*BasicBlock DominanceFrontier map[int][]*BasicBlock }
type Int65 ¶
type Int65 struct {
// contains filtered or unexported fields
}
func (Int65) CompareZero ¶
type IrAMD64_ADDQ ¶
func (*IrAMD64_ADDQ) Definations ¶
func (self *IrAMD64_ADDQ) Definations() []*Reg
func (*IrAMD64_ADDQ) String ¶
func (self *IrAMD64_ADDQ) String() string
func (*IrAMD64_ADDQ) Usages ¶
func (self *IrAMD64_ADDQ) Usages() []*Reg
type IrAMD64_ANDQ ¶
func (*IrAMD64_ANDQ) Definations ¶
func (self *IrAMD64_ANDQ) Definations() []*Reg
func (*IrAMD64_ANDQ) String ¶
func (self *IrAMD64_ANDQ) String() string
func (*IrAMD64_ANDQ) Usages ¶
func (self *IrAMD64_ANDQ) Usages() []*Reg
type IrAMD64_BSWAP ¶
func (*IrAMD64_BSWAP) Definations ¶
func (self *IrAMD64_BSWAP) Definations() []*Reg
func (*IrAMD64_BSWAP) String ¶
func (self *IrAMD64_BSWAP) String() string
func (*IrAMD64_BSWAP) Usages ¶
func (self *IrAMD64_BSWAP) Usages() []*Reg
type IrAMD64_BTSQ ¶
func (*IrAMD64_BTSQ) Definations ¶
func (self *IrAMD64_BTSQ) Definations() []*Reg
func (*IrAMD64_BTSQ) String ¶
func (self *IrAMD64_BTSQ) String() string
func (*IrAMD64_BTSQ) Usages ¶
func (self *IrAMD64_BTSQ) Usages() []*Reg
type IrAMD64_CMPQ_eq ¶
func (*IrAMD64_CMPQ_eq) Definations ¶
func (self *IrAMD64_CMPQ_eq) Definations() []*Reg
func (*IrAMD64_CMPQ_eq) String ¶
func (self *IrAMD64_CMPQ_eq) String() string
func (*IrAMD64_CMPQ_eq) Usages ¶
func (self *IrAMD64_CMPQ_eq) Usages() []*Reg
type IrAMD64_CMPQ_geu ¶
func (*IrAMD64_CMPQ_geu) Definations ¶
func (self *IrAMD64_CMPQ_geu) Definations() []*Reg
func (*IrAMD64_CMPQ_geu) String ¶
func (self *IrAMD64_CMPQ_geu) String() string
func (*IrAMD64_CMPQ_geu) Usages ¶
func (self *IrAMD64_CMPQ_geu) Usages() []*Reg
type IrAMD64_CMPQ_lt ¶
func (*IrAMD64_CMPQ_lt) Definations ¶
func (self *IrAMD64_CMPQ_lt) Definations() []*Reg
func (*IrAMD64_CMPQ_lt) String ¶
func (self *IrAMD64_CMPQ_lt) String() string
func (*IrAMD64_CMPQ_lt) Usages ¶
func (self *IrAMD64_CMPQ_lt) Usages() []*Reg
type IrAMD64_CMPQ_ltu ¶
func (*IrAMD64_CMPQ_ltu) Definations ¶
func (self *IrAMD64_CMPQ_ltu) Definations() []*Reg
func (*IrAMD64_CMPQ_ltu) String ¶
func (self *IrAMD64_CMPQ_ltu) String() string
func (*IrAMD64_CMPQ_ltu) Usages ¶
func (self *IrAMD64_CMPQ_ltu) Usages() []*Reg
type IrAMD64_CMPQ_ne ¶
func (*IrAMD64_CMPQ_ne) Definations ¶
func (self *IrAMD64_CMPQ_ne) Definations() []*Reg
func (*IrAMD64_CMPQ_ne) String ¶
func (self *IrAMD64_CMPQ_ne) String() string
func (*IrAMD64_CMPQ_ne) Usages ¶
func (self *IrAMD64_CMPQ_ne) Usages() []*Reg
type IrAMD64_IMULQ ¶
func (*IrAMD64_IMULQ) Definations ¶
func (self *IrAMD64_IMULQ) Definations() []*Reg
func (*IrAMD64_IMULQ) String ¶
func (self *IrAMD64_IMULQ) String() string
func (*IrAMD64_IMULQ) Usages ¶
func (self *IrAMD64_IMULQ) Usages() []*Reg
type IrAMD64_INT ¶
type IrAMD64_INT struct {
I uint8
}
func (*IrAMD64_INT) String ¶
func (self *IrAMD64_INT) String() string
type IrAMD64_JE_imm ¶
type IrAMD64_JE_imm struct { R Reg V int64 To *BasicBlock Ln *BasicBlock }
func (*IrAMD64_JE_imm) String ¶
func (self *IrAMD64_JE_imm) String() string
func (*IrAMD64_JE_imm) Successors ¶
func (self *IrAMD64_JE_imm) Successors() IrSuccessors
func (*IrAMD64_JE_imm) Usages ¶
func (self *IrAMD64_JE_imm) Usages() []*Reg
type IrAMD64_JMP ¶
type IrAMD64_JMP struct {
To *BasicBlock
}
func (*IrAMD64_JMP) String ¶
func (self *IrAMD64_JMP) String() string
func (*IrAMD64_JMP) Successors ¶
func (self *IrAMD64_JMP) Successors() IrSuccessors
type IrAMD64_LEA ¶
func (*IrAMD64_LEA) Definations ¶
func (self *IrAMD64_LEA) Definations() []*Reg
func (*IrAMD64_LEA) String ¶
func (self *IrAMD64_LEA) String() string
func (*IrAMD64_LEA) Usages ¶
func (self *IrAMD64_LEA) Usages() (r []*Reg)
type IrAMD64_MOVBE_load ¶
func (*IrAMD64_MOVBE_load) Definations ¶
func (self *IrAMD64_MOVBE_load) Definations() []*Reg
func (*IrAMD64_MOVBE_load) String ¶
func (self *IrAMD64_MOVBE_load) String() string
func (*IrAMD64_MOVBE_load) Usages ¶
func (self *IrAMD64_MOVBE_load) Usages() (r []*Reg)
type IrAMD64_MOVBE_store ¶
func (*IrAMD64_MOVBE_store) String ¶
func (self *IrAMD64_MOVBE_store) String() string
func (*IrAMD64_MOVBE_store) Usages ¶
func (self *IrAMD64_MOVBE_store) Usages() (r []*Reg)
type IrAMD64_MOVSLQ ¶
func (*IrAMD64_MOVSLQ) Definations ¶
func (self *IrAMD64_MOVSLQ) Definations() []*Reg
func (*IrAMD64_MOVSLQ) String ¶
func (self *IrAMD64_MOVSLQ) String() string
func (*IrAMD64_MOVSLQ) Usages ¶
func (self *IrAMD64_MOVSLQ) Usages() []*Reg
type IrAMD64_MOV_abs ¶
func (*IrAMD64_MOV_abs) Definations ¶
func (self *IrAMD64_MOV_abs) Definations() []*Reg
func (*IrAMD64_MOV_abs) String ¶
func (self *IrAMD64_MOV_abs) String() string
type IrAMD64_MOV_load ¶
func (*IrAMD64_MOV_load) Definations ¶
func (self *IrAMD64_MOV_load) Definations() []*Reg
func (*IrAMD64_MOV_load) String ¶
func (self *IrAMD64_MOV_load) String() string
func (*IrAMD64_MOV_load) Usages ¶
func (self *IrAMD64_MOV_load) Usages() (r []*Reg)
type IrAMD64_MOV_ptr ¶
func (*IrAMD64_MOV_ptr) Definations ¶
func (self *IrAMD64_MOV_ptr) Definations() []*Reg
func (*IrAMD64_MOV_ptr) String ¶
func (self *IrAMD64_MOV_ptr) String() string
type IrAMD64_MOV_reg ¶
func (*IrAMD64_MOV_reg) Definations ¶
func (self *IrAMD64_MOV_reg) Definations() []*Reg
func (*IrAMD64_MOV_reg) String ¶
func (self *IrAMD64_MOV_reg) String() string
func (*IrAMD64_MOV_reg) Usages ¶
func (self *IrAMD64_MOV_reg) Usages() []*Reg
type IrAMD64_MOV_store ¶
func (*IrAMD64_MOV_store) String ¶
func (self *IrAMD64_MOV_store) String() string
func (*IrAMD64_MOV_store) Usages ¶
func (self *IrAMD64_MOV_store) Usages() (r []*Reg)
type IrAMD64_NEG ¶
func (*IrAMD64_NEG) Definations ¶
func (self *IrAMD64_NEG) Definations() []*Reg
func (*IrAMD64_NEG) String ¶
func (self *IrAMD64_NEG) String() string
func (*IrAMD64_NEG) Usages ¶
func (self *IrAMD64_NEG) Usages() []*Reg
type IrAMD64_ORQ ¶
func (*IrAMD64_ORQ) Definations ¶
func (self *IrAMD64_ORQ) Definations() []*Reg
func (*IrAMD64_ORQ) String ¶
func (self *IrAMD64_ORQ) String() string
func (*IrAMD64_ORQ) Usages ¶
func (self *IrAMD64_ORQ) Usages() []*Reg
type IrAMD64_SHRQ ¶
func (*IrAMD64_SHRQ) Definations ¶
func (self *IrAMD64_SHRQ) Definations() []*Reg
func (*IrAMD64_SHRQ) String ¶
func (self *IrAMD64_SHRQ) String() string
func (*IrAMD64_SHRQ) Usages ¶
func (self *IrAMD64_SHRQ) Usages() []*Reg
type IrAMD64_SUBQ ¶
func (*IrAMD64_SUBQ) Definations ¶
func (self *IrAMD64_SUBQ) Definations() []*Reg
func (*IrAMD64_SUBQ) String ¶
func (self *IrAMD64_SUBQ) String() string
func (*IrAMD64_SUBQ) Usages ¶
func (self *IrAMD64_SUBQ) Usages() []*Reg
type IrAMD64_XORQ ¶
func (*IrAMD64_XORQ) Definations ¶
func (self *IrAMD64_XORQ) Definations() []*Reg
func (*IrAMD64_XORQ) String ¶
func (self *IrAMD64_XORQ) String() string
func (*IrAMD64_XORQ) Usages ¶
func (self *IrAMD64_XORQ) Usages() []*Reg
type IrBinaryExpr ¶
type IrBinaryExpr struct { R Reg X Reg Y Reg Op IrBinaryOp }
func IrCopy ¶
func IrCopy(r Reg, v Reg) *IrBinaryExpr
func (*IrBinaryExpr) Definations ¶
func (self *IrBinaryExpr) Definations() []*Reg
func (*IrBinaryExpr) String ¶
func (self *IrBinaryExpr) String() string
func (*IrBinaryExpr) Usages ¶
func (self *IrBinaryExpr) Usages() []*Reg
type IrBinaryOp ¶
type IrBinaryOp uint8
const ( IrOpAdd IrBinaryOp = iota IrOpSub IrOpMul IrOpAnd IrOpOr IrOpXor IrOpShr IrCmpEq IrCmpNe IrCmpLt IrCmpLtu IrCmpGeu )
func (IrBinaryOp) String ¶
func (self IrBinaryOp) String() string
type IrBitTestSet ¶
func (*IrBitTestSet) Definations ¶
func (self *IrBitTestSet) Definations() []*Reg
func (*IrBitTestSet) String ¶
func (self *IrBitTestSet) String() string
func (*IrBitTestSet) Usages ¶
func (self *IrBitTestSet) Usages() []*Reg
type IrBreakpoint ¶
type IrBreakpoint struct{}
func (IrBreakpoint) String ¶
func (IrBreakpoint) String() string
type IrCall ¶
type IrCall struct { Fn *hir.CallHandle Rx *IrReceiver In []Reg Out []Reg }
func (*IrCall) Definations ¶
type IrConstInt ¶
func (*IrConstInt) Definations ¶
func (self *IrConstInt) Definations() []*Reg
func (*IrConstInt) String ¶
func (self *IrConstInt) String() string
type IrConstPtr ¶
func (*IrConstPtr) Definations ¶
func (self *IrConstPtr) Definations() []*Reg
func (*IrConstPtr) String ¶
func (self *IrConstPtr) String() string
type IrDefinations ¶
type IrLEA ¶
func (*IrLEA) Definations ¶
type IrLoad ¶
func (*IrLoad) Definations ¶
type IrLoadArg ¶
func (*IrLoadArg) Definations ¶
type IrReceiver ¶
type IrReturn ¶
type IrReturn struct {
R []Reg
}
func (*IrReturn) Successors ¶
func (self *IrReturn) Successors() IrSuccessors
type IrSuccessors ¶
type IrSuccessors interface { Next() bool Block() *BasicBlock Value() (int64, bool) }
type IrSwitch ¶
type IrSwitch struct { V Reg Ln *BasicBlock Br map[int64]*BasicBlock }
func (*IrSwitch) Successors ¶
func (self *IrSwitch) Successors() IrSuccessors
type IrTerminator ¶
type IrTerminator interface { IrNode Successors() IrSuccessors // contains filtered or unexported methods }
type IrUnaryExpr ¶
func (*IrUnaryExpr) Definations ¶
func (self *IrUnaryExpr) Definations() []*Reg
func (*IrUnaryExpr) String ¶
func (self *IrUnaryExpr) String() string
func (*IrUnaryExpr) Usages ¶
func (self *IrUnaryExpr) Usages() []*Reg
type IrWriteBarrier ¶
func (*IrWriteBarrier) String ¶
func (self *IrWriteBarrier) String() string
func (*IrWriteBarrier) Usages ¶
func (self *IrWriteBarrier) Usages() []*Reg
type PassDescriptor ¶
type PhiElim ¶
type PhiElim struct{}
PhiElim replaces Phi nodes that are essentially copies with actual copy operaions.
type TDCE ¶
type TDCE struct{}
TDCE removes trivial dead-code such as unused register definations from CFG.
type WriteBarrier ¶
type WriteBarrier struct{}
WriteBarrier inserts memory write barrier for pointer stores.
func (WriteBarrier) Apply ¶
func (self WriteBarrier) Apply(cfg *CFG)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.