ssa

package
v0.0.0-...-5ea726b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K_sys  = 0
	K_zero = 1
	K_temp = 2
	K_arch = 3
	K_norm = 4
)

Variables

View Source
var (
	MinInt65 = Int65{0, 1}
	MaxInt65 = Int65{math.MaxUint64, 0}
)
View Source
var ArchRegIds = map[x86_64.Register64]uint64{
	x86_64.RAX: 0,
	x86_64.RCX: 1,
	x86_64.RDX: 2,
	x86_64.RBX: 3,
	x86_64.RSP: 4,
	x86_64.RBP: 5,
	x86_64.RSI: 6,
	x86_64.RDI: 7,
	x86_64.R8:  8,
	x86_64.R9:  9,
	x86_64.R10: 10,
	x86_64.R11: 11,
	x86_64.R12: 12,
	x86_64.R13: 13,
	x86_64.R14: 14,
	x86_64.R15: 15,
}
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 ArchRegReserved = map[x86_64.Register64]bool{
	x86_64.RSP: true,
	x86_64.RBP: true,
}
View Source
var Passes = []PassDescriptor{
	{Name: "Early Constant Propagation", Pass: new(ConstProp)},
	{Name: "Early Reduction", Pass: new(Reduce)},
	{Name: "Branch Elimination", Pass: new(BranchElim)},
	{Name: "Return Spreading", Pass: new(ReturnSpread)},
	{Name: "Value Reordering", Pass: new(Reorder)},
	{Name: "Late Constant Propagation", Pass: new(ConstProp)},
	{Name: "Late Reduction", Pass: new(Reduce)},
	{Name: "Machine Dependent Lowering", Pass: new(Lowering)},
	{Name: "Zero Register Substitution", Pass: new(ZeroReg)},
	{Name: "Write Barrier Insertion", Pass: new(WriteBarrier)},
	{Name: "ABI-Specific Lowering", Pass: new(ABILowering)},
	{Name: "Instruction Fusion", Pass: new(Fusion)},
	{Name: "Instruction Compaction", Pass: new(Compaction)},
	{Name: "Block Merging", Pass: new(BlockMerge)},
	{Name: "Critical Edge Splitting", Pass: new(SplitCritical)},
	{Name: "Phi Propagation", Pass: new(PhiProp)},
	{Name: "Operand Allocation", Pass: new(OperandAlloc)},
	{Name: "Constant Rematerialize", Pass: new(Rematerialize)},
	{Name: "Pre-allocation TDCE", Pass: new(TDCE)},
	{Name: "Register Allocation", Pass: new(RegAlloc)},
	{Name: "Stack Liveness Analysis", Pass: new(StackLiveness)},
	{Name: "Function Layout", Pass: new(Layout)},
}
View Source
var Reductions = []PassDescriptor{
	{Name: "Common Sub-expression Elimination", Pass: new(CSE)},
	{Name: "Phi Elimination", Pass: new(PhiElim)},
	{Name: "Copy Elimination", Pass: new(CopyElim)},
	{Name: "Trivial Dead Code Elimination", Pass: new(TDCE)},
}

Functions

func IrArchTryIntoCopy

func IrArchTryIntoCopy(v IrNode) (Reg, Reg, bool)

func IrTryIntoCopy

func IrTryIntoCopy(v IrNode) (Reg, Reg, bool)

Types

type ABILowering

type ABILowering struct{}

ABILowering lowers ABI-specific instructions to machine specific instructions.

func (ABILowering) Apply

func (self ABILowering) Apply(cfg *CFG)

type BasicBlock

type BasicBlock struct {
	Id   int
	Phi  []*IrPhi
	Ins  []IrNode
	Pred []*BasicBlock
	Term IrTerminator
}

func (*BasicBlock) String

func (self *BasicBlock) String() string

type BasicBlockIter

type BasicBlockIter struct {
	// contains filtered or unexported fields
}

func (*BasicBlockIter) Block

func (self *BasicBlockIter) Block() *BasicBlock

func (*BasicBlockIter) ForEach

func (self *BasicBlockIter) ForEach(action func(bb *BasicBlock))

func (*BasicBlockIter) Next

func (self *BasicBlockIter) Next() bool

func (*BasicBlockIter) Reversed

func (self *BasicBlockIter) Reversed() []*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 {
	Func              FuncData
	Root              *BasicBlock
	Depth             map[int]int
	Layout            *abi.FunctionLayout
	DominatedBy       map[int]*BasicBlock
	DominatorOf       map[int][]*BasicBlock
	DominanceFrontier map[int][]*BasicBlock
	// contains filtered or unexported fields
}

func Compile

func Compile(p hir.Program, fn interface{}) (cfg *CFG)

func (*CFG) CreateBlock

func (self *CFG) CreateBlock() (r *BasicBlock)

func (*CFG) CreateRegister

func (self *CFG) CreateRegister(ptr bool) Reg

func (*CFG) CreateUnreachable

func (self *CFG) CreateUnreachable(bb *BasicBlock) (ret *BasicBlock)

func (*CFG) MaxBlock

func (self *CFG) MaxBlock() int

func (*CFG) PostOrder

func (self *CFG) PostOrder() *BasicBlockIter

func (*CFG) Rebuild

func (self *CFG) Rebuild()

type CSE

type CSE struct{}

CSE performs the Common Sub-expression Elimintation optimization.

func (CSE) Apply

func (self CSE) Apply(cfg *CFG)

type Compaction

type Compaction struct{}

Compaction is like Fusion, but it performs the reverse action to reduce redundant operations.

func (Compaction) Apply

func (self Compaction) Apply(cfg *CFG)

type ConstProp

type ConstProp struct{}

ConstProp propagates constant through the expression tree.

func (ConstProp) Apply

func (self ConstProp) Apply(cfg *CFG)

type Constness

type Constness uint8
const (
	Const Constness = iota
	Volatile
)

func (Constness) String

func (self Constness) String() string

type CopyElim

type CopyElim struct{}

CopyElim removes unnessecery register copies.

func (CopyElim) Apply

func (CopyElim) Apply(cfg *CFG)

type FuncData

type FuncData struct {
	Code     []byte
	Layout   *FuncLayout
	Liveness map[Pos]SlotSet
	StackMap map[uintptr]*rt.StackMap
}

type FuncLayout

type FuncLayout struct {
	Ins   []IrNode
	Start map[int]int
	Block map[int]*BasicBlock
}

func (*FuncLayout) String

func (self *FuncLayout) String() string

type Fusion

type Fusion struct{}

Fusion fuses simple instructions into more complex one, to reduce the instruction count.

func (Fusion) Apply

func (self Fusion) Apply(cfg *CFG)

type Int65

type Int65 struct {
	// contains filtered or unexported fields
}

func Int65i

func Int65i(v int64) Int65

func (Int65) Compare

func (self Int65) Compare(other Int65) int

func (Int65) CompareZero

func (self Int65) CompareZero() int

func (Int65) OneLess

func (self Int65) OneLess() (r Int65)

func (Int65) OneMore

func (self Int65) OneMore() (r Int65)

func (Int65) String

func (self Int65) String() string

type IrAMD64_BSWAP

type IrAMD64_BSWAP struct {
	R Reg
	V Reg
	N uint8
}

func (*IrAMD64_BSWAP) Clone

func (self *IrAMD64_BSWAP) Clone() IrNode

func (*IrAMD64_BSWAP) Definitions

func (self *IrAMD64_BSWAP) Definitions() []*Reg

func (*IrAMD64_BSWAP) String

func (self *IrAMD64_BSWAP) String() string

func (*IrAMD64_BSWAP) Usages

func (self *IrAMD64_BSWAP) Usages() []*Reg

type IrAMD64_BTSQ_ri

type IrAMD64_BTSQ_ri struct {
	T Reg
	S Reg
	X Reg
	Y uint8
}

func (*IrAMD64_BTSQ_ri) Clone

func (self *IrAMD64_BTSQ_ri) Clone() IrNode

func (*IrAMD64_BTSQ_ri) Definitions

func (self *IrAMD64_BTSQ_ri) Definitions() []*Reg

func (*IrAMD64_BTSQ_ri) String

func (self *IrAMD64_BTSQ_ri) String() string

func (*IrAMD64_BTSQ_ri) Usages

func (self *IrAMD64_BTSQ_ri) Usages() []*Reg

type IrAMD64_BTSQ_rr

type IrAMD64_BTSQ_rr struct {
	T Reg
	S Reg
	X Reg
	Y Reg
}

func (*IrAMD64_BTSQ_rr) Clone

func (self *IrAMD64_BTSQ_rr) Clone() IrNode

func (*IrAMD64_BTSQ_rr) Definitions

func (self *IrAMD64_BTSQ_rr) Definitions() []*Reg

func (*IrAMD64_BTSQ_rr) String

func (self *IrAMD64_BTSQ_rr) String() string

func (*IrAMD64_BTSQ_rr) Usages

func (self *IrAMD64_BTSQ_rr) Usages() []*Reg

type IrAMD64_BinOp

type IrAMD64_BinOp uint8
const (
	IrAMD64_BinAdd IrAMD64_BinOp = iota
	IrAMD64_BinSub
	IrAMD64_BinMul
	IrAMD64_BinAnd
	IrAMD64_BinOr
	IrAMD64_BinXor
	IrAMD64_BinShr
)

func (IrAMD64_BinOp) IsAdditive

func (self IrAMD64_BinOp) IsAdditive() bool

func (IrAMD64_BinOp) ScaleFactor

func (self IrAMD64_BinOp) ScaleFactor() int32

func (IrAMD64_BinOp) String

func (self IrAMD64_BinOp) String() string

type IrAMD64_BinOp_ri

type IrAMD64_BinOp_ri struct {
	R  Reg
	X  Reg
	Y  int32
	Op IrAMD64_BinOp
}

func (*IrAMD64_BinOp_ri) Clone

func (self *IrAMD64_BinOp_ri) Clone() IrNode

func (*IrAMD64_BinOp_ri) Definitions

func (self *IrAMD64_BinOp_ri) Definitions() []*Reg

func (*IrAMD64_BinOp_ri) String

func (self *IrAMD64_BinOp_ri) String() string

func (*IrAMD64_BinOp_ri) Usages

func (self *IrAMD64_BinOp_ri) Usages() []*Reg

type IrAMD64_BinOp_rm

type IrAMD64_BinOp_rm struct {
	R  Reg
	X  Reg
	Y  Mem
	Op IrAMD64_BinOp
}

func (*IrAMD64_BinOp_rm) Clone

func (self *IrAMD64_BinOp_rm) Clone() IrNode

func (*IrAMD64_BinOp_rm) Definitions

func (self *IrAMD64_BinOp_rm) Definitions() []*Reg

func (*IrAMD64_BinOp_rm) MemOp

func (self *IrAMD64_BinOp_rm) MemOp() *Mem

func (*IrAMD64_BinOp_rm) String

func (self *IrAMD64_BinOp_rm) String() string

func (*IrAMD64_BinOp_rm) Usages

func (self *IrAMD64_BinOp_rm) Usages() []*Reg

type IrAMD64_BinOp_rr

type IrAMD64_BinOp_rr struct {
	R  Reg
	X  Reg
	Y  Reg
	Op IrAMD64_BinOp
}

func (*IrAMD64_BinOp_rr) Clone

func (self *IrAMD64_BinOp_rr) Clone() IrNode

func (*IrAMD64_BinOp_rr) Definitions

func (self *IrAMD64_BinOp_rr) Definitions() []*Reg

func (*IrAMD64_BinOp_rr) String

func (self *IrAMD64_BinOp_rr) String() string

func (*IrAMD64_BinOp_rr) Usages

func (self *IrAMD64_BinOp_rr) Usages() []*Reg

type IrAMD64_CALL_gcwb

type IrAMD64_CALL_gcwb struct {
	R  Reg
	M  Reg
	Fn unsafe.Pointer
}

func (*IrAMD64_CALL_gcwb) Clone

func (self *IrAMD64_CALL_gcwb) Clone() IrNode

func (*IrAMD64_CALL_gcwb) String

func (self *IrAMD64_CALL_gcwb) String() string

func (*IrAMD64_CALL_gcwb) Usages

func (self *IrAMD64_CALL_gcwb) Usages() []*Reg

type IrAMD64_CALL_mem

type IrAMD64_CALL_mem struct {
	Fn   Mem
	In   []Reg
	Out  []Reg
	Clob []Reg
}

func (*IrAMD64_CALL_mem) Clone

func (self *IrAMD64_CALL_mem) Clone() IrNode

func (*IrAMD64_CALL_mem) Definitions

func (self *IrAMD64_CALL_mem) Definitions() []*Reg

func (*IrAMD64_CALL_mem) MemOp

func (self *IrAMD64_CALL_mem) MemOp() *Mem

func (*IrAMD64_CALL_mem) String

func (self *IrAMD64_CALL_mem) String() string

func (*IrAMD64_CALL_mem) Usages

func (self *IrAMD64_CALL_mem) Usages() []*Reg

type IrAMD64_CALL_reg

type IrAMD64_CALL_reg struct {
	Fn   Reg
	In   []Reg
	Out  []Reg
	Clob []Reg
}

func (*IrAMD64_CALL_reg) Clone

func (self *IrAMD64_CALL_reg) Clone() IrNode

func (*IrAMD64_CALL_reg) Definitions

func (self *IrAMD64_CALL_reg) Definitions() []*Reg

func (*IrAMD64_CALL_reg) String

func (self *IrAMD64_CALL_reg) String() string

func (*IrAMD64_CALL_reg) Usages

func (self *IrAMD64_CALL_reg) Usages() []*Reg

type IrAMD64_CMPQ_im

type IrAMD64_CMPQ_im struct {
	R  Reg
	X  int32
	Y  Mem
	N  uint8
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_im) Clone

func (self *IrAMD64_CMPQ_im) Clone() IrNode

func (*IrAMD64_CMPQ_im) Definitions

func (self *IrAMD64_CMPQ_im) Definitions() []*Reg

func (*IrAMD64_CMPQ_im) MemOp

func (self *IrAMD64_CMPQ_im) MemOp() *Mem

func (*IrAMD64_CMPQ_im) String

func (self *IrAMD64_CMPQ_im) String() string

func (*IrAMD64_CMPQ_im) Usages

func (self *IrAMD64_CMPQ_im) Usages() []*Reg

type IrAMD64_CMPQ_ir

type IrAMD64_CMPQ_ir struct {
	R  Reg
	X  int32
	Y  Reg
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_ir) Clone

func (self *IrAMD64_CMPQ_ir) Clone() IrNode

func (*IrAMD64_CMPQ_ir) Definitions

func (self *IrAMD64_CMPQ_ir) Definitions() []*Reg

func (*IrAMD64_CMPQ_ir) String

func (self *IrAMD64_CMPQ_ir) String() string

func (*IrAMD64_CMPQ_ir) Usages

func (self *IrAMD64_CMPQ_ir) Usages() []*Reg

type IrAMD64_CMPQ_mi

type IrAMD64_CMPQ_mi struct {
	R  Reg
	X  Mem
	Y  int32
	N  uint8
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_mi) Clone

func (self *IrAMD64_CMPQ_mi) Clone() IrNode

func (*IrAMD64_CMPQ_mi) Definitions

func (self *IrAMD64_CMPQ_mi) Definitions() []*Reg

func (*IrAMD64_CMPQ_mi) MemOp

func (self *IrAMD64_CMPQ_mi) MemOp() *Mem

func (*IrAMD64_CMPQ_mi) String

func (self *IrAMD64_CMPQ_mi) String() string

func (*IrAMD64_CMPQ_mi) Usages

func (self *IrAMD64_CMPQ_mi) Usages() []*Reg

type IrAMD64_CMPQ_mp

type IrAMD64_CMPQ_mp struct {
	R  Reg
	X  Mem
	Y  unsafe.Pointer
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_mp) Clone

func (self *IrAMD64_CMPQ_mp) Clone() IrNode

func (*IrAMD64_CMPQ_mp) Definitions

func (self *IrAMD64_CMPQ_mp) Definitions() []*Reg

func (*IrAMD64_CMPQ_mp) MemOp

func (self *IrAMD64_CMPQ_mp) MemOp() *Mem

func (*IrAMD64_CMPQ_mp) String

func (self *IrAMD64_CMPQ_mp) String() string

func (*IrAMD64_CMPQ_mp) Usages

func (self *IrAMD64_CMPQ_mp) Usages() []*Reg

type IrAMD64_CMPQ_mr

type IrAMD64_CMPQ_mr struct {
	R  Reg
	X  Mem
	Y  Reg
	N  uint8
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_mr) Clone

func (self *IrAMD64_CMPQ_mr) Clone() IrNode

func (*IrAMD64_CMPQ_mr) Definitions

func (self *IrAMD64_CMPQ_mr) Definitions() []*Reg

func (*IrAMD64_CMPQ_mr) MemOp

func (self *IrAMD64_CMPQ_mr) MemOp() *Mem

func (*IrAMD64_CMPQ_mr) String

func (self *IrAMD64_CMPQ_mr) String() string

func (*IrAMD64_CMPQ_mr) Usages

func (self *IrAMD64_CMPQ_mr) Usages() []*Reg

type IrAMD64_CMPQ_pm

type IrAMD64_CMPQ_pm struct {
	R  Reg
	X  unsafe.Pointer
	Y  Mem
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_pm) Clone

func (self *IrAMD64_CMPQ_pm) Clone() IrNode

func (*IrAMD64_CMPQ_pm) Definitions

func (self *IrAMD64_CMPQ_pm) Definitions() []*Reg

func (*IrAMD64_CMPQ_pm) MemOp

func (self *IrAMD64_CMPQ_pm) MemOp() *Mem

func (*IrAMD64_CMPQ_pm) String

func (self *IrAMD64_CMPQ_pm) String() string

func (*IrAMD64_CMPQ_pm) Usages

func (self *IrAMD64_CMPQ_pm) Usages() []*Reg

type IrAMD64_CMPQ_pr

type IrAMD64_CMPQ_pr struct {
	R  Reg
	X  unsafe.Pointer
	Y  Reg
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_pr) Clone

func (self *IrAMD64_CMPQ_pr) Clone() IrNode

func (*IrAMD64_CMPQ_pr) Definitions

func (self *IrAMD64_CMPQ_pr) Definitions() []*Reg

func (*IrAMD64_CMPQ_pr) String

func (self *IrAMD64_CMPQ_pr) String() string

func (*IrAMD64_CMPQ_pr) Usages

func (self *IrAMD64_CMPQ_pr) Usages() []*Reg

type IrAMD64_CMPQ_ri

type IrAMD64_CMPQ_ri struct {
	R  Reg
	X  Reg
	Y  int32
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_ri) Clone

func (self *IrAMD64_CMPQ_ri) Clone() IrNode

func (*IrAMD64_CMPQ_ri) Definitions

func (self *IrAMD64_CMPQ_ri) Definitions() []*Reg

func (*IrAMD64_CMPQ_ri) String

func (self *IrAMD64_CMPQ_ri) String() string

func (*IrAMD64_CMPQ_ri) Usages

func (self *IrAMD64_CMPQ_ri) Usages() []*Reg

type IrAMD64_CMPQ_rm

type IrAMD64_CMPQ_rm struct {
	R  Reg
	X  Reg
	Y  Mem
	N  uint8
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_rm) Clone

func (self *IrAMD64_CMPQ_rm) Clone() IrNode

func (*IrAMD64_CMPQ_rm) Definitions

func (self *IrAMD64_CMPQ_rm) Definitions() []*Reg

func (*IrAMD64_CMPQ_rm) MemOp

func (self *IrAMD64_CMPQ_rm) MemOp() *Mem

func (*IrAMD64_CMPQ_rm) String

func (self *IrAMD64_CMPQ_rm) String() string

func (*IrAMD64_CMPQ_rm) Usages

func (self *IrAMD64_CMPQ_rm) Usages() []*Reg

type IrAMD64_CMPQ_rp

type IrAMD64_CMPQ_rp struct {
	R  Reg
	X  Reg
	Y  unsafe.Pointer
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_rp) Clone

func (self *IrAMD64_CMPQ_rp) Clone() IrNode

func (*IrAMD64_CMPQ_rp) Definitions

func (self *IrAMD64_CMPQ_rp) Definitions() []*Reg

func (*IrAMD64_CMPQ_rp) String

func (self *IrAMD64_CMPQ_rp) String() string

func (*IrAMD64_CMPQ_rp) Usages

func (self *IrAMD64_CMPQ_rp) Usages() []*Reg

type IrAMD64_CMPQ_rr

type IrAMD64_CMPQ_rr struct {
	R  Reg
	X  Reg
	Y  Reg
	Op IrAMD64_CmpOp
}

func (*IrAMD64_CMPQ_rr) Clone

func (self *IrAMD64_CMPQ_rr) Clone() IrNode

func (*IrAMD64_CMPQ_rr) Definitions

func (self *IrAMD64_CMPQ_rr) Definitions() []*Reg

func (*IrAMD64_CMPQ_rr) String

func (self *IrAMD64_CMPQ_rr) String() string

func (*IrAMD64_CMPQ_rr) Usages

func (self *IrAMD64_CMPQ_rr) Usages() []*Reg

type IrAMD64_CmpOp

type IrAMD64_CmpOp uint8
const (
	IrAMD64_CmpEq IrAMD64_CmpOp = iota
	IrAMD64_CmpNe
	IrAMD64_CmpLt
	IrAMD64_CmpGe
	IrAMD64_CmpLtu
	IrAMD64_CmpGeu
)

func (IrAMD64_CmpOp) Negated

func (self IrAMD64_CmpOp) Negated() IrAMD64_CmpOp

func (IrAMD64_CmpOp) String

func (self IrAMD64_CmpOp) String() string

type IrAMD64_INT

type IrAMD64_INT struct {
	I uint8
}

func (*IrAMD64_INT) Clone

func (self *IrAMD64_INT) Clone() IrNode

func (*IrAMD64_INT) String

func (self *IrAMD64_INT) String() string

type IrAMD64_JMP

type IrAMD64_JMP struct {
	To *IrBranch
}

func (*IrAMD64_JMP) Clone

func (self *IrAMD64_JMP) Clone() IrNode

func (*IrAMD64_JMP) String

func (self *IrAMD64_JMP) String() string

func (*IrAMD64_JMP) Successors

func (self *IrAMD64_JMP) Successors() IrSuccessors

type IrAMD64_JNC

type IrAMD64_JNC struct {
	To *IrBranch
	Ln *IrBranch
}

func (*IrAMD64_JNC) Clone

func (self *IrAMD64_JNC) Clone() IrNode

func (*IrAMD64_JNC) String

func (self *IrAMD64_JNC) String() string

func (*IrAMD64_JNC) Successors

func (self *IrAMD64_JNC) Successors() IrSuccessors

type IrAMD64_Jcc_im

type IrAMD64_Jcc_im struct {
	X  int32
	Y  Mem
	N  uint8
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_im) Clone

func (self *IrAMD64_Jcc_im) Clone() IrNode

func (*IrAMD64_Jcc_im) MemOp

func (self *IrAMD64_Jcc_im) MemOp() *Mem

func (*IrAMD64_Jcc_im) String

func (self *IrAMD64_Jcc_im) String() string

func (*IrAMD64_Jcc_im) Successors

func (self *IrAMD64_Jcc_im) Successors() IrSuccessors

func (*IrAMD64_Jcc_im) Usages

func (self *IrAMD64_Jcc_im) Usages() []*Reg

type IrAMD64_Jcc_ir

type IrAMD64_Jcc_ir struct {
	X  int32
	Y  Reg
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_ir) Clone

func (self *IrAMD64_Jcc_ir) Clone() IrNode

func (*IrAMD64_Jcc_ir) String

func (self *IrAMD64_Jcc_ir) String() string

func (*IrAMD64_Jcc_ir) Successors

func (self *IrAMD64_Jcc_ir) Successors() IrSuccessors

func (*IrAMD64_Jcc_ir) Usages

func (self *IrAMD64_Jcc_ir) Usages() []*Reg

type IrAMD64_Jcc_mi

type IrAMD64_Jcc_mi struct {
	X  Mem
	Y  int32
	N  uint8
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_mi) Clone

func (self *IrAMD64_Jcc_mi) Clone() IrNode

func (*IrAMD64_Jcc_mi) MemOp

func (self *IrAMD64_Jcc_mi) MemOp() *Mem

func (*IrAMD64_Jcc_mi) String

func (self *IrAMD64_Jcc_mi) String() string

func (*IrAMD64_Jcc_mi) Successors

func (self *IrAMD64_Jcc_mi) Successors() IrSuccessors

func (*IrAMD64_Jcc_mi) Usages

func (self *IrAMD64_Jcc_mi) Usages() []*Reg

type IrAMD64_Jcc_mp

type IrAMD64_Jcc_mp struct {
	X  Mem
	Y  unsafe.Pointer
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_mp) Clone

func (self *IrAMD64_Jcc_mp) Clone() IrNode

func (*IrAMD64_Jcc_mp) MemOp

func (self *IrAMD64_Jcc_mp) MemOp() *Mem

func (*IrAMD64_Jcc_mp) String

func (self *IrAMD64_Jcc_mp) String() string

func (*IrAMD64_Jcc_mp) Successors

func (self *IrAMD64_Jcc_mp) Successors() IrSuccessors

func (*IrAMD64_Jcc_mp) Usages

func (self *IrAMD64_Jcc_mp) Usages() []*Reg

type IrAMD64_Jcc_mr

type IrAMD64_Jcc_mr struct {
	X  Mem
	Y  Reg
	N  uint8
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_mr) Clone

func (self *IrAMD64_Jcc_mr) Clone() IrNode

func (*IrAMD64_Jcc_mr) MemOp

func (self *IrAMD64_Jcc_mr) MemOp() *Mem

func (*IrAMD64_Jcc_mr) String

func (self *IrAMD64_Jcc_mr) String() string

func (*IrAMD64_Jcc_mr) Successors

func (self *IrAMD64_Jcc_mr) Successors() IrSuccessors

func (*IrAMD64_Jcc_mr) Usages

func (self *IrAMD64_Jcc_mr) Usages() []*Reg

type IrAMD64_Jcc_pm

type IrAMD64_Jcc_pm struct {
	X  unsafe.Pointer
	Y  Mem
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_pm) Clone

func (self *IrAMD64_Jcc_pm) Clone() IrNode

func (*IrAMD64_Jcc_pm) MemOp

func (self *IrAMD64_Jcc_pm) MemOp() *Mem

func (*IrAMD64_Jcc_pm) String

func (self *IrAMD64_Jcc_pm) String() string

func (*IrAMD64_Jcc_pm) Successors

func (self *IrAMD64_Jcc_pm) Successors() IrSuccessors

func (*IrAMD64_Jcc_pm) Usages

func (self *IrAMD64_Jcc_pm) Usages() []*Reg

type IrAMD64_Jcc_pr

type IrAMD64_Jcc_pr struct {
	X  unsafe.Pointer
	Y  Reg
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_pr) Clone

func (self *IrAMD64_Jcc_pr) Clone() IrNode

func (*IrAMD64_Jcc_pr) String

func (self *IrAMD64_Jcc_pr) String() string

func (*IrAMD64_Jcc_pr) Successors

func (self *IrAMD64_Jcc_pr) Successors() IrSuccessors

func (*IrAMD64_Jcc_pr) Usages

func (self *IrAMD64_Jcc_pr) Usages() []*Reg

type IrAMD64_Jcc_ri

type IrAMD64_Jcc_ri struct {
	X  Reg
	Y  int32
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_ri) Clone

func (self *IrAMD64_Jcc_ri) Clone() IrNode

func (*IrAMD64_Jcc_ri) String

func (self *IrAMD64_Jcc_ri) String() string

func (*IrAMD64_Jcc_ri) Successors

func (self *IrAMD64_Jcc_ri) Successors() IrSuccessors

func (*IrAMD64_Jcc_ri) Usages

func (self *IrAMD64_Jcc_ri) Usages() []*Reg

type IrAMD64_Jcc_rm

type IrAMD64_Jcc_rm struct {
	X  Reg
	Y  Mem
	N  uint8
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_rm) Clone

func (self *IrAMD64_Jcc_rm) Clone() IrNode

func (*IrAMD64_Jcc_rm) MemOp

func (self *IrAMD64_Jcc_rm) MemOp() *Mem

func (*IrAMD64_Jcc_rm) String

func (self *IrAMD64_Jcc_rm) String() string

func (*IrAMD64_Jcc_rm) Successors

func (self *IrAMD64_Jcc_rm) Successors() IrSuccessors

func (*IrAMD64_Jcc_rm) Usages

func (self *IrAMD64_Jcc_rm) Usages() []*Reg

type IrAMD64_Jcc_rp

type IrAMD64_Jcc_rp struct {
	X  Reg
	Y  unsafe.Pointer
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_rp) Clone

func (self *IrAMD64_Jcc_rp) Clone() IrNode

func (*IrAMD64_Jcc_rp) String

func (self *IrAMD64_Jcc_rp) String() string

func (*IrAMD64_Jcc_rp) Successors

func (self *IrAMD64_Jcc_rp) Successors() IrSuccessors

func (*IrAMD64_Jcc_rp) Usages

func (self *IrAMD64_Jcc_rp) Usages() []*Reg

type IrAMD64_Jcc_rr

type IrAMD64_Jcc_rr struct {
	X  Reg
	Y  Reg
	To *IrBranch
	Ln *IrBranch
	Op IrAMD64_CmpOp
}

func (*IrAMD64_Jcc_rr) Clone

func (self *IrAMD64_Jcc_rr) Clone() IrNode

func (*IrAMD64_Jcc_rr) String

func (self *IrAMD64_Jcc_rr) String() string

func (*IrAMD64_Jcc_rr) Successors

func (self *IrAMD64_Jcc_rr) Successors() IrSuccessors

func (*IrAMD64_Jcc_rr) Usages

func (self *IrAMD64_Jcc_rr) Usages() []*Reg

type IrAMD64_LEA

type IrAMD64_LEA struct {
	R Reg
	M Mem
}

func (*IrAMD64_LEA) Clone

func (self *IrAMD64_LEA) Clone() IrNode

func (*IrAMD64_LEA) Definitions

func (self *IrAMD64_LEA) Definitions() []*Reg

func (*IrAMD64_LEA) MemOp

func (self *IrAMD64_LEA) MemOp() *Mem

func (*IrAMD64_LEA) String

func (self *IrAMD64_LEA) String() string

func (*IrAMD64_LEA) Usages

func (self *IrAMD64_LEA) Usages() (r []*Reg)

type IrAMD64_MOVSLQ

type IrAMD64_MOVSLQ struct {
	R Reg
	V Reg
}

func (*IrAMD64_MOVSLQ) Clone

func (self *IrAMD64_MOVSLQ) Clone() IrNode

func (*IrAMD64_MOVSLQ) Definitions

func (self *IrAMD64_MOVSLQ) Definitions() []*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

type IrAMD64_MOV_abs struct {
	R Reg
	V int64
}

func (*IrAMD64_MOV_abs) Clone

func (self *IrAMD64_MOV_abs) Clone() IrNode

func (*IrAMD64_MOV_abs) Definitions

func (self *IrAMD64_MOV_abs) Definitions() []*Reg

func (*IrAMD64_MOV_abs) String

func (self *IrAMD64_MOV_abs) String() string

type IrAMD64_MOV_load

type IrAMD64_MOV_load struct {
	R Reg
	M Mem
	N uint8
}

func (*IrAMD64_MOV_load) Clone

func (self *IrAMD64_MOV_load) Clone() IrNode

func (*IrAMD64_MOV_load) Definitions

func (self *IrAMD64_MOV_load) Definitions() []*Reg

func (*IrAMD64_MOV_load) MemOp

func (self *IrAMD64_MOV_load) MemOp() *Mem

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_load_be

type IrAMD64_MOV_load_be struct {
	R Reg
	M Mem
	N uint8
}

func (*IrAMD64_MOV_load_be) Clone

func (self *IrAMD64_MOV_load_be) Clone() IrNode

func (*IrAMD64_MOV_load_be) Definitions

func (self *IrAMD64_MOV_load_be) Definitions() []*Reg

func (*IrAMD64_MOV_load_be) MemOp

func (self *IrAMD64_MOV_load_be) MemOp() *Mem

func (*IrAMD64_MOV_load_be) String

func (self *IrAMD64_MOV_load_be) String() string

func (*IrAMD64_MOV_load_be) Usages

func (self *IrAMD64_MOV_load_be) Usages() (r []*Reg)

type IrAMD64_MOV_load_stack

type IrAMD64_MOV_load_stack struct {
	R Reg
	S uintptr
	K IrSlotKind
}

func (*IrAMD64_MOV_load_stack) Clone

func (self *IrAMD64_MOV_load_stack) Clone() IrNode

func (*IrAMD64_MOV_load_stack) Definitions

func (self *IrAMD64_MOV_load_stack) Definitions() (r []*Reg)

func (*IrAMD64_MOV_load_stack) String

func (self *IrAMD64_MOV_load_stack) String() string

type IrAMD64_MOV_ptr

type IrAMD64_MOV_ptr struct {
	R Reg
	P unsafe.Pointer
}

func (*IrAMD64_MOV_ptr) Clone

func (self *IrAMD64_MOV_ptr) Clone() IrNode

func (*IrAMD64_MOV_ptr) Definitions

func (self *IrAMD64_MOV_ptr) Definitions() []*Reg

func (*IrAMD64_MOV_ptr) String

func (self *IrAMD64_MOV_ptr) String() string

type IrAMD64_MOV_reg

type IrAMD64_MOV_reg struct {
	R Reg
	V Reg
}

func (*IrAMD64_MOV_reg) Clone

func (self *IrAMD64_MOV_reg) Clone() IrNode

func (*IrAMD64_MOV_reg) Definitions

func (self *IrAMD64_MOV_reg) Definitions() []*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_be

type IrAMD64_MOV_store_be struct {
	R Reg
	M Mem
	N uint8
}

func (*IrAMD64_MOV_store_be) Clone

func (self *IrAMD64_MOV_store_be) Clone() IrNode

func (*IrAMD64_MOV_store_be) MemOp

func (self *IrAMD64_MOV_store_be) MemOp() *Mem

func (*IrAMD64_MOV_store_be) String

func (self *IrAMD64_MOV_store_be) String() string

func (*IrAMD64_MOV_store_be) Usages

func (self *IrAMD64_MOV_store_be) Usages() (r []*Reg)

type IrAMD64_MOV_store_i

type IrAMD64_MOV_store_i struct {
	V int32
	M Mem
	N uint8
}

func (*IrAMD64_MOV_store_i) Clone

func (self *IrAMD64_MOV_store_i) Clone() IrNode

func (*IrAMD64_MOV_store_i) MemOp

func (self *IrAMD64_MOV_store_i) MemOp() *Mem

func (*IrAMD64_MOV_store_i) String

func (self *IrAMD64_MOV_store_i) String() string

func (*IrAMD64_MOV_store_i) Usages

func (self *IrAMD64_MOV_store_i) Usages() (r []*Reg)

type IrAMD64_MOV_store_p

type IrAMD64_MOV_store_p struct {
	P unsafe.Pointer
	M Mem
}

func (*IrAMD64_MOV_store_p) Clone

func (self *IrAMD64_MOV_store_p) Clone() IrNode

func (*IrAMD64_MOV_store_p) MemOp

func (self *IrAMD64_MOV_store_p) MemOp() *Mem

func (*IrAMD64_MOV_store_p) String

func (self *IrAMD64_MOV_store_p) String() string

func (*IrAMD64_MOV_store_p) Usages

func (self *IrAMD64_MOV_store_p) Usages() (r []*Reg)

type IrAMD64_MOV_store_r

type IrAMD64_MOV_store_r struct {
	R Reg
	M Mem
	N uint8
}

func (*IrAMD64_MOV_store_r) Clone

func (self *IrAMD64_MOV_store_r) Clone() IrNode

func (*IrAMD64_MOV_store_r) MemOp

func (self *IrAMD64_MOV_store_r) MemOp() *Mem

func (*IrAMD64_MOV_store_r) String

func (self *IrAMD64_MOV_store_r) String() string

func (*IrAMD64_MOV_store_r) Usages

func (self *IrAMD64_MOV_store_r) Usages() (r []*Reg)

type IrAMD64_MOV_store_stack

type IrAMD64_MOV_store_stack struct {
	R Reg
	S uintptr
	K IrSlotKind
}

func (*IrAMD64_MOV_store_stack) Clone

func (self *IrAMD64_MOV_store_stack) Clone() IrNode

func (*IrAMD64_MOV_store_stack) String

func (self *IrAMD64_MOV_store_stack) String() string

func (*IrAMD64_MOV_store_stack) Usages

func (self *IrAMD64_MOV_store_stack) Usages() (r []*Reg)

type IrAMD64_MemOp

type IrAMD64_MemOp interface {
	MemOp() *Mem
}

type IrAMD64_NEG

type IrAMD64_NEG struct {
	R Reg
	V Reg
}

func (*IrAMD64_NEG) Clone

func (self *IrAMD64_NEG) Clone() IrNode

func (*IrAMD64_NEG) Definitions

func (self *IrAMD64_NEG) Definitions() []*Reg

func (*IrAMD64_NEG) String

func (self *IrAMD64_NEG) String() string

func (*IrAMD64_NEG) Usages

func (self *IrAMD64_NEG) Usages() []*Reg

type IrAMD64_RET

type IrAMD64_RET struct {
	R []Reg
}

func (*IrAMD64_RET) Clone

func (self *IrAMD64_RET) Clone() IrNode

func (*IrAMD64_RET) String

func (self *IrAMD64_RET) String() string

func (*IrAMD64_RET) Successors

func (self *IrAMD64_RET) Successors() IrSuccessors

func (*IrAMD64_RET) Usages

func (self *IrAMD64_RET) Usages() []*Reg

type IrAlias

type IrAlias struct {
	R Reg
	V Reg
}

func (*IrAlias) Clone

func (self *IrAlias) Clone() IrNode

func (*IrAlias) Definitions

func (self *IrAlias) Definitions() []*Reg

func (*IrAlias) String

func (self *IrAlias) String() string

func (*IrAlias) Usages

func (self *IrAlias) Usages() []*Reg

type IrBinaryExpr

type IrBinaryExpr struct {
	R  Reg
	X  Reg
	Y  Reg
	Op IrBinaryOp
}

func (*IrBinaryExpr) Clone

func (self *IrBinaryExpr) Clone() IrNode

func (*IrBinaryExpr) Definitions

func (self *IrBinaryExpr) Definitions() []*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

type IrBitTestSet struct {
	T Reg
	S Reg
	X Reg
	Y Reg
}

func (*IrBitTestSet) Clone

func (self *IrBitTestSet) Clone() IrNode

func (*IrBitTestSet) Definitions

func (self *IrBitTestSet) Definitions() []*Reg

func (*IrBitTestSet) String

func (self *IrBitTestSet) String() string

func (*IrBitTestSet) Usages

func (self *IrBitTestSet) Usages() []*Reg

type IrBranch

type IrBranch struct {
	To         *BasicBlock
	Likeliness Likeliness
}

func IrLikely

func IrLikely(bb *BasicBlock) *IrBranch

func IrUnlikely

func IrUnlikely(bb *BasicBlock) *IrBranch

func (*IrBranch) Clone

func (self *IrBranch) Clone() *IrBranch

func (*IrBranch) String

func (self *IrBranch) String() string

type IrBreakpoint

type IrBreakpoint struct{}

func (*IrBreakpoint) Clone

func (*IrBreakpoint) Clone() IrNode

func (*IrBreakpoint) String

func (*IrBreakpoint) String() string

type IrCallFunc

type IrCallFunc struct {
	R    Reg
	In   []Reg
	Out  []Reg
	Func *abi.FunctionLayout
}

func (*IrCallFunc) Clone

func (self *IrCallFunc) Clone() IrNode

func (*IrCallFunc) Definitions

func (self *IrCallFunc) Definitions() []*Reg

func (*IrCallFunc) String

func (self *IrCallFunc) String() string

func (*IrCallFunc) Usages

func (self *IrCallFunc) Usages() []*Reg

type IrCallMethod

type IrCallMethod struct {
	T    Reg
	V    Reg
	In   []Reg
	Out  []Reg
	Slot int
	Func *abi.FunctionLayout
}

func (*IrCallMethod) Clone

func (self *IrCallMethod) Clone() IrNode

func (*IrCallMethod) Definitions

func (self *IrCallMethod) Definitions() []*Reg

func (*IrCallMethod) String

func (self *IrCallMethod) String() string

func (*IrCallMethod) Usages

func (self *IrCallMethod) Usages() []*Reg

type IrCallNative

type IrCallNative struct {
	R   Reg
	In  []Reg
	Out Reg
}

func (*IrCallNative) Clone

func (self *IrCallNative) Clone() IrNode

func (*IrCallNative) Definitions

func (self *IrCallNative) Definitions() []*Reg

func (*IrCallNative) String

func (self *IrCallNative) String() string

func (*IrCallNative) Usages

func (self *IrCallNative) Usages() []*Reg

type IrClobberList

type IrClobberList struct {
	R []Reg
}

func IrMarkClobber

func IrMarkClobber(r ...Reg) *IrClobberList

func (*IrClobberList) Clone

func (self *IrClobberList) Clone() IrNode

func (*IrClobberList) String

func (self *IrClobberList) String() string

func (*IrClobberList) Usages

func (self *IrClobberList) Usages() []*Reg

type IrConstInt

type IrConstInt struct {
	R Reg
	V int64
}

func (*IrConstInt) Clone

func (self *IrConstInt) Clone() IrNode

func (*IrConstInt) Definitions

func (self *IrConstInt) Definitions() []*Reg

func (*IrConstInt) String

func (self *IrConstInt) String() string

type IrConstPtr

type IrConstPtr struct {
	R Reg
	P unsafe.Pointer
	M Constness
}

func (*IrConstPtr) Clone

func (self *IrConstPtr) Clone() IrNode

func (*IrConstPtr) Definitions

func (self *IrConstPtr) Definitions() []*Reg

func (*IrConstPtr) String

func (self *IrConstPtr) String() string

type IrDefinitions

type IrDefinitions interface {
	IrNode
	Definitions() []*Reg
}

type IrEntry

type IrEntry struct {
	R []Reg
}

func (*IrEntry) Clone

func (self *IrEntry) Clone() IrNode

func (*IrEntry) Definitions

func (self *IrEntry) Definitions() []*Reg

func (*IrEntry) String

func (self *IrEntry) String() string

type IrImmovable

type IrImmovable interface {
	IrNode
	// contains filtered or unexported methods
}

type IrImpure

type IrImpure interface {
	IrNode
	// contains filtered or unexported methods
}

type IrLEA

type IrLEA struct {
	R   Reg
	Mem Reg
	Off Reg
}

func (*IrLEA) Clone

func (self *IrLEA) Clone() IrNode

func (*IrLEA) Definitions

func (self *IrLEA) Definitions() []*Reg

func (*IrLEA) String

func (self *IrLEA) String() string

func (*IrLEA) Usages

func (self *IrLEA) Usages() []*Reg

type IrLoad

type IrLoad struct {
	R    Reg
	Mem  Reg
	Size uint8
}

func (*IrLoad) Clone

func (self *IrLoad) Clone() IrNode

func (*IrLoad) Definitions

func (self *IrLoad) Definitions() []*Reg

func (*IrLoad) String

func (self *IrLoad) String() string

func (*IrLoad) Usages

func (self *IrLoad) Usages() []*Reg

type IrLoadArg

type IrLoadArg struct {
	R Reg
	I int
}

func (*IrLoadArg) Clone

func (self *IrLoadArg) Clone() IrNode

func (*IrLoadArg) Definitions

func (self *IrLoadArg) Definitions() []*Reg

func (*IrLoadArg) String

func (self *IrLoadArg) String() string

type IrNode

type IrNode interface {
	fmt.Stringer
	Clone() IrNode
	// contains filtered or unexported methods
}

func IrArchConstInt

func IrArchConstInt(r Reg, v int64) IrNode

func IrArchConstPtr

func IrArchConstPtr(r Reg, p unsafe.Pointer) IrNode

func IrArchCopy

func IrArchCopy(r Reg, v Reg) IrNode

func IrArchLoadStack

func IrArchLoadStack(reg Reg, offs uintptr, kind IrSlotKind) IrNode

func IrArchStoreStack

func IrArchStoreStack(reg Reg, offs uintptr, kind IrSlotKind) IrNode

func IrArchZero

func IrArchZero(r Reg) IrNode

func IrCopy

func IrCopy(r Reg, v Reg) IrNode

func IrCreateSpill

func IrCreateSpill(reg Reg, id int, op IrSpillOp) IrNode

func IrCreateSpillEx

func IrCreateSpillEx(reg Reg, ptr bool, id int, op IrSpillOp) IrNode

func IrSlotGen

func IrSlotGen(s IrSpillSlot) IrNode

type IrNop

type IrNop struct{}

func (*IrNop) Clone

func (*IrNop) Clone() IrNode

func (*IrNop) String

func (*IrNop) String() string

type IrPhi

type IrPhi struct {
	R Reg
	V map[*BasicBlock]*Reg
}

func (*IrPhi) Clone

func (self *IrPhi) Clone() IrNode

func (*IrPhi) Definitions

func (self *IrPhi) Definitions() []*Reg

func (*IrPhi) String

func (self *IrPhi) String() string

func (*IrPhi) Usages

func (self *IrPhi) Usages() []*Reg

type IrReturn

type IrReturn struct {
	R []Reg
}

func (*IrReturn) Clone

func (self *IrReturn) Clone() IrNode

func (*IrReturn) String

func (self *IrReturn) String() string

func (*IrReturn) Successors

func (self *IrReturn) Successors() IrSuccessors

func (*IrReturn) Usages

func (self *IrReturn) Usages() []*Reg

type IrSlotAlive

type IrSlotAlive struct {
	S []IrSpillSlot
}

func (*IrSlotAlive) Clone

func (self *IrSlotAlive) Clone() IrNode

func (*IrSlotAlive) String

func (self *IrSlotAlive) String() string

type IrSlotKind

type IrSlotKind uint8
const (
	IrSlotArgs IrSlotKind = iota
	IrSlotCall
	IrSlotLocal
)

func (IrSlotKind) String

func (self IrSlotKind) String() string

type IrSpill

type IrSpill struct {
	R  Reg
	S  IrSpillSlot
	Op IrSpillOp
}

func (*IrSpill) Clone

func (self *IrSpill) Clone() IrNode

func (*IrSpill) Definitions

func (self *IrSpill) Definitions() []*Reg

func (*IrSpill) String

func (self *IrSpill) String() string

func (*IrSpill) Usages

func (self *IrSpill) Usages() []*Reg

type IrSpillOp

type IrSpillOp uint8
const (
	IrSpillStore IrSpillOp = iota
	IrSpillReload
)

func (IrSpillOp) String

func (self IrSpillOp) String() string

type IrSpillSlot

type IrSpillSlot uint64

func (IrSpillSlot) ID

func (self IrSpillSlot) ID() int

func (IrSpillSlot) IsPtr

func (self IrSpillSlot) IsPtr() bool

func (IrSpillSlot) String

func (self IrSpillSlot) String() string

type IrStore

type IrStore struct {
	R    Reg
	Mem  Reg
	Size uint8
}

func (*IrStore) Clone

func (self *IrStore) Clone() IrNode

func (*IrStore) String

func (self *IrStore) String() string

func (*IrStore) Usages

func (self *IrStore) Usages() []*Reg

type IrSuccessors

type IrSuccessors interface {
	Next() bool
	Block() *BasicBlock
	Value() (int32, bool)
	Likeliness() Likeliness
	UpdateBlock(bb *BasicBlock)
}

type IrSwitch

type IrSwitch struct {
	V  Reg
	Ln *IrBranch
	Br map[int32]*IrBranch
}

func (*IrSwitch) Clone

func (self *IrSwitch) Clone() IrNode

func (*IrSwitch) String

func (self *IrSwitch) String() string

func (*IrSwitch) Successors

func (self *IrSwitch) Successors() IrSuccessors

func (*IrSwitch) Usages

func (self *IrSwitch) Usages() []*Reg

type IrTerminator

type IrTerminator interface {
	IrNode
	Successors() IrSuccessors
	// contains filtered or unexported methods
}

func IrArchJump

func IrArchJump(to *BasicBlock) IrTerminator

func IrArchReturn

func IrArchReturn(rr []Reg) IrTerminator

type IrUnaryExpr

type IrUnaryExpr struct {
	R  Reg
	V  Reg
	Op IrUnaryOp
}

func (*IrUnaryExpr) Clone

func (self *IrUnaryExpr) Clone() IrNode

func (*IrUnaryExpr) Definitions

func (self *IrUnaryExpr) Definitions() []*Reg

func (*IrUnaryExpr) String

func (self *IrUnaryExpr) String() string

func (*IrUnaryExpr) Usages

func (self *IrUnaryExpr) Usages() []*Reg

type IrUnaryOp

type IrUnaryOp uint8
const (
	IrOpNegate IrUnaryOp = iota
	IrOpSwap16
	IrOpSwap32
	IrOpSwap64
	IrOpSx32to64
)

func (IrUnaryOp) String

func (self IrUnaryOp) String() string

type IrUsages

type IrUsages interface {
	IrNode
	Usages() []*Reg
}

type IrWriteBarrier

type IrWriteBarrier struct {
	R   Reg
	M   Reg
	Fn  Reg
	Var Reg
}

func (*IrWriteBarrier) Clone

func (self *IrWriteBarrier) Clone() IrNode

func (*IrWriteBarrier) String

func (self *IrWriteBarrier) String() string

func (*IrWriteBarrier) Usages

func (self *IrWriteBarrier) Usages() []*Reg

type Layout

type Layout struct{}

Layout flattens the CFG into a linear FuncLayout

func (Layout) Apply

func (self Layout) Apply(cfg *CFG)

type Likeliness

type Likeliness uint8
const (
	Likely Likeliness = iota
	Unlikely
)

func (Likeliness) String

func (self Likeliness) String() string

type Lowering

type Lowering struct{}

Lowering lowers generic SSA IR to arch-dependent SSA IR.

func (Lowering) Apply

func (Lowering) Apply(cfg *CFG)

type Mem

type Mem struct {
	M Reg
	I Reg
	S uint8
	D int32
}

func Ptr

func Ptr(r Reg, d int32) Mem

func (Mem) String

func (self Mem) String() string

type OperandAlloc

type OperandAlloc struct{}

OperandAlloc for AMD64 converts 3-operand or 2-operand pseudo-instructions to 2-operand or one-operand real instructions.

func (OperandAlloc) Apply

func (OperandAlloc) Apply(cfg *CFG)

type Pass

type Pass interface {
	Apply(*CFG)
}

type PassDescriptor

type PassDescriptor struct {
	Pass Pass
	Name string
}

type PhiElim

type PhiElim struct{}

PhiElim transforms Phi nodes into copies if possible.

func (PhiElim) Apply

func (self PhiElim) Apply(cfg *CFG)

type PhiProp

type PhiProp struct{}

PhiProp propagates Phi nodes into it's source blocks, essentially get rid of them. The CFG is no longer in SSA form after this pass.

func (PhiProp) Apply

func (self PhiProp) Apply(cfg *CFG)

type Pos

type Pos struct {
	B *BasicBlock
	I int
}

func (Pos) String

func (self Pos) String() string

type Reduce

type Reduce struct{}

Reduce combines CSE, PhiElim, CopyElim and TDCE.

func (Reduce) Apply

func (Reduce) Apply(cfg *CFG)

type Reg

type Reg uint64
const (
	Rz Reg = (0 << _B_ptr) | (K_zero << _B_kind)
	Pn Reg = (1 << _B_ptr) | (K_zero << _B_kind)
)

func IrArchTryIntoConstInt

func IrArchTryIntoConstInt(v IrNode) (Reg, int64, bool)

func IrArchTryIntoConstPtr

func IrArchTryIntoConstPtr(v IrNode) (Reg, unsafe.Pointer, bool)

func IrSetArch

func IrSetArch(rr Reg, reg x86_64.Register64) Reg

func IrTryIntoArchReturn

func IrTryIntoArchReturn(p IrNode) ([]Reg, bool)

func Pr

func Pr(i int) Reg

func Rv

func Rv(reg hir.Register) Reg

func Tr

func Tr(i int) Reg

func (Reg) Derive

func (self Reg) Derive(i int) Reg

func (Reg) Index

func (self Reg) Index() int

func (Reg) Kind

func (self Reg) Kind() int

func (Reg) Name

func (self Reg) Name() int

func (Reg) Normalize

func (self Reg) Normalize(i int) Reg

func (Reg) Ptr

func (self Reg) Ptr() bool

func (Reg) String

func (self Reg) String() string

func (Reg) Zero

func (self Reg) Zero() Reg

type RegAlloc

type RegAlloc struct{}

RegAlloc performs register allocation on CFG.

func (RegAlloc) Apply

func (self RegAlloc) Apply(cfg *CFG)

type Rematerialize

type Rematerialize struct{}

Rematerialize recalculates simple values to reduce register pressure.

func (Rematerialize) Apply

func (Rematerialize) Apply(cfg *CFG)

type Reorder

type Reorder struct{}

Reorder moves value closer to it's usage, which reduces register pressure.

func (Reorder) Apply

func (self Reorder) Apply(cfg *CFG)

type ReturnSpread

type ReturnSpread struct{}

ReturnSpread spreads the return block to all it's successors, in order to shorten register live ranges.

func (ReturnSpread) Apply

func (ReturnSpread) Apply(cfg *CFG)

type SlotSet

type SlotSet map[IrSpillSlot]struct{}

func (SlotSet) String

func (self SlotSet) String() string

type SplitCritical

type SplitCritical struct{}

SplitCritical splits critical edges (those that go from a block with more than one outedge to a block with more than one inedge) by inserting an empty block.

PhiProp wants a critical-edge-free CFG so it can safely remove Phi nodes for RegAlloc.

func (SplitCritical) Apply

func (SplitCritical) Apply(cfg *CFG)

type StackLiveness

type StackLiveness struct{}

StackLiveness calculates the liveness of each stack slot.

func (StackLiveness) Apply

func (self StackLiveness) Apply(cfg *CFG)

type TDCE

type TDCE struct{}

TDCE removes trivial dead-code such as unused register definations from CFG.

func (TDCE) Apply

func (TDCE) Apply(cfg *CFG)

type WriteBarrier

type WriteBarrier struct{}

WriteBarrier inserts write barriers for pointer stores.

func (WriteBarrier) Apply

func (WriteBarrier) Apply(cfg *CFG)

type ZeroReg

type ZeroReg struct{}

ZeroReg replaces read to %z or %nil to a register that was initialized to zero for architectures that does not have constant zero registers, such as `x86_64`.

func (ZeroReg) Apply

func (self ZeroReg) Apply(cfg *CFG)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL